PointSetTopologyModifier.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_POINTSETTOPOLOGYMODIFIER_H
00026 #define SOFA_COMPONENT_TOPOLOGY_POINTSETTOPOLOGYMODIFIER_H
00027 
00028 #include <sofa/helper/vector.h>
00029 #include <sofa/core/componentmodel/topology/BaseTopology.h>
00030 
00031 namespace sofa
00032 {
00033 
00034 namespace component
00035 {
00036 
00037 namespace topology
00038 {
00039     class PointSetTopologyContainer;
00040     
00041     using core::componentmodel::topology::BaseMeshTopology;
00042     typedef BaseMeshTopology::PointID PointID;
00043     
00047     class PointSetTopologyModifier : public core::componentmodel::topology::TopologyModifier
00048     {
00049     public:
00050         PointSetTopologyModifier()
00051         : TopologyModifier()
00052         {}
00053 
00054         virtual ~PointSetTopologyModifier() {}
00055 
00056         virtual void init();
00057 
00061         virtual void swapPoints(const int i1,const int i2);
00062 
00067         void addPointsWarning(const unsigned int nPoints, const bool addDOF = true);
00068 
00073         void addPointsWarning(const unsigned int nPoints,
00074             const sofa::helper::vector< sofa::helper::vector< unsigned int > >& ancestors,
00075             const sofa::helper::vector< sofa::helper::vector< double       > >& coefs,
00076             const bool addDOF = true);
00077 
00078 
00083         virtual void addPointsProcess(const unsigned int nPoints);
00084 
00089         // side effect: indices are sorted first
00090         void removePointsWarning(/*const*/ sofa::helper::vector<unsigned int> &indices,
00091                                 const bool removeDOF = true);
00092 
00093 
00104         virtual void removePointsProcess(const sofa::helper::vector<unsigned int> &indices,
00105                                         const bool removeDOF = true);
00106 
00107 
00112         void renumberPointsWarning( const sofa::helper::vector<unsigned int> &index,
00113                                     const sofa::helper::vector<unsigned int> &inv_index,
00114                                     const bool renumberDOF = true);
00115 
00121         virtual void renumberPointsProcess( const sofa::helper::vector<unsigned int> &index,
00122                                             const sofa::helper::vector<unsigned int> &/*inv_index*/,
00123                                             const bool renumberDOF = true);
00124 
00134         void propagateTopologicalChanges();
00135         
00145         void propagateStateChanges();
00147         
00150         void notifyEndingEvent();
00151 
00154         virtual void removeItems(sofa::helper::vector< unsigned int >& /*items*/)
00155         { }
00156 
00159         virtual void renumberPoints( const sofa::helper::vector<unsigned int> &/*index*/,
00160                                     const sofa::helper::vector<unsigned int> &/*inv_index*/)
00161         { }
00162                                             
00163     private:
00164         PointSetTopologyContainer*  m_container;
00165     };
00166 
00167 } // namespace topology
00168 
00169 } // namespace component
00170 
00171 } // namespace sofa
00172 
00173 #endif // SOFA_COMPONENTS_POINTSETTOPOLOGYMODIFIER_H

Generated on Sun Nov 23 03:45:05 2008 for Sofa by  doxygen 1.5.7.1