QuadSetTopologyChange.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_QUADSETTOPOLOGYCHANGE_H
00026 #define SOFA_COMPONENT_TOPOLOGY_QUADSETTOPOLOGYCHANGE_H
00027
00028 #include <sofa/core/componentmodel/topology/Topology.h>
00029 #include <sofa/helper/vector.h>
00030
00031 namespace sofa
00032 {
00033 namespace component
00034 {
00035 namespace topology
00036 {
00037 using core::componentmodel::topology::BaseMeshTopology;
00038 typedef BaseMeshTopology::Quad Quad;
00039
00041 class QuadsAdded : public core::componentmodel::topology::TopologyChange
00042 {
00043 public:
00044 QuadsAdded(const unsigned int nT)
00045 : core::componentmodel::topology::TopologyChange(core::componentmodel::topology::QUADSADDED),
00046 nQuads(nT)
00047 { }
00048
00049 QuadsAdded(const unsigned int nT,
00050 const sofa::helper::vector< Quad >& _quadArray,
00051 const sofa::helper::vector< unsigned int >& quadsIndex)
00052 : core::componentmodel::topology::TopologyChange(core::componentmodel::topology::QUADSADDED),
00053 nQuads(nT),
00054 quadArray(_quadArray),
00055 quadIndexArray(quadsIndex)
00056 { }
00057
00058 QuadsAdded(const unsigned int nT,
00059 const sofa::helper::vector< Quad >& _quadArray,
00060 const sofa::helper::vector< unsigned int >& quadsIndex,
00061 const sofa::helper::vector< sofa::helper::vector< unsigned int > >& ancestors,
00062 const sofa::helper::vector< sofa::helper::vector< double > >& baryCoefs)
00063 : core::componentmodel::topology::TopologyChange(core::componentmodel::topology::QUADSADDED),
00064 nQuads(nT),
00065 quadArray(_quadArray),
00066 quadIndexArray(quadsIndex),
00067 ancestorsList(ancestors),
00068 coefs(baryCoefs)
00069 { }
00070
00071 unsigned int getNbAddedQuads() const
00072 {
00073 return nQuads;
00074 }
00075
00076 const sofa::helper::vector<unsigned int> &getArray() const
00077 {
00078 return quadIndexArray;
00079 }
00080
00081 const Quad &getQuad(const unsigned int i)
00082 {
00083 return quadArray[i];
00084 }
00085
00086 public:
00087 unsigned int nQuads;
00088 sofa::helper::vector< Quad > quadArray;
00089 sofa::helper::vector< unsigned int > quadIndexArray;
00090 sofa::helper::vector< sofa::helper::vector< unsigned int > > ancestorsList;
00091 sofa::helper::vector< sofa::helper::vector< double > > coefs;
00092 };
00093
00095 class QuadsRemoved : public core::componentmodel::topology::TopologyChange
00096 {
00097 public:
00098 QuadsRemoved(const sofa::helper::vector<unsigned int> _qArray)
00099 : core::componentmodel::topology::TopologyChange(core::componentmodel::topology::QUADSREMOVED),
00100 removedQuadsArray(_qArray)
00101 { }
00102
00103 unsigned int getNbRemovedQuads() const
00104 {
00105 return removedQuadsArray.size();
00106 }
00107
00108 const sofa::helper::vector<unsigned int> &getArray() const
00109 {
00110 return removedQuadsArray;
00111 }
00112
00113 unsigned int &getQuadIndices(const unsigned int i)
00114 {
00115 return removedQuadsArray[i];
00116 }
00117
00118 protected:
00119 sofa::helper::vector<unsigned int> removedQuadsArray;
00120 };
00121
00122 }
00123
00124 }
00125
00126 }
00127
00128 #endif