EdgeSetTopologyModifier.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_EDGESETTOPOLOGYMODIFIER_H
00026 #define SOFA_COMPONENT_TOPOLOGY_EDGESETTOPOLOGYMODIFIER_H
00027 
00028 #include <sofa/component/topology/PointSetTopologyModifier.h>
00029 
00030 namespace sofa
00031 {
00032 
00033 namespace component
00034 {
00035 
00036 namespace topology
00037 {
00038     class EdgeSetTopologyContainer;
00039        
00040     using core::componentmodel::topology::BaseMeshTopology;
00041     typedef BaseMeshTopology::EdgeID EdgeID;
00042     typedef BaseMeshTopology::Edge Edge;
00043     typedef BaseMeshTopology::SeqEdges SeqEdges;
00044     typedef BaseMeshTopology::VertexEdges VertexEdges;
00045     
00049     class EdgeSetTopologyModifier : public PointSetTopologyModifier
00050     {
00051     public:
00052         EdgeSetTopologyModifier()
00053         : PointSetTopologyModifier()
00054         {}
00055 
00056         virtual ~EdgeSetTopologyModifier() {}
00057 
00058         virtual void init();
00059         
00064         virtual void addEdgesWarning(const unsigned int nEdges);
00065 
00070         virtual void addEdgesWarning(const unsigned int nEdges,
00071             const sofa::helper::vector< Edge >& edgesList,
00072             const sofa::helper::vector< unsigned int >& edgesIndexList);
00073 
00078         virtual void addEdgesWarning(const unsigned int nEdges,
00079             const sofa::helper::vector< Edge >& edgesList,
00080             const sofa::helper::vector< unsigned int >& edgesIndexList,
00081             const sofa::helper::vector< sofa::helper::vector< unsigned int > > & ancestors);
00082 
00087         virtual void addEdgesWarning(const unsigned int nEdges,
00088             const sofa::helper::vector< Edge >& edgesList,
00089             const sofa::helper::vector< unsigned int >& edgesIndexList,
00090             const sofa::helper::vector< sofa::helper::vector< unsigned int > > & ancestors,
00091             const sofa::helper::vector< sofa::helper::vector< double > >& baryCoefs);
00092 
00095         void addEdgeProcess(Edge e);
00096 
00101         virtual void addEdgesProcess(const sofa::helper::vector< Edge > &edges);
00102 
00107         // side effect : edges are sorted first
00108         virtual void removeEdgesWarning(/*const*/ sofa::helper::vector<unsigned int> &edges);
00109 
00121         virtual void removeEdgesProcess(const sofa::helper::vector<unsigned int> &indices, const bool removeIsolatedItems = false);
00122 
00126         virtual void swapEdgesProcess(const sofa::helper::vector< sofa::helper::vector< unsigned int > >& edgesPairs);
00127 
00132         virtual void fuseEdgesProcess(const sofa::helper::vector< sofa::helper::vector< unsigned int > >& edgesPairs, const bool removeIsolatedPoints = true);
00133 
00138         virtual void splitEdgesProcess(/*const*/ sofa::helper::vector<unsigned int> &indices,
00139             const bool removeIsolatedPoints = true);
00140 
00145         virtual void splitEdgesProcess(/*const*/ sofa::helper::vector<unsigned int> &indices,
00146             const sofa::helper::vector< sofa::helper::vector< double > >& baryCoefs,
00147             const bool removeIsolatedPoints = true);
00148         
00153         virtual void addPointsProcess(const unsigned int nPoints);
00154 
00163         virtual void removePointsProcess(/*const*/ 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 
00179         // side effect: edges are sorted in removeEdgesWarning
00180         virtual void removeEdges(/*const*/ sofa::helper::vector< unsigned int >& edges, 
00181                                 const bool removeIsolatedPoints = true);
00182 
00185         virtual void removeItems(/*const*/ sofa::helper::vector< unsigned int >& items);
00186 
00189         virtual void renumberPoints( const sofa::helper::vector<unsigned int> & index, 
00190                                      const sofa::helper::vector<unsigned int> & inv_index);
00191 
00196         virtual void addEdges(const sofa::helper::vector< Edge >& edges) ;
00197 
00204         virtual void addEdges(const sofa::helper::vector< Edge >& edges,
00205             const sofa::helper::vector< sofa::helper::vector< unsigned int > > & ancestors,
00206             const sofa::helper::vector< sofa::helper::vector< double > >& baryCoefs) ;
00207 
00211         virtual void swapEdges(const sofa::helper::vector< sofa::helper::vector< unsigned int > >& edgesPairs);
00212 
00217         virtual void fuseEdges(const sofa::helper::vector< sofa::helper::vector< unsigned int > >& edgesPairs, const bool removeIsolatedPoints = true);
00218 
00224         virtual void splitEdges( sofa::helper::vector<unsigned int> &indices,
00225             const bool removeIsolatedPoints = true);
00226 
00232         virtual void splitEdges( sofa::helper::vector<unsigned int> &indices,
00233             const sofa::helper::vector< sofa::helper::vector< double > >& baryCoefs,
00234             const bool removeIsolatedPoints = true);
00235 
00238         virtual void resortCuthillMckee(sofa::helper::vector<int>& inverse_permutation); 
00239 
00240     private:
00241         EdgeSetTopologyContainer*   m_container;
00242     };
00243 
00244 } // namespace topology
00245 
00246 } // namespace component
00247 
00248 } // namespace sofa
00249 
00250 #endif

Generated on Sun Nov 23 03:43:31 2008 for Sofa by  doxygen 1.5.7.1