Back to index

salome-smesh  6.5.0
SMDS_VtkVolume.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2010-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 #ifndef _SMDS_VTKVOLUME_HXX_
00021 #define _SMDS_VTKVOLUME_HXX_
00022 
00023 #include "SMESH_SMDS.hxx"
00024 
00025 #include "SMDS_MeshVolume.hxx"
00026 #include "SMDS_UnstructuredGrid.hxx"
00027 #include <vector>
00028 
00029 class SMDS_EXPORT SMDS_VtkVolume: public SMDS_MeshVolume
00030 {
00031 public:
00032   SMDS_VtkVolume();
00033   SMDS_VtkVolume(const std::vector<vtkIdType>& nodeIds, SMDS_Mesh* mesh);
00034   ~SMDS_VtkVolume();
00035   void init(const std::vector<vtkIdType>& nodeIds, SMDS_Mesh* mesh);
00036 //#ifdef VTK_HAVE_POLYHEDRON
00037   void initPoly(const std::vector<vtkIdType>& nodeIds,
00038                 const std::vector<int>& nbNodesPerFace, SMDS_Mesh* mesh);
00039 //#endif
00040   virtual bool ChangeNodes(const SMDS_MeshNode* nodes[], const int nbNodes);
00041   virtual bool vtkOrder(const SMDS_MeshNode* nodes[], const int nbNodes);
00042 
00043   void Print(std::ostream & OS) const;
00044   int NbFaces() const;
00045   int NbNodes() const;
00046   int NbEdges() const;
00047 
00048   // 1 <= face_ind <= NbFaces()
00049   int NbFaceNodes (const int face_ind) const;
00050   // 1 <= face_ind <= NbFaces()
00051   // 1 <= node_ind <= NbFaceNodes()
00052   const SMDS_MeshNode* GetFaceNode (const int face_ind, const int node_ind) const;
00053 
00054   virtual SMDSAbs_ElementType GetType() const;
00055   virtual vtkIdType GetVtkType() const;
00056   virtual SMDSAbs_EntityType GetEntityType() const;
00057   virtual const SMDS_MeshNode* GetNode(const int ind) const;
00058   virtual bool IsQuadratic() const;
00059   virtual bool IsPoly() const;
00060   virtual bool IsMediumNode(const SMDS_MeshNode* node) const;
00061   virtual int  NbCornerNodes() const;
00062   static void gravityCenter(SMDS_UnstructuredGrid* grid,
00063                             const vtkIdType *nodeIds,
00064                             int nbNodes,
00065                             double* result);
00066   static bool isForward(double* a,double* b,double* c,double* d);
00067   int NbUniqueNodes() const;
00068   SMDS_ElemIteratorPtr uniqueNodesIterator() const;
00069   std::vector<int> GetQuantities() const;
00070 
00071   virtual SMDS_ElemIteratorPtr elementsIterator(SMDSAbs_ElementType type) const;
00072   virtual SMDS_ElemIteratorPtr nodesIteratorToUNV() const;
00073   virtual SMDS_ElemIteratorPtr interlacedNodesElemIterator() const;
00074 
00075 protected:
00076 };
00077 
00078 #endif