PointSetTopologyModifier.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_POINTSETTOPOLOGYMODIFIER_H
00026 #define SOFA_COMPONENT_TOPOLOGY_POINTSETTOPOLOGYMODIFIER_H
00027
00028 #include <sofa/helper/vector.h>
00029 #include <sofa/core/componentmodel/topology/BaseTopology.h>
00030
00031 namespace sofa
00032 {
00033
00034 namespace component
00035 {
00036
00037 namespace topology
00038 {
00039 class PointSetTopologyContainer;
00040
00041 using core::componentmodel::topology::BaseMeshTopology;
00042 typedef BaseMeshTopology::PointID PointID;
00043
00047 class PointSetTopologyModifier : public core::componentmodel::topology::TopologyModifier
00048 {
00049 public:
00050 PointSetTopologyModifier()
00051 : TopologyModifier()
00052 {}
00053
00054 virtual ~PointSetTopologyModifier() {}
00055
00056 virtual void init();
00057
00061 virtual void swapPoints(const int i1,const int i2);
00062
00067 void addPointsWarning(const unsigned int nPoints, const bool addDOF = true);
00068
00073 void addPointsWarning(const unsigned int nPoints,
00074 const sofa::helper::vector< sofa::helper::vector< unsigned int > >& ancestors,
00075 const sofa::helper::vector< sofa::helper::vector< double > >& coefs,
00076 const bool addDOF = true);
00077
00078
00083 virtual void addPointsProcess(const unsigned int nPoints);
00084
00089
00090 void removePointsWarning( sofa::helper::vector<unsigned int> &indices,
00091 const bool removeDOF = true);
00092
00093
00104 virtual void removePointsProcess(const sofa::helper::vector<unsigned int> &indices,
00105 const bool removeDOF = true);
00106
00107
00112 void renumberPointsWarning( const sofa::helper::vector<unsigned int> &index,
00113 const sofa::helper::vector<unsigned int> &inv_index,
00114 const bool renumberDOF = true);
00115
00121 virtual void renumberPointsProcess( const sofa::helper::vector<unsigned int> &index,
00122 const sofa::helper::vector<unsigned int> &,
00123 const bool renumberDOF = true);
00124
00134 void propagateTopologicalChanges();
00135
00145 void propagateStateChanges();
00147
00150 void notifyEndingEvent();
00151
00154 virtual void removeItems(sofa::helper::vector< unsigned int >& )
00155 { }
00156
00159 virtual void renumberPoints( const sofa::helper::vector<unsigned int> &,
00160 const sofa::helper::vector<unsigned int> &)
00161 { }
00162
00163 private:
00164 PointSetTopologyContainer* m_container;
00165 };
00166
00167 }
00168
00169 }
00170
00171 }
00172
00173 #endif // SOFA_COMPONENTS_POINTSETTOPOLOGYMODIFIER_H