HexahedronSetTopologyChange.h

Go to the documentation of this file.
00001 /******************************************************************************
00002 *       SOFA, Simulation Open-Framework Architecture, version 1.0 beta 3      *
00003 *                (c) 2006-2008 MGH, INRIA, USTL, UJF, CNRS                    *
00004 *                                                                             *
00005 * This library is free software; you can redistribute it and/or modify it     *
00006 * under the terms of the GNU Lesser General Public License as published by    *
00007 * the Free Software Foundation; either version 2.1 of the License, or (at     *
00008 * your option) any later version.                                             *
00009 *                                                                             *
00010 * This library is distributed in the hope that it will be useful, but WITHOUT *
00011 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       *
00012 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
00013 * for more details.                                                           *
00014 *                                                                             *
00015 * You should have received a copy of the GNU Lesser General Public License    *
00016 * along with this library; if not, write to the Free Software Foundation,     *
00017 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.          *
00018 *******************************************************************************
00019 *                               SOFA :: Modules                               *
00020 *                                                                             *
00021 * Authors: The SOFA Team and external contributors (see Authors.txt)          *
00022 *                                                                             *
00023 * Contact information: contact@sofa-framework.org                             *
00024 ******************************************************************************/
00025 #ifndef SOFA_COMPONENT_TOPOLOGY_HEXAHEDRONSETTOPOLOGYCHANGE_H
00026 #define SOFA_COMPONENT_TOPOLOGY_HEXAHEDRONSETTOPOLOGYCHANGE_H
00027 
00028 #include <sofa/core/componentmodel/topology/Topology.h>     // TopologyChange
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 } // namespace topology
00109 
00110 } // namespace component
00111 
00112 } // namespace sofa
00113 
00114 #endif

Generated on Sun Nov 23 03:44:15 2008 for Sofa by  doxygen 1.5.7.1