TetrahedronSetTopologyModifier.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_TETRAHEDRONSETTOPOLOGYMODIFIER_H     
00026 #define SOFA_COMPONENT_TOPOLOGY_TETRAHEDRONSETTOPOLOGYMODIFIER_H
00027 
00028 #include <sofa/component/topology/TriangleSetTopologyModifier.h>
00029 
00030 namespace sofa
00031 {
00032 
00033 namespace component
00034 {
00035 
00036 namespace topology
00037 {
00038     class TetrahedronSetTopologyContainer;
00039 
00040     using core::componentmodel::topology::BaseMeshTopology;
00041     typedef BaseMeshTopology::TetraID TetraID;
00042     typedef BaseMeshTopology::Tetra Tetra;
00043     typedef BaseMeshTopology::SeqTetras SeqTetras;
00044     typedef BaseMeshTopology::VertexTetras VertexTetras;
00045     typedef BaseMeshTopology::EdgeTetras EdgeTetras;
00046     typedef BaseMeshTopology::TriangleTetras TriangleTetras;
00047     typedef BaseMeshTopology::TetraEdges TetraEdges;
00048     typedef BaseMeshTopology::TetraTriangles TetraTriangles;
00049 
00050     typedef Tetra Tetrahedron;
00051     typedef TetraEdges TetrahedronEdges;
00052     typedef TetraTriangles TetrahedronTriangles;
00053     
00057     class TetrahedronSetTopologyModifier : public TriangleSetTopologyModifier
00058     {
00059     public:
00060         TetrahedronSetTopologyModifier()
00061         : TriangleSetTopologyModifier()
00062         {}
00063 
00064         virtual ~TetrahedronSetTopologyModifier() {}
00065         
00066         virtual void init();
00067 
00072         void addTetrahedraWarning(const unsigned int nTetrahedra,
00073                                 const sofa::helper::vector< Tetrahedron >& tetrahedraList,
00074                                 const sofa::helper::vector< unsigned int >& tetrahedraIndexList);
00075 
00080         void addTetrahedraWarning(const unsigned int nTetrahedra,
00081                                 const sofa::helper::vector< Tetrahedron >& tetrahedraList,
00082                                 const sofa::helper::vector< unsigned int >& tetrahedraIndexList,
00083                                 const sofa::helper::vector< sofa::helper::vector< unsigned int > > & ancestors,
00084                                 const sofa::helper::vector< sofa::helper::vector< double > >& baryCoefs);
00085 
00089         void addTetrahedronProcess(Tetrahedron e);
00090 
00095         virtual void addTetrahedraProcess(const sofa::helper::vector< Tetrahedron > &tetrahedra);
00096 
00103         void removeTetrahedraWarning( sofa::helper::vector<unsigned int> &tetrahedra);
00104 
00113         virtual void removeTetrahedraProcess( const sofa::helper::vector<unsigned int> &indices,
00114                                             const bool removeIsolatedItems=false);
00115 
00120         virtual void addTrianglesProcess(const sofa::helper::vector< Triangle > &triangles);
00121 
00128         virtual void removeTrianglesProcess(const sofa::helper::vector<unsigned int> &indices, 
00129                                             const bool removeIsolatedEdges=false, 
00130                                             const bool removeIsolatedPoints=false);
00131 
00136         virtual void addEdgesProcess(const sofa::helper::vector< Edge > &edges);
00137 
00146         virtual void removeEdgesProcess( const sofa::helper::vector<unsigned int> &indices,
00147                                         const bool removeIsolatedItems=false);
00148 
00153         virtual void addPointsProcess(const unsigned int nPoints);      
00154 
00163         virtual void removePointsProcess( sofa::helper::vector<unsigned int> &indices, const bool removeDOF = true);
00164 
00170         virtual void renumberPointsProcess( const sofa::helper::vector<unsigned int> &index, 
00171                                             const sofa::helper::vector<unsigned int> &/*inv_index*/, 
00172                                             const bool renumberDOF = true); 
00173         
00178         virtual void removeTetrahedra(sofa::helper::vector< unsigned int >& tetrahedra);
00179 
00182         virtual void removeItems(sofa::helper::vector< unsigned int >& items);
00183 
00186         void RemoveTetraBall(unsigned int ind_ta, unsigned int ind_tb);
00187 
00190         virtual void renumberPoints( const sofa::helper::vector<unsigned int> &/*index*/, 
00191                                     const sofa::helper::vector<unsigned int> &/*inv_index*/);
00192 
00193 
00194     private:
00195         TetrahedronSetTopologyContainer*    m_container;
00196     };
00197 
00198 } // namespace topology
00199 
00200 } // namespace component
00201 
00202 } // namespace sofa
00203 
00204 #endif

Generated on Sun Nov 23 03:46:36 2008 for Sofa by  doxygen 1.5.7.1