TriangleSetTopologyModifier.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_TRIANGLESETTOPOLOGYMODIFIER_H
00026 #define SOFA_COMPONENT_TOPOLOGY_TRIANGLESETTOPOLOGYMODIFIER_H
00027 
00028 #include <sofa/component/topology/EdgeSetTopologyModifier.h>  
00029 
00030 namespace sofa
00031 {
00032 namespace component
00033 {
00034 namespace topology
00035 {
00036     class TriangleSetTopologyContainer;
00037     
00038     using core::componentmodel::topology::BaseMeshTopology;
00039     typedef BaseMeshTopology::TriangleID TriangleID;
00040     typedef BaseMeshTopology::Triangle Triangle;
00041     typedef BaseMeshTopology::SeqTriangles SeqTriangles;
00042     typedef BaseMeshTopology::VertexTriangles VertexTriangles;
00043     typedef BaseMeshTopology::EdgeTriangles EdgeTriangles;
00044     typedef BaseMeshTopology::TriangleEdges TriangleEdges;
00045     
00049     class TriangleSetTopologyModifier : public EdgeSetTopologyModifier
00050     {
00051     public:
00052         TriangleSetTopologyModifier()
00053         : EdgeSetTopologyModifier()
00054         { }
00055 
00056         virtual ~TriangleSetTopologyModifier() {}
00057         
00058         virtual void init();
00059 
00064         void addTrianglesWarning(const unsigned int nTriangles,
00065                                  const sofa::helper::vector< Triangle >& trianglesList,
00066                                  const sofa::helper::vector< unsigned int >& trianglesIndexList) ;
00067 
00072         void addTrianglesWarning(const unsigned int nTriangles,
00073                                  const sofa::helper::vector< Triangle >& trianglesList,
00074                                  const sofa::helper::vector< unsigned int >& trianglesIndexList,
00075                                  const sofa::helper::vector< sofa::helper::vector< unsigned int > > & ancestors,
00076                                  const sofa::helper::vector< sofa::helper::vector< double > >& baryCoefs) ;
00077             
00080         void addTriangleProcess(Triangle e);
00081 
00086         virtual void addTrianglesProcess(const sofa::helper::vector< Triangle > &triangles);
00087       
00094         virtual void removeTrianglesWarning( sofa::helper::vector<unsigned int> &triangles);
00095 
00104         virtual void removeTrianglesProcess( const sofa::helper::vector<unsigned int> &indices, 
00105                                             const bool removeIsolatedEdges=false, 
00106                                             const bool removeIsolatedPoints=false);
00107 
00112         void addEdgesWarning(const unsigned int nEdges,
00113                             const sofa::helper::vector< Edge >& edgesList,
00114                             const sofa::helper::vector< unsigned int >& edgesIndexList)
00115         {
00116             EdgeSetTopologyModifier::addEdgesWarning( nEdges, edgesList, edgesIndexList);
00117         }
00118 
00123         void addEdgesWarning(const unsigned int nEdges,
00124                             const sofa::helper::vector< Edge >& edgesList,
00125                             const sofa::helper::vector< unsigned int >& edgesIndexList,
00126                             const sofa::helper::vector< sofa::helper::vector< unsigned int > > & ancestors,
00127                             const sofa::helper::vector< sofa::helper::vector< double > >& baryCoefs)
00128         {
00129             EdgeSetTopologyModifier::addEdgesWarning( nEdges, edgesList, edgesIndexList, ancestors, baryCoefs);
00130         }
00131 
00136          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, 
00164                                         const bool removeDOF = true);
00165 
00171         virtual void renumberPointsProcess( const sofa::helper::vector<unsigned int> &index, 
00172                                             const sofa::helper::vector<unsigned int> &inv_index, 
00173                                             const bool renumberDOF = true); 
00174         
00182         virtual void removeTriangles(sofa::helper::vector< unsigned int >& triangles,
00183                                     const bool removeIsolatedEdges, 
00184                                     const bool removeIsolatedPoints);
00185     
00188         virtual void removeItems(sofa::helper::vector< unsigned int >& items);
00189 
00192         virtual void renumberPoints( const sofa::helper::vector<unsigned int> &index, 
00193                                     const sofa::helper::vector<unsigned int> &inv_index);
00194 
00195 
00196     private:
00197         TriangleSetTopologyContainer*   m_container;
00198     };
00199 
00200 } // namespace topology
00201 
00202 } // namespace component
00203 
00204 } // namespace sofa
00205 
00206 #endif

Generated on Sun Nov 23 03:47:40 2008 for Sofa by  doxygen 1.5.7.1