1 // Copyright (C) 2009-2013 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef _HEXABLOCKGUI_DOCUMENTITEM_HXX_
21 #define _HEXABLOCKGUI_DOCUMENTITEM_HXX_
23 #include "HEXABLOCKGUI_Export.hxx"
25 #include <QStandardItem>
27 #include <HexVertex.hxx>
28 #include <HexEdge.hxx>
29 #include <HexQuad.hxx>
30 #include <HexHexa.hxx>
33 #include <HexVector.hxx>
34 #include <HexCylinder.hxx>
35 #include <HexPipe.hxx>
36 #include <HexElements.hxx>
37 #include <HexCrossElements.hxx>
38 #include <HexNewShape.hxx>
39 #include <HexVertexShape.hxx>
40 #include <HexEdgeShape.hxx>
41 #include <HexFaceShape.hxx>
45 #include <HexGroup.hxx>
47 #include <HexPropagation.hxx>
52 Q_DECLARE_METATYPE( HEXA_NS::EltBase* );
53 Q_DECLARE_METATYPE( HEXA_NS::Vertex* );
54 Q_DECLARE_METATYPE( HEXA_NS::Edge* );
55 Q_DECLARE_METATYPE( HEXA_NS::Quad* );
56 Q_DECLARE_METATYPE( HEXA_NS::Hexa* );
58 Q_DECLARE_METATYPE( HEXA_NS::Vector* );
59 Q_DECLARE_METATYPE( HEXA_NS::Cylinder* );
60 Q_DECLARE_METATYPE( HEXA_NS::Pipe* );
61 Q_DECLARE_METATYPE( HEXA_NS::Elements* );
62 Q_DECLARE_METATYPE( HEXA_NS::CrossElements* );
63 Q_DECLARE_METATYPE( HEXA_NS::NewShape* );
64 Q_DECLARE_METATYPE( HEXA_NS::SubShape* );
65 Q_DECLARE_METATYPE( HEXA_NS::VertexShape* );
66 Q_DECLARE_METATYPE( HEXA_NS::EdgeShape* );
67 Q_DECLARE_METATYPE( HEXA_NS::FaceShape* );
69 Q_DECLARE_METATYPE( HEXA_NS::Group* );
70 Q_DECLARE_METATYPE( HEXA_NS::Law* );
71 Q_DECLARE_METATYPE( HEXA_NS::Propagation* );
80 VERTEXITEM = QStandardItem::UserType + 1,
112 EXPLICIT_SHAPES_TREE,
113 IMPLICIT_SHAPES_TREE,
114 CLOUD_OF_POINTS_TREE,
132 CROSSELEMENTS_DIR_TREE,
134 EXPLICIT_SHAPES_DIR_TREE,
135 IMPLICIT_SHAPES_DIR_TREE,
136 CLOUD_OF_POINTS_DIR_TREE,
149 HEXA_DATA_ROLE = Qt::UserRole + 1,
154 HEXA_ASSOC_ENTRY_ROLE,
157 // QVariant::UserType
159 //===================================================================================
160 class HEXABLOCK_EXPORT ElementItem : public QStandardItem
163 ElementItem( HEXA_NS::EltBase* docElement, QString entry, HexaType ttype, HexaTreeRole treeRole);
164 ElementItem( HEXA_NS::EltBase* docElement, HexaType ttype, HexaTreeRole treeRole);
165 virtual QVariant data( int role ) const;
166 virtual void setData ( const QVariant& valcont, int role );
168 virtual bool isAssoc() const;
169 virtual QString IDptr() const;
170 HEXA_NS::EltBase* getEltBase() const { return m_DocElt;}
174 HEXA_NS::EltBase* m_DocElt;
176 //===================================================================================
178 class HEXABLOCK_EXPORT GraphicElementItem : public ElementItem
181 GraphicElementItem( HEXA_NS::EltBase* docElement, QString entry, HexaType ttype, HexaTreeRole treeRole):
182 ElementItem( docElement, entry, ttype, treeRole)
191 class HEXABLOCK_EXPORT StandardElementItem : public ElementItem
194 StandardElementItem( HEXA_NS::EltBase* docElement, QString entry, HexaType ttype, HexaTreeRole treeRole):
195 ElementItem( docElement, entry, ttype, treeRole)
200 class HEXABLOCK_EXPORT VertexItem : public GraphicElementItem
203 VertexItem( HEXA_NS::Vertex* hexaVertex, QString entry = "");
206 class HEXABLOCK_EXPORT EdgeItem : public GraphicElementItem
209 EdgeItem( HEXA_NS::Edge* hexaEdge, QString entry = "");
211 //-----------------------------------------
212 class HEXABLOCK_EXPORT QuadItem : public GraphicElementItem
215 QuadItem( HEXA_NS::Quad* hexaQuad, QString entry = "");
217 //-----------------------------------------
219 class HEXABLOCK_EXPORT HexaItem : public GraphicElementItem
222 HexaItem( HEXA_NS::Hexa* hexaHexa, QString entry = "");
224 //-----------------------------------------
226 class HEXABLOCK_EXPORT VectorItem : public StandardElementItem
229 VectorItem( HEXA_NS::Vector* hexaVector, QString entry = "");
231 //-----------------------------------------
233 // class HEXABLOCK_EXPORT CylinderItem : public StandardElementItem
236 // CylinderItem( HEXA_NS::Cylinder* hexaCyl, QString entry = "");
238 //-----------------------------------------
240 // class PipeItem : public StandardElementItem
243 // PipeItem( HEXA_NS::Pipe* hexaPipe, QString entry = "");
245 //-----------------------------------------
247 class HEXABLOCK_EXPORT ElementsItem : public StandardElementItem
250 ElementsItem( HEXA_NS::Elements* hexaElements, QString entry = "" );
252 //-----------------------------------------
253 // class CrossElementsItem : public StandardElementItem
256 // CrossElementsItem( HEXA_NS::CrossElements* hexaCrossElts, QString entry = "");
259 //------------------------------------------------
260 class HEXABLOCK_EXPORT GeomItem: public StandardElementItem
263 GeomItem( HEXA_NS::EltBase* geomShape, QString entry, HexaType ttype, HexaTreeRole treeRole, HEXA_NS::EltBase* assoc = NULL );
264 HEXA_NS::EltBase* getAssociation() const { return association; }
265 void setAssociation(HEXA_NS::EltBase* assoc) { association = assoc; }
268 HEXA_NS::EltBase* association;
271 //------------------------------------------------
272 class HEXABLOCK_EXPORT GeomShapeItem: public GeomItem
275 GeomShapeItem( HEXA_NS::NewShape* shape, HEXA_NS::EltBase* assoc = NULL);
278 //------------------------------------------------
279 class HEXABLOCK_EXPORT GeomPointItem: public GeomItem
282 GeomPointItem( HEXA_NS::VertexShape* geomPoint, HEXA_NS::Vertex* associatedVertex = NULL);
285 //------------------------------------------------
286 class HEXABLOCK_EXPORT GeomEdgeItem: public GeomItem
289 GeomEdgeItem( HEXA_NS::EdgeShape* geomEdge, HEXA_NS::Edge* associatedEdge = NULL);
292 //------------------------------------------------
293 class HEXABLOCK_EXPORT GeomFaceItem: public GeomItem
296 GeomFaceItem( HEXA_NS::FaceShape* geomFace, HEXA_NS::Quad* associatedQuad = NULL);
299 //-----------------------------------------
300 class HEXABLOCK_EXPORT GroupItem : public QStandardItem
303 GroupItem( HEXA_NS::Group* hexaGroup );
304 virtual int type () const;
305 virtual QVariant data ( int role ) const;
306 virtual void setData ( const QVariant & value, int role ); //= Qt::UserRole + 1 )
308 HEXA_NS::Group* _hexaGroup;
312 class HEXABLOCK_EXPORT LawItem : public QStandardItem
315 LawItem( HEXA_NS::Law* hexaLaw );
316 virtual int type () const;
317 virtual QVariant data ( int role ) const;
318 virtual void setData ( const QVariant & value, int role ); //= Qt::UserRole + 1 )
320 HEXA_NS::Law* _hexaLaw;
324 class HEXABLOCK_EXPORT PropagationItem : public QStandardItem
327 PropagationItem( HEXA_NS::Propagation* hexaPropagation );
328 virtual int type () const;
329 virtual QVariant data ( int role ) const;
330 virtual void setData ( const QVariant & value, int role ); //= Qt::UserRole + 1 )
332 HEXA_NS::Propagation* _hexaPropagation;
334 //-------------------------------------------------