HexahedronSetTopologyChange.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_HEXAHEDRONSETTOPOLOGYCHANGE_H
00026 #define SOFA_COMPONENT_TOPOLOGY_HEXAHEDRONSETTOPOLOGYCHANGE_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::Hexa Hexa;
00039 typedef Hexa Hexahedron;
00040
00042 class HexahedraAdded : public core::componentmodel::topology::TopologyChange
00043 {
00044 public:
00045 HexahedraAdded(const unsigned int nT)
00046 : core::componentmodel::topology::TopologyChange(core::componentmodel::topology::HEXAHEDRAADDED),
00047 nHexahedra(nT)
00048 { }
00049
00050 HexahedraAdded(const unsigned int nT,
00051 const sofa::helper::vector< Hexahedron >& _hexahedronArray,
00052 const sofa::helper::vector< unsigned int >& hexahedraIndex)
00053 : core::componentmodel::topology::TopologyChange(core::componentmodel::topology::HEXAHEDRAADDED),
00054 nHexahedra(nT),
00055 hexahedronArray(_hexahedronArray),
00056 hexahedronIndexArray(hexahedraIndex)
00057 { }
00058
00059 HexahedraAdded(const unsigned int nT,
00060 const sofa::helper::vector< Hexahedron >& _hexahedronArray,
00061 const sofa::helper::vector< unsigned int >& hexahedraIndex,
00062 const sofa::helper::vector< sofa::helper::vector< unsigned int > >& ancestors,
00063 const sofa::helper::vector< sofa::helper::vector< double > >& baryCoefs)
00064 : core::componentmodel::topology::TopologyChange(core::componentmodel::topology::HEXAHEDRAADDED),
00065 nHexahedra(nT),
00066 hexahedronArray(_hexahedronArray),
00067 hexahedronIndexArray(hexahedraIndex),
00068 ancestorsList(ancestors),
00069 coefs(baryCoefs)
00070 { }
00071
00072 unsigned int getNbAddedHexahedra() const
00073 {
00074 return nHexahedra;
00075 }
00076
00077 public:
00078 unsigned int nHexahedra;
00079 sofa::helper::vector< Hexahedron > hexahedronArray;
00080 sofa::helper::vector< unsigned int > hexahedronIndexArray;
00081 sofa::helper::vector< sofa::helper::vector< unsigned int > > ancestorsList;
00082 sofa::helper::vector< sofa::helper::vector< double > > coefs;
00083 };
00084
00086 class HexahedraRemoved : public core::componentmodel::topology::TopologyChange
00087 {
00088 public:
00089 HexahedraRemoved(const sofa::helper::vector<unsigned int> _tArray)
00090 : core::componentmodel::topology::TopologyChange(core::componentmodel::topology::HEXAHEDRAREMOVED),
00091 removedHexahedraArray(_tArray)
00092 { }
00093
00094 const sofa::helper::vector<unsigned int> &getArray() const
00095 {
00096 return removedHexahedraArray;
00097 }
00098
00099 unsigned int getNbRemovedHexahedra() const
00100 {
00101 return removedHexahedraArray.size();
00102 }
00103
00104 public:
00105 sofa::helper::vector<unsigned int> removedHexahedraArray;
00106 };
00107
00108 }
00109
00110 }
00111
00112 }
00113
00114 #endif