Salome HOME
Merge branch 'master' into pre/penta18
[modules/smesh.git] / src / SMDS / SMDS_VtkVolume.hxx
1 // Copyright (C) 2010-2016  CEA/DEN, EDF R&D, OPEN CASCADE
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, or (at your option) any later version.
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 _SMDS_VTKVOLUME_HXX_
21 #define _SMDS_VTKVOLUME_HXX_
22
23 #include "SMESH_SMDS.hxx"
24
25 #include "SMDS_MeshVolume.hxx"
26 #include "SMDS_UnstructuredGrid.hxx"
27 #include <vector>
28
29 class SMDS_EXPORT SMDS_VtkVolume: public SMDS_MeshVolume
30 {
31 public:
32   SMDS_VtkVolume();
33   SMDS_VtkVolume(const std::vector<vtkIdType>& nodeIds, SMDS_Mesh* mesh);
34   ~SMDS_VtkVolume();
35   void init(const std::vector<vtkIdType>& nodeIds, SMDS_Mesh* mesh);
36 //#ifdef VTK_HAVE_POLYHEDRON
37   void initPoly(const std::vector<vtkIdType>& nodeIds,
38                 const std::vector<int>& nbNodesPerFace, SMDS_Mesh* mesh);
39 //#endif
40   virtual bool ChangeNodes(const SMDS_MeshNode* nodes[], const int nbNodes);
41   virtual bool vtkOrder(const SMDS_MeshNode* nodes[], const int nbNodes);
42
43   virtual void Print(std::ostream & OS) const;
44   virtual int NbFaces() const;
45   virtual int NbNodes() const;
46   virtual int NbEdges() const;
47
48   // 1 <= face_ind <= NbFaces()
49   int NbFaceNodes (const int face_ind) const;
50   // 1 <= face_ind <= NbFaces()
51   // 1 <= node_ind <= NbFaceNodes()
52   const SMDS_MeshNode* GetFaceNode (const int face_ind, const int node_ind) const;
53
54   virtual SMDSAbs_ElementType  GetType() const;
55   virtual vtkIdType            GetVtkType() const;
56   virtual SMDSAbs_EntityType   GetEntityType() const;
57   virtual SMDSAbs_GeometryType GetGeomType() const;
58   virtual const SMDS_MeshNode* GetNode(const int ind) const;
59   virtual int GetNodeIndex( const SMDS_MeshNode* node ) const;
60   virtual bool IsQuadratic() const;
61   virtual bool IsPoly() const;
62   virtual bool IsMediumNode(const SMDS_MeshNode* node) const;
63   virtual int  NbCornerNodes() const;
64   static void gravityCenter(SMDS_UnstructuredGrid* grid,
65                             const vtkIdType *nodeIds,
66                             int nbNodes,
67                             double* result);
68   static bool isForward(double* a,double* b,double* c,double* d);
69   int NbUniqueNodes() const;
70   SMDS_ElemIteratorPtr uniqueNodesIterator() const;
71   std::vector<int> GetQuantities() const;
72
73   virtual SMDS_ElemIteratorPtr elementsIterator(SMDSAbs_ElementType type) const;
74   virtual SMDS_NodeIteratorPtr nodesIteratorToUNV() const;
75   virtual SMDS_NodeIteratorPtr interlacedNodesIterator() const;
76
77 protected:
78 };
79
80 #endif