]> SALOME platform Git repositories - modules/hexablock.git/blob - src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentItem.hxx
Salome HOME
Fix compilation problem with OCCT 6.7.0
[modules/hexablock.git] / src / HEXABLOCKGUI / HEXABLOCKGUI_DocumentItem.hxx
1 // Copyright (C) 2009-2013  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library 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 GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef _HEXABLOCKGUI_DOCUMENTITEM_HXX_
21 #define _HEXABLOCKGUI_DOCUMENTITEM_HXX_
22
23
24 #include <QStandardItem>
25
26 #include "HexVertex.hxx"
27 #include "HexEdge.hxx"
28 #include "HexQuad.hxx"
29 #include "HexHexa.hxx"
30
31
32 #include "HexVector.hxx"
33 #include "HexElements.hxx"
34 #include "HexNewShape.hxx"
35 #include "HexVertexShape.hxx"
36 #include "HexEdgeShape.hxx"
37 #include "HexFaceShape.hxx"
38
39 #include "HexGroup.hxx"
40 #include "HexLaw.hxx"
41 #include "HexPropagation.hxx"
42
43 #include "vtkActor.h"
44
45
46 Q_DECLARE_METATYPE( HEXA_NS::EltBase* );
47 Q_DECLARE_METATYPE( HEXA_NS::Vertex* );
48 Q_DECLARE_METATYPE( HEXA_NS::Edge* );
49 Q_DECLARE_METATYPE( HEXA_NS::Quad* );
50 Q_DECLARE_METATYPE( HEXA_NS::Hexa* );
51
52 Q_DECLARE_METATYPE( HEXA_NS::Vector* );
53 // Q_DECLARE_METATYPE( HEXA_NS::Cylinder* );
54 // Q_DECLARE_METATYPE( HEXA_NS::Pipe* );
55 Q_DECLARE_METATYPE( HEXA_NS::Elements* );
56 // Q_DECLARE_METATYPE( HEXA_NS::CrossElements* );
57 Q_DECLARE_METATYPE( HEXA_NS::NewShape* );
58 Q_DECLARE_METATYPE( HEXA_NS::SubShape* );
59 Q_DECLARE_METATYPE( HEXA_NS::VertexShape* );
60 Q_DECLARE_METATYPE( HEXA_NS::EdgeShape* );
61 Q_DECLARE_METATYPE( HEXA_NS::FaceShape* );
62
63 Q_DECLARE_METATYPE( HEXA_NS::Group* );
64 Q_DECLARE_METATYPE( HEXA_NS::Law* );
65 Q_DECLARE_METATYPE( HEXA_NS::Propagation* );
66
67
68
69 namespace HEXABLOCK
70 {
71   namespace GUI
72   {
73     enum HexaType {
74       VERTEXITEM = QStandardItem::UserType + 1,
75       EDGEITEM,
76       QUADITEM,
77       HEXAITEM,
78
79       VECTORITEM,
80       ELEMENTSITEM,
81       CROSSELEMENTSITEM,
82
83       EXPSHAPEITEM,
84       IMPSHAPEITEM,
85       CLOUDOFPOINTSITEM,
86       GEOMSHAPEITEM,
87       GEOMPOINTITEM,
88       GEOMEDGEITEM,
89       GEOMFACEITEM,
90
91       GROUPITEM,
92       LAWITEM,
93       PROPAGATIONITEM,
94     };
95
96     enum HexaTreeRole {
97       VERTEX_TREE = 10,
98       EDGE_TREE,
99       QUAD_TREE,
100       HEXA_TREE,
101
102       VECTOR_TREE,
103       ELEMENTS_TREE,
104       CROSSELEMENTS_TREE,
105
106       EXPLICIT_SHAPES_TREE,
107       IMPLICIT_SHAPES_TREE,
108       CLOUD_OF_POINTS_TREE,
109       GEOMSHAPE_TREE,
110       GEOMPOINT_TREE,
111       GEOMEDGE_TREE,
112       GEOMFACE_TREE,
113
114
115       GROUP_TREE,
116       LAW_TREE,
117       PROPAGATION_TREE,
118
119       VERTEX_DIR_TREE,
120       EDGE_DIR_TREE,
121       QUAD_DIR_TREE,
122       HEXA_DIR_TREE,
123
124       VECTOR_DIR_TREE,
125       ELEMENTS_DIR_TREE,
126       CROSSELEMENTS_DIR_TREE,
127
128       EXPLICIT_SHAPES_DIR_TREE,
129       IMPLICIT_SHAPES_DIR_TREE,
130       CLOUD_OF_POINTS_DIR_TREE,
131       GEOMSHAPE_DIR_TREE,
132       GEOMPOINT_DIR_TREE,
133       GEOMEDGE_DIR_TREE,
134       GEOMFACE_DIR_TREE,
135
136       GROUP_DIR_TREE,
137       LAW_DIR_TREE,
138       PROPAGATION_DIR_TREE
139
140     }; //HEXA_TREE_ROLE
141
142     enum {
143       HEXA_DATA_ROLE = Qt::UserRole + 1,
144       HEXA_DATA_ASSOC,
145       HEXA_TREE_ROLE,
146       HEXA_ENTRY_ROLE,
147       HEXA_DOC_ENTRY_ROLE,
148       HEXA_ASSOC_ENTRY_ROLE,
149     };
150
151 // QVariant::UserType
152
153     //===================================================================================
154     class HexaExport ElementItem : public QStandardItem
155     {
156       public:
157         ElementItem( HEXA_NS::EltBase* docElement, QString entry, HexaType ttype, HexaTreeRole treeRole);
158         ElementItem( HEXA_NS::EltBase* docElement, HexaType ttype, HexaTreeRole treeRole);
159         virtual QVariant data( int role ) const;
160         virtual void     setData ( const QVariant& valcont, int role );
161         int      type () const;
162         virtual bool     isAssoc() const;
163         virtual QString  IDptr() const;
164         HEXA_NS::EltBase* getEltBase() const { return m_DocElt;}
165
166       private:
167         int                m_type;
168         HEXA_NS::EltBase*  m_DocElt;
169     };
170     //===================================================================================
171
172     class HexaExport GraphicElementItem : public ElementItem
173     {
174       public:
175         GraphicElementItem( HEXA_NS::EltBase* docElement, QString entry, HexaType ttype, HexaTreeRole treeRole):
176                 ElementItem( docElement, entry, ttype, treeRole)
177         {
178         }
179
180       private:
181         vtkActor* actor;
182         int       IDinActor;
183     };
184
185     class HexaExport StandardElementItem : public ElementItem
186     {
187        public:
188         StandardElementItem( HEXA_NS::EltBase* docElement, QString entry, HexaType ttype, HexaTreeRole treeRole):
189                 ElementItem( docElement, entry, ttype, treeRole)
190         {
191         }
192     };
193
194     class HexaExport VertexItem : public GraphicElementItem
195     {
196       public:
197         VertexItem( HEXA_NS::Vertex* hexaVertex, QString entry = "");
198     };
199
200     class HexaExport EdgeItem : public GraphicElementItem
201     {
202       public:
203         EdgeItem( HEXA_NS::Edge* hexaEdge, QString entry = "");
204     };
205     //-----------------------------------------
206     class HexaExport QuadItem : public GraphicElementItem
207     {
208       public:
209         QuadItem( HEXA_NS::Quad* hexaQuad, QString entry = "");
210     };
211     //-----------------------------------------
212
213     class HexaExport HexaItem : public GraphicElementItem
214     {
215       public:
216         HexaItem( HEXA_NS::Hexa* hexaHexa, QString entry = "");
217     };
218     //-----------------------------------------
219
220     class HexaExport VectorItem : public StandardElementItem
221     {
222       public:
223         VectorItem( HEXA_NS::Vector* hexaVector, QString entry = "");
224     };
225     //-----------------------------------------
226
227 //    class HexaExport CylinderItem : public StandardElementItem
228 //    {
229 //      public:
230 //        CylinderItem( HEXA_NS::Cylinder* hexaCyl, QString entry = "");
231 //    };
232     //-----------------------------------------
233
234 //    class PipeItem : public StandardElementItem
235 //    {
236 //      public:
237 //        PipeItem( HEXA_NS::Pipe* hexaPipe, QString entry = "");
238 //    };
239     //-----------------------------------------
240
241     class HexaExport ElementsItem : public StandardElementItem
242     {
243       public:
244         ElementsItem( HEXA_NS::Elements* hexaElements, QString entry = "" );
245     };
246     //-----------------------------------------
247 //    class CrossElementsItem : public StandardElementItem
248 //    {
249 //      public:
250 //        CrossElementsItem( HEXA_NS::CrossElements* hexaCrossElts, QString entry = "");
251 //    };
252
253     //------------------------------------------------
254     class HexaExport GeomItem: public StandardElementItem
255     {
256     public:
257         GeomItem( HEXA_NS::EltBase* geomShape, QString entry, HexaType ttype, HexaTreeRole treeRole, HEXA_NS::EltBase* assoc = NULL );
258         HEXA_NS::EltBase* getAssociation() const { return association; }
259         void setAssociation(HEXA_NS::EltBase* assoc) { association = assoc; }
260
261     private:
262         HEXA_NS::EltBase* association;
263     };
264
265     //------------------------------------------------
266     class HexaExport GeomShapeItem: public GeomItem
267     {
268     public:
269         GeomShapeItem( HEXA_NS::NewShape* shape, HEXA_NS::EltBase* assoc = NULL);
270     };
271
272     //------------------------------------------------
273     class HexaExport GeomPointItem: public GeomItem
274     {
275     public:
276         GeomPointItem( HEXA_NS::VertexShape* geomPoint, HEXA_NS::Vertex* associatedVertex = NULL);
277     };
278
279     //------------------------------------------------
280     class HexaExport GeomEdgeItem: public GeomItem
281     {
282     public:
283         GeomEdgeItem( HEXA_NS::EdgeShape* geomEdge, HEXA_NS::Edge* associatedEdge = NULL);
284     };
285
286     //------------------------------------------------
287     class HexaExport GeomFaceItem: public GeomItem
288     {
289     public:
290         GeomFaceItem( HEXA_NS::FaceShape* geomFace, HEXA_NS::Quad* associatedQuad = NULL);
291     };
292
293     //-----------------------------------------
294     class HexaExport GroupItem : public QStandardItem
295     {
296     public:
297         GroupItem( HEXA_NS::Group* hexaGroup );
298         virtual int type () const;
299         virtual QVariant data ( int role ) const;
300         virtual void setData ( const QVariant & value, int role ); //= Qt::UserRole + 1 )
301     private:
302         HEXA_NS::Group* _hexaGroup;
303     };
304
305
306     class HexaExport LawItem : public QStandardItem
307     {
308     public:
309         LawItem( HEXA_NS::Law* hexaLaw );
310         virtual int type () const;
311         virtual QVariant data ( int role ) const;
312         virtual void setData ( const QVariant & value, int role ); //= Qt::UserRole + 1 )
313     private:
314         HEXA_NS::Law* _hexaLaw;
315     };
316
317
318     class HexaExport PropagationItem : public QStandardItem
319     {
320     public:
321         PropagationItem( HEXA_NS::Propagation* hexaPropagation );
322         virtual int type () const;
323         virtual QVariant data ( int role ) const;
324         virtual void setData ( const QVariant & value, int role ); //= Qt::UserRole + 1 )
325     private:
326         HEXA_NS::Propagation* _hexaPropagation;
327     };
328     //-------------------------------------------------
329
330   }
331 }
332
333 #endif
334