1 // Copyright (C) 2009-2015 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, or (at your option) any later version.
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 "HexElements.hxx"
35 #include "HexNewShape.hxx"
36 #include "HexVertexShape.hxx"
37 #include "HexEdgeShape.hxx"
38 #include "HexFaceShape.hxx"
40 #include "HexGroup.hxx"
42 #include "HexPropagation.hxx"
47 Q_DECLARE_METATYPE( HEXA_NS::EltBase* );
48 Q_DECLARE_METATYPE( HEXA_NS::Vertex* );
49 Q_DECLARE_METATYPE( HEXA_NS::Edge* );
50 Q_DECLARE_METATYPE( HEXA_NS::Quad* );
51 Q_DECLARE_METATYPE( HEXA_NS::Hexa* );
53 Q_DECLARE_METATYPE( HEXA_NS::Vector* );
54 // Q_DECLARE_METATYPE( HEXA_NS::Cylinder* );
55 // Q_DECLARE_METATYPE( HEXA_NS::Pipe* );
56 Q_DECLARE_METATYPE( HEXA_NS::Elements* );
57 // Q_DECLARE_METATYPE( HEXA_NS::CrossElements* );
58 Q_DECLARE_METATYPE( HEXA_NS::NewShape* );
59 Q_DECLARE_METATYPE( HEXA_NS::SubShape* );
60 Q_DECLARE_METATYPE( HEXA_NS::VertexShape* );
61 Q_DECLARE_METATYPE( HEXA_NS::EdgeShape* );
62 Q_DECLARE_METATYPE( HEXA_NS::FaceShape* );
64 Q_DECLARE_METATYPE( HEXA_NS::Group* );
65 Q_DECLARE_METATYPE( HEXA_NS::Law* );
66 Q_DECLARE_METATYPE( HEXA_NS::Propagation* );
75 VERTEXITEM = QStandardItem::UserType + 1,
107 EXPLICIT_SHAPES_TREE,
108 IMPLICIT_SHAPES_TREE,
109 CLOUD_OF_POINTS_TREE,
127 CROSSELEMENTS_DIR_TREE,
129 EXPLICIT_SHAPES_DIR_TREE,
130 IMPLICIT_SHAPES_DIR_TREE,
131 CLOUD_OF_POINTS_DIR_TREE,
144 HEXA_DATA_ROLE = Qt::UserRole + 1,
149 HEXA_ASSOC_ENTRY_ROLE,
152 // QVariant::UserType
154 //===================================================================================
155 class HEXABLOCK_EXPORT ElementItem : public QStandardItem
158 ElementItem( HEXA_NS::EltBase* docElement, QString entry, HexaType ttype, HexaTreeRole treeRole);
159 ElementItem( HEXA_NS::EltBase* docElement, HexaType ttype, HexaTreeRole treeRole);
160 virtual QVariant data( int role ) const;
161 virtual void setData ( const QVariant& valcont, int role );
163 virtual bool isAssoc() const;
164 virtual QString IDptr() const;
165 HEXA_NS::EltBase* getEltBase() const { return m_DocElt;}
169 HEXA_NS::EltBase* m_DocElt;
171 //===================================================================================
173 class HEXABLOCK_EXPORT GraphicElementItem : public ElementItem
176 GraphicElementItem( HEXA_NS::EltBase* docElement, QString entry, HexaType ttype, HexaTreeRole treeRole):
177 ElementItem( docElement, entry, ttype, treeRole)
186 class HEXABLOCK_EXPORT StandardElementItem : public ElementItem
189 StandardElementItem( HEXA_NS::EltBase* docElement, QString entry, HexaType ttype, HexaTreeRole treeRole):
190 ElementItem( docElement, entry, ttype, treeRole)
195 class HEXABLOCK_EXPORT VertexItem : public GraphicElementItem
198 VertexItem( HEXA_NS::Vertex* hexaVertex, QString entry = "");
201 class HEXABLOCK_EXPORT EdgeItem : public GraphicElementItem
204 EdgeItem( HEXA_NS::Edge* hexaEdge, QString entry = "");
206 //-----------------------------------------
207 class HEXABLOCK_EXPORT QuadItem : public GraphicElementItem
210 QuadItem( HEXA_NS::Quad* hexaQuad, QString entry = "");
212 //-----------------------------------------
214 class HEXABLOCK_EXPORT HexaItem : public GraphicElementItem
217 HexaItem( HEXA_NS::Hexa* hexaHexa, QString entry = "");
219 //-----------------------------------------
221 class HEXABLOCK_EXPORT VectorItem : public StandardElementItem
224 VectorItem( HEXA_NS::Vector* hexaVector, QString entry = "");
226 //-----------------------------------------
228 // class HEXABLOCK_EXPORT CylinderItem : public StandardElementItem
231 // CylinderItem( HEXA_NS::Cylinder* hexaCyl, QString entry = "");
233 //-----------------------------------------
235 // class PipeItem : public StandardElementItem
238 // PipeItem( HEXA_NS::Pipe* hexaPipe, QString entry = "");
240 //-----------------------------------------
242 class HEXABLOCK_EXPORT ElementsItem : public StandardElementItem
245 ElementsItem( HEXA_NS::Elements* hexaElements, QString entry = "" );
247 //-----------------------------------------
248 // class CrossElementsItem : public StandardElementItem
251 // CrossElementsItem( HEXA_NS::CrossElements* hexaCrossElts, QString entry = "");
254 //------------------------------------------------
255 class HEXABLOCK_EXPORT GeomItem: public StandardElementItem
258 GeomItem( HEXA_NS::EltBase* geomShape, QString entry, HexaType ttype, HexaTreeRole treeRole, HEXA_NS::EltBase* assoc = NULL );
259 HEXA_NS::EltBase* getAssociation() const { return association; }
260 void setAssociation(HEXA_NS::EltBase* assoc) { association = assoc; }
263 HEXA_NS::EltBase* association;
266 //------------------------------------------------
267 class HEXABLOCK_EXPORT GeomShapeItem: public GeomItem
270 GeomShapeItem( HEXA_NS::NewShape* shape, HEXA_NS::EltBase* assoc = NULL);
273 //------------------------------------------------
274 class HEXABLOCK_EXPORT GeomPointItem: public GeomItem
277 GeomPointItem( HEXA_NS::VertexShape* geomPoint, HEXA_NS::Vertex* associatedVertex = NULL);
280 //------------------------------------------------
281 class HEXABLOCK_EXPORT GeomEdgeItem: public GeomItem
284 GeomEdgeItem( HEXA_NS::EdgeShape* geomEdge, HEXA_NS::Edge* associatedEdge = NULL);
287 //------------------------------------------------
288 class HEXABLOCK_EXPORT GeomFaceItem: public GeomItem
291 GeomFaceItem( HEXA_NS::FaceShape* geomFace, HEXA_NS::Quad* associatedQuad = NULL);
294 //-----------------------------------------
295 class HEXABLOCK_EXPORT GroupItem : public QStandardItem
298 GroupItem( HEXA_NS::Group* hexaGroup );
299 virtual int type () const;
300 virtual QVariant data ( int role ) const;
301 virtual void setData ( const QVariant & value, int role ); //= Qt::UserRole + 1 )
303 HEXA_NS::Group* _hexaGroup;
307 class HEXABLOCK_EXPORT LawItem : public QStandardItem
310 LawItem( HEXA_NS::Law* hexaLaw );
311 virtual int type () const;
312 virtual QVariant data ( int role ) const;
313 virtual void setData ( const QVariant & value, int role ); //= Qt::UserRole + 1 )
315 HEXA_NS::Law* _hexaLaw;
319 class HEXABLOCK_EXPORT PropagationItem : public QStandardItem
322 PropagationItem( HEXA_NS::Propagation* hexaPropagation );
323 virtual int type () const;
324 virtual QVariant data ( int role ) const;
325 virtual void setData ( const QVariant & value, int role ); //= Qt::UserRole + 1 )
327 HEXA_NS::Propagation* _hexaPropagation;
329 //-------------------------------------------------