TetrahedronSetTopologyModifier.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_TETRAHEDRONSETTOPOLOGYMODIFIER_H
00026 #define SOFA_COMPONENT_TOPOLOGY_TETRAHEDRONSETTOPOLOGYMODIFIER_H
00027
00028 #include <sofa/component/topology/TriangleSetTopologyModifier.h>
00029
00030 namespace sofa
00031 {
00032
00033 namespace component
00034 {
00035
00036 namespace topology
00037 {
00038 class TetrahedronSetTopologyContainer;
00039
00040 using core::componentmodel::topology::BaseMeshTopology;
00041 typedef BaseMeshTopology::TetraID TetraID;
00042 typedef BaseMeshTopology::Tetra Tetra;
00043 typedef BaseMeshTopology::SeqTetras SeqTetras;
00044 typedef BaseMeshTopology::VertexTetras VertexTetras;
00045 typedef BaseMeshTopology::EdgeTetras EdgeTetras;
00046 typedef BaseMeshTopology::TriangleTetras TriangleTetras;
00047 typedef BaseMeshTopology::TetraEdges TetraEdges;
00048 typedef BaseMeshTopology::TetraTriangles TetraTriangles;
00049
00050 typedef Tetra Tetrahedron;
00051 typedef TetraEdges TetrahedronEdges;
00052 typedef TetraTriangles TetrahedronTriangles;
00053
00057 class TetrahedronSetTopologyModifier : public TriangleSetTopologyModifier
00058 {
00059 public:
00060 TetrahedronSetTopologyModifier()
00061 : TriangleSetTopologyModifier()
00062 {}
00063
00064 virtual ~TetrahedronSetTopologyModifier() {}
00065
00066 virtual void init();
00067
00072 void addTetrahedraWarning(const unsigned int nTetrahedra,
00073 const sofa::helper::vector< Tetrahedron >& tetrahedraList,
00074 const sofa::helper::vector< unsigned int >& tetrahedraIndexList);
00075
00080 void addTetrahedraWarning(const unsigned int nTetrahedra,
00081 const sofa::helper::vector< Tetrahedron >& tetrahedraList,
00082 const sofa::helper::vector< unsigned int >& tetrahedraIndexList,
00083 const sofa::helper::vector< sofa::helper::vector< unsigned int > > & ancestors,
00084 const sofa::helper::vector< sofa::helper::vector< double > >& baryCoefs);
00085
00089 void addTetrahedronProcess(Tetrahedron e);
00090
00095 virtual void addTetrahedraProcess(const sofa::helper::vector< Tetrahedron > &tetrahedra);
00096
00103 void removeTetrahedraWarning( sofa::helper::vector<unsigned int> &tetrahedra);
00104
00113 virtual void removeTetrahedraProcess( const sofa::helper::vector<unsigned int> &indices,
00114 const bool removeIsolatedItems=false);
00115
00120 virtual void addTrianglesProcess(const sofa::helper::vector< Triangle > &triangles);
00121
00128 virtual void removeTrianglesProcess(const sofa::helper::vector<unsigned int> &indices,
00129 const bool removeIsolatedEdges=false,
00130 const bool removeIsolatedPoints=false);
00131
00136 virtual void addEdgesProcess(const sofa::helper::vector< Edge > &edges);
00137
00146 virtual void removeEdgesProcess( const sofa::helper::vector<unsigned int> &indices,
00147 const bool removeIsolatedItems=false);
00148
00153 virtual void addPointsProcess(const unsigned int nPoints);
00154
00163 virtual void removePointsProcess( sofa::helper::vector<unsigned int> &indices, const bool removeDOF = true);
00164
00170 virtual void renumberPointsProcess( const sofa::helper::vector<unsigned int> &index,
00171 const sofa::helper::vector<unsigned int> &,
00172 const bool renumberDOF = true);
00173
00178 virtual void removeTetrahedra(sofa::helper::vector< unsigned int >& tetrahedra);
00179
00182 virtual void removeItems(sofa::helper::vector< unsigned int >& items);
00183
00186 void RemoveTetraBall(unsigned int ind_ta, unsigned int ind_tb);
00187
00190 virtual void renumberPoints( const sofa::helper::vector<unsigned int> &,
00191 const sofa::helper::vector<unsigned int> &);
00192
00193
00194 private:
00195 TetrahedronSetTopologyContainer* m_container;
00196 };
00197
00198 }
00199
00200 }
00201
00202 }
00203
00204 #endif