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_
24 #include <QStandardItem>
26 #include "HexVertex.hxx"
27 #include "HexEdge.hxx"
28 #include "HexQuad.hxx"
29 #include "HexHexa.hxx"
32 #include "HexVector.hxx"
33 #include "HexElements.hxx"
34 #include "HexNewShape.hxx"
35 #include "HexVertexShape.hxx"
36 #include "HexEdgeShape.hxx"
37 #include "HexFaceShape.hxx"
39 #include "HexGroup.hxx"
41 #include "HexPropagation.hxx"
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* );
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* );
63 Q_DECLARE_METATYPE( HEXA_NS::Group* );
64 Q_DECLARE_METATYPE( HEXA_NS::Law* );
65 Q_DECLARE_METATYPE( HEXA_NS::Propagation* );
74 VERTEXITEM = QStandardItem::UserType + 1,
106 EXPLICIT_SHAPES_TREE,
107 IMPLICIT_SHAPES_TREE,
108 CLOUD_OF_POINTS_TREE,
126 CROSSELEMENTS_DIR_TREE,
128 EXPLICIT_SHAPES_DIR_TREE,
129 IMPLICIT_SHAPES_DIR_TREE,
130 CLOUD_OF_POINTS_DIR_TREE,
143 HEXA_DATA_ROLE = Qt::UserRole + 1,
148 HEXA_ASSOC_ENTRY_ROLE,
151 // QVariant::UserType
153 //===================================================================================
154 class HexaExport ElementItem : public QStandardItem
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 );
162 virtual bool isAssoc() const;
163 virtual QString IDptr() const;
164 HEXA_NS::EltBase* getEltBase() const { return m_DocElt;}
168 HEXA_NS::EltBase* m_DocElt;
170 //===================================================================================
172 class HexaExport GraphicElementItem : public ElementItem
175 GraphicElementItem( HEXA_NS::EltBase* docElement, QString entry, HexaType ttype, HexaTreeRole treeRole):
176 ElementItem( docElement, entry, ttype, treeRole)
185 class HexaExport StandardElementItem : public ElementItem
188 StandardElementItem( HEXA_NS::EltBase* docElement, QString entry, HexaType ttype, HexaTreeRole treeRole):
189 ElementItem( docElement, entry, ttype, treeRole)
194 class HexaExport VertexItem : public GraphicElementItem
197 VertexItem( HEXA_NS::Vertex* hexaVertex, QString entry = "");
200 class HexaExport EdgeItem : public GraphicElementItem
203 EdgeItem( HEXA_NS::Edge* hexaEdge, QString entry = "");
205 //-----------------------------------------
206 class HexaExport QuadItem : public GraphicElementItem
209 QuadItem( HEXA_NS::Quad* hexaQuad, QString entry = "");
211 //-----------------------------------------
213 class HexaExport HexaItem : public GraphicElementItem
216 HexaItem( HEXA_NS::Hexa* hexaHexa, QString entry = "");
218 //-----------------------------------------
220 class HexaExport VectorItem : public StandardElementItem
223 VectorItem( HEXA_NS::Vector* hexaVector, QString entry = "");
225 //-----------------------------------------
227 // class HexaExport CylinderItem : public StandardElementItem
230 // CylinderItem( HEXA_NS::Cylinder* hexaCyl, QString entry = "");
232 //-----------------------------------------
234 // class PipeItem : public StandardElementItem
237 // PipeItem( HEXA_NS::Pipe* hexaPipe, QString entry = "");
239 //-----------------------------------------
241 class HexaExport ElementsItem : public StandardElementItem
244 ElementsItem( HEXA_NS::Elements* hexaElements, QString entry = "" );
246 //-----------------------------------------
247 // class CrossElementsItem : public StandardElementItem
250 // CrossElementsItem( HEXA_NS::CrossElements* hexaCrossElts, QString entry = "");
253 //------------------------------------------------
254 class HexaExport GeomItem: public StandardElementItem
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; }
262 HEXA_NS::EltBase* association;
265 //------------------------------------------------
266 class HexaExport GeomShapeItem: public GeomItem
269 GeomShapeItem( HEXA_NS::NewShape* shape, HEXA_NS::EltBase* assoc = NULL);
272 //------------------------------------------------
273 class HexaExport GeomPointItem: public GeomItem
276 GeomPointItem( HEXA_NS::VertexShape* geomPoint, HEXA_NS::Vertex* associatedVertex = NULL);
279 //------------------------------------------------
280 class HexaExport GeomEdgeItem: public GeomItem
283 GeomEdgeItem( HEXA_NS::EdgeShape* geomEdge, HEXA_NS::Edge* associatedEdge = NULL);
286 //------------------------------------------------
287 class HexaExport GeomFaceItem: public GeomItem
290 GeomFaceItem( HEXA_NS::FaceShape* geomFace, HEXA_NS::Quad* associatedQuad = NULL);
293 //-----------------------------------------
294 class HexaExport GroupItem : public QStandardItem
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 )
302 HEXA_NS::Group* _hexaGroup;
306 class HexaExport LawItem : public QStandardItem
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 )
314 HEXA_NS::Law* _hexaLaw;
318 class HexaExport PropagationItem : public QStandardItem
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 )
326 HEXA_NS::Propagation* _hexaPropagation;
328 //-------------------------------------------------