HexahedronSetTopologyModifier.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef SOFA_COMPONENT_TOPOLOGY_HEXAHEDRONSETTOPOLOGYMODIFIER_H
00026 #define SOFA_COMPONENT_TOPOLOGY_HEXAHEDRONSETTOPOLOGYMODIFIER_H
00027
00028 #include <sofa/component/topology/QuadSetTopologyModifier.h>
00029
00030 namespace sofa
00031 {
00032 namespace component
00033 {
00034 namespace topology
00035 {
00036 class HexahedronSetTopologyContainer;
00037
00038 using core::componentmodel::topology::BaseMeshTopology;
00039 typedef BaseMeshTopology::HexaID HexaID;
00040 typedef BaseMeshTopology::Hexa Hexa;
00041 typedef BaseMeshTopology::SeqHexas SeqHexas;
00042 typedef BaseMeshTopology::VertexHexas VertexHexas;
00043 typedef BaseMeshTopology::EdgeHexas EdgeHexas;
00044 typedef BaseMeshTopology::QuadHexas QuadHexas;
00045 typedef BaseMeshTopology::HexaEdges HexaEdges;
00046 typedef BaseMeshTopology::HexaQuads HexaQuads;
00047
00048 typedef Hexa Hexahedron;
00049 typedef HexaEdges HexahedronEdges;
00050 typedef HexaQuads HexahedronQuads;
00051
00055 class HexahedronSetTopologyModifier : public QuadSetTopologyModifier
00056 {
00057 public:
00058 HexahedronSetTopologyModifier()
00059 : QuadSetTopologyModifier()
00060 { }
00061
00062 virtual ~HexahedronSetTopologyModifier() {}
00063
00064 virtual void init();
00065
00070 void addHexahedraWarning(const unsigned int nHexahedra,
00071 const sofa::helper::vector< Hexahedron >& hexahedraList,
00072 const sofa::helper::vector< unsigned int >& hexahedraIndexList);
00073
00078 void addHexahedraWarning(const unsigned int nHexahedra,
00079 const sofa::helper::vector< Hexahedron >& hexahedraList,
00080 const sofa::helper::vector< unsigned int >& hexahedraIndexList,
00081 const sofa::helper::vector< sofa::helper::vector< unsigned int > > & ancestors,
00082 const sofa::helper::vector< sofa::helper::vector< double > >& baryCoefs);
00083
00086 void addHexahedronProcess(Hexahedron e);
00087
00092 virtual void addHexahedraProcess(const sofa::helper::vector< Hexahedron > &hexahedra);
00093
00100 void removeHexahedraWarning( sofa::helper::vector<unsigned int> &hexahedra);
00101
00110 virtual void removeHexahedraProcess(const sofa::helper::vector<unsigned int>&indices,
00111 const bool removeIsolatedItems = false);
00112
00117 virtual void addQuadsProcess(const sofa::helper::vector< Quad > &quads);
00118
00125 virtual void removeQuadsProcess(const sofa::helper::vector<unsigned int> &indices,
00126 const bool removeIsolatedEdges = false,
00127 const bool removeIsolatedPoints = false);
00128
00133 virtual void addEdgesProcess(const sofa::helper::vector< Edge > &edges);
00134
00143 virtual void removeEdgesProcess(const sofa::helper::vector<unsigned int> &indices,
00144 const bool removeIsolatedItems = false);
00145
00150 virtual void addPointsProcess(const unsigned int nPoints);
00151
00160 virtual void removePointsProcess( sofa::helper::vector<unsigned int> &indices, const bool removeDOF = true);
00161
00167 virtual void renumberPointsProcess( const sofa::helper::vector<unsigned int> &index,
00168 const sofa::helper::vector<unsigned int>& inv_index,
00169 const bool renumberDOF = true);
00170
00175 virtual void removeHexahedra(sofa::helper::vector< unsigned int >& hexahedra);
00176
00179 virtual void removeItems(sofa::helper::vector< unsigned int >& items);
00180
00183 virtual void renumberPoints( const sofa::helper::vector<unsigned int>& index,
00184 const sofa::helper::vector<unsigned int>& inv_index);
00185
00186
00187 private:
00188 HexahedronSetTopologyContainer* m_container;
00189 };
00190
00191 }
00192
00193 }
00194
00195 }
00196
00197 #endif