OSDN Git Service

Initial checkin for denncoCreator
[dennco/denncoCreator.git] / Source / visualizer / component / dcvcpage.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 DCVCPAGE_H
20 #define DCVCPAGE_H
21
22 #include "dcvcomponent.h"
23
24 class DCVCCell;
25 class DCVCCellCode;
26 class DCVPageComponent;
27
28 class DCVCPage : public DCVComponent
29 {
30     QString d_locationPath;
31     float   d_height;
32     float   d_width;
33     float   d_depth;
34     bool    d_shouldUpdateShape;
35     float   d_colorR;
36     float   d_colorG;
37     float   d_colorB;
38     float   d_colorA;
39
40     QList<DCVPageComponent*> d_cells;
41     DCVPageComponent *d_editCursor;
42
43 public:
44     DCVCPage(const QString &locationPath);
45     virtual ~DCVCPage();
46
47     virtual DCVCPage *      getPageBelonging() const { return const_cast<DCVCPage*>(this);}
48     virtual DCCell*         getOwnerCell() const { return NULL; }
49     virtual DCVVisibility   getIsVisible() const { return d_colorA == 0 ?  DCV_VISIBLE_NONE : DCVComponent::getIsVisible(); }
50     virtual bool            isResizingArea(float x, float y, float z) const { return false; }
51     QString                 getLocationPath() const { return d_locationPath; }
52
53     void registerCell(DCVPageComponent *cell);
54     void unregisterCell(DCVPageComponent *cell);
55
56     void registerEditCursor(DCVPageComponent *ecursor);
57     void unregisterEditCursor();
58
59     void updateVisiblity(bool linkedCellVisible, bool linkedCellRenderFull, bool linkedCellSelectable, bool otherCellVisible, bool otherCellRenderFull, bool otherCellSelectable);
60
61     virtual void    prepareChildrenForDraw(bool isAnimationInterval);
62     virtual void    drawChildren(bool isAnimationInterval);
63     virtual void    drawChildrenForSelection(QList<DCVComponent*> *itemList);
64     virtual void    translate();
65     virtual void    setSelected(bool selected, bool updateChildren);
66     virtual void    setVisible(DCVVisibility visibleSelf, DCVVisibility visibleChildren);
67     virtual void    renderOwnShape(bool isAnimationInterval, bool renderAsWireframe);
68
69     virtual bool    startDrag(float x, float y, float z, bool isResizingDrag);
70     virtual bool    dragging(float x, float y, float z, bool isResizingDrag);
71     virtual bool    endDrag(float x, float y, float z, bool isResizingDrag);
72     virtual void    updateShape() {}
73
74     void setHeight(float height);
75     void setWidth(float width);
76     void setDepth(float depth);
77     void setColor(float r, float g, float b, float a);
78 };
79
80 #endif // DCVCPAGE_H