OSDN Git Service

[denncoCreator] Implementing save functionality. The work is still in progress.
[dennco/denncoCreator.git] / Source / visualizer / component / dcvccell.h
1 //  Copyright (c) 2012 Dennco Project
2 //
3 // This program is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, either version 3 of the License, or
6 // (at your option) any later version.
7 //
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
16 //
17 //  Created by tkawata on Sep-30, 2012.
18 //
19 #ifndef DCVCCELL_H
20 #define DCVCCELL_H
21
22 #include "dcvpagecomponent.h"
23
24 class DCCell;
25 class DCCubeRenderer;
26 class DCSelectionRenderer;
27 class DCVCPage;
28
29 class DCVCCell : public DCVPageComponent
30 {
31     DCCell              *d_owner;
32     DCCubeRenderer      *d_shape;
33     bool                d_shouldUpdateShape;
34     DCSelectionRenderer *d_selectionRectRenderer;
35     float               d_dragOffsetX;
36     float               d_dragOffsetY;
37     float               d_dragOffsetZ;
38     float               d_draggingOriginalSize;
39     bool                d_isDragging;
40     bool                d_isResizingDrag;
41     float               d_draggingOriginalAxonLength;
42
43 public:
44     DCVCCell(DCCell *owner, DCVCPage *page, float size, float height);
45     virtual ~DCVCCell();
46
47
48     virtual DCCell*     getOwnerCell() const { return d_owner; }
49     virtual bool        isResizingArea(float x, float y, float z) const;
50
51     virtual void    changePageBelonging(DCVCPage *page);
52     virtual void    prepareChildrenForDraw(bool isAnimationInterval);
53     virtual void    drawChildren(bool isAnimationInterval);
54     virtual void    drawChildrenForSelection(QList<DCVComponent*> *itemList);
55     virtual void    translate();
56     virtual void    setSelected(bool selected, bool updateChildren);
57     virtual void    setVisible(DCVVisibility visible, DCVVisibility visibleChildren);
58     virtual void    setSelectable(bool selectable);
59     virtual void    renderOwnShape(bool isAnimationInterval, bool renderAsWireframe);
60     virtual void    updateShape();
61
62     virtual bool    startDrag(float x, float y, float z, bool isResizingDrag);
63     virtual bool    dragging(float x, float y, float z, bool isResizingDrag);
64     virtual bool    endDrag(float x, float y, float z, bool isResizingDrag);
65
66     virtual void    saveAttributesToXML(QDomDocument *document, QDomElement* element);
67     virtual void    loadAttributesFromXML(QDomElement element);
68
69     void    addReceptor();
70 };
71
72 #endif // DCVCCELL_H