TriangleSetTopologyModifier.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_TRIANGLESETTOPOLOGYMODIFIER_H
00026 #define SOFA_COMPONENT_TOPOLOGY_TRIANGLESETTOPOLOGYMODIFIER_H
00027
00028 #include <sofa/component/topology/EdgeSetTopologyModifier.h>
00029
00030 namespace sofa
00031 {
00032 namespace component
00033 {
00034 namespace topology
00035 {
00036 class TriangleSetTopologyContainer;
00037
00038 using core::componentmodel::topology::BaseMeshTopology;
00039 typedef BaseMeshTopology::TriangleID TriangleID;
00040 typedef BaseMeshTopology::Triangle Triangle;
00041 typedef BaseMeshTopology::SeqTriangles SeqTriangles;
00042 typedef BaseMeshTopology::VertexTriangles VertexTriangles;
00043 typedef BaseMeshTopology::EdgeTriangles EdgeTriangles;
00044 typedef BaseMeshTopology::TriangleEdges TriangleEdges;
00045
00049 class TriangleSetTopologyModifier : public EdgeSetTopologyModifier
00050 {
00051 public:
00052 TriangleSetTopologyModifier()
00053 : EdgeSetTopologyModifier()
00054 { }
00055
00056 virtual ~TriangleSetTopologyModifier() {}
00057
00058 virtual void init();
00059
00064 void addTrianglesWarning(const unsigned int nTriangles,
00065 const sofa::helper::vector< Triangle >& trianglesList,
00066 const sofa::helper::vector< unsigned int >& trianglesIndexList) ;
00067
00072 void addTrianglesWarning(const unsigned int nTriangles,
00073 const sofa::helper::vector< Triangle >& trianglesList,
00074 const sofa::helper::vector< unsigned int >& trianglesIndexList,
00075 const sofa::helper::vector< sofa::helper::vector< unsigned int > > & ancestors,
00076 const sofa::helper::vector< sofa::helper::vector< double > >& baryCoefs) ;
00077
00080 void addTriangleProcess(Triangle e);
00081
00086 virtual void addTrianglesProcess(const sofa::helper::vector< Triangle > &triangles);
00087
00094 virtual void removeTrianglesWarning( sofa::helper::vector<unsigned int> &triangles);
00095
00104 virtual void removeTrianglesProcess( const sofa::helper::vector<unsigned int> &indices,
00105 const bool removeIsolatedEdges=false,
00106 const bool removeIsolatedPoints=false);
00107
00112 void addEdgesWarning(const unsigned int nEdges,
00113 const sofa::helper::vector< Edge >& edgesList,
00114 const sofa::helper::vector< unsigned int >& edgesIndexList)
00115 {
00116 EdgeSetTopologyModifier::addEdgesWarning( nEdges, edgesList, edgesIndexList);
00117 }
00118
00123 void addEdgesWarning(const unsigned int nEdges,
00124 const sofa::helper::vector< Edge >& edgesList,
00125 const sofa::helper::vector< unsigned int >& edgesIndexList,
00126 const sofa::helper::vector< sofa::helper::vector< unsigned int > > & ancestors,
00127 const sofa::helper::vector< sofa::helper::vector< double > >& baryCoefs)
00128 {
00129 EdgeSetTopologyModifier::addEdgesWarning( nEdges, edgesList, edgesIndexList, ancestors, baryCoefs);
00130 }
00131
00136 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,
00164 const bool removeDOF = true);
00165
00171 virtual void renumberPointsProcess( const sofa::helper::vector<unsigned int> &index,
00172 const sofa::helper::vector<unsigned int> &inv_index,
00173 const bool renumberDOF = true);
00174
00182 virtual void removeTriangles(sofa::helper::vector< unsigned int >& triangles,
00183 const bool removeIsolatedEdges,
00184 const bool removeIsolatedPoints);
00185
00188 virtual void removeItems(sofa::helper::vector< unsigned int >& items);
00189
00192 virtual void renumberPoints( const sofa::helper::vector<unsigned int> &index,
00193 const sofa::helper::vector<unsigned int> &inv_index);
00194
00195
00196 private:
00197 TriangleSetTopologyContainer* m_container;
00198 };
00199
00200 }
00201
00202 }
00203
00204 }
00205
00206 #endif