PointSetTopologyChange.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_POINTSETTOPOLOGYCHANGE_H
00026 #define SOFA_COMPONENT_TOPOLOGY_POINTSETTOPOLOGYCHANGE_H
00027
00028 #include <sofa/core/componentmodel/topology/Topology.h>
00029 #include <sofa/helper/vector.h>
00030
00031 namespace sofa
00032 {
00033
00034 namespace component
00035 {
00036
00037 namespace topology
00038 {
00039
00041 class PointsIndicesSwap : public core::componentmodel::topology::TopologyChange
00042 {
00043 public:
00044 PointsIndicesSwap(const unsigned int i1,const unsigned int i2)
00045 : core::componentmodel::topology::TopologyChange(core::componentmodel::topology::POINTSINDICESSWAP)
00046 {
00047 index[0]=i1;
00048 index[1]=i2;
00049 }
00050
00051 public:
00052 unsigned int index[2];
00053 };
00054
00056 class PointsAdded : public core::componentmodel::topology::TopologyChange
00057 {
00058 public:
00059
00060 PointsAdded(const unsigned int nV)
00061 : core::componentmodel::topology::TopologyChange(core::componentmodel::topology::POINTSADDED)
00062 , nVertices(nV)
00063 { }
00064
00065 PointsAdded(const unsigned int nV,
00066 const sofa::helper::vector< sofa::helper::vector< unsigned int > >& ancestors,
00067 const sofa::helper::vector< sofa::helper::vector< double > >& baryCoefs)
00068 : core::componentmodel::topology::TopologyChange(core::componentmodel::topology::POINTSADDED)
00069 , nVertices(nV), ancestorsList(ancestors), coefs(baryCoefs)
00070 { }
00071
00072 unsigned int getNbAddedVertices() const {return nVertices;}
00073
00074 public:
00075 unsigned int nVertices;
00076 sofa::helper::vector< sofa::helper::vector< unsigned int > > ancestorsList;
00077 sofa::helper::vector< sofa::helper::vector< double > > coefs;
00078 };
00079
00081 class PointsRemoved : public core::componentmodel::topology::TopologyChange
00082 {
00083 public:
00084 PointsRemoved(const sofa::helper::vector<unsigned int>& _vArray)
00085 : core::componentmodel::topology::TopologyChange(core::componentmodel::topology::POINTSREMOVED),
00086 removedVertexArray(_vArray)
00087 { }
00088
00089 const sofa::helper::vector<unsigned int> &getArray() const { return removedVertexArray; }
00090
00091 public:
00092 sofa::helper::vector<unsigned int> removedVertexArray;
00093 };
00094
00095
00097 class PointsRenumbering : public core::componentmodel::topology::TopologyChange
00098 {
00099 public:
00100
00101 PointsRenumbering()
00102 : core::componentmodel::topology::TopologyChange(core::componentmodel::topology::POINTSRENUMBERING)
00103 { }
00104
00105 PointsRenumbering(const sofa::helper::vector< unsigned int >& indices,
00106 const sofa::helper::vector< unsigned int >& inv_indices)
00107 : core::componentmodel::topology::TopologyChange(core::componentmodel::topology::POINTSRENUMBERING),
00108 indexArray(indices), inv_indexArray(inv_indices)
00109 { }
00110
00111 const sofa::helper::vector<unsigned int> &getIndexArray() const { return indexArray; }
00112
00113 const sofa::helper::vector<unsigned int> &getinv_IndexArray() const { return inv_indexArray; }
00114
00115 public:
00116 sofa::helper::vector<unsigned int> indexArray;
00117 sofa::helper::vector<unsigned int> inv_indexArray;
00118 };
00119
00120
00121 }
00122
00123 }
00124
00125 }
00126
00127 #endif // SOFA_COMPONENTS_POINTSETTOPOLOGYCHANGE_H