HexahedronSetTopologyModifier.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_HEXAHEDRONSETTOPOLOGYMODIFIER_H
00026 #define SOFA_COMPONENT_TOPOLOGY_HEXAHEDRONSETTOPOLOGYMODIFIER_H
00027 
00028 #include <sofa/component/topology/QuadSetTopologyModifier.h>
00029 
00030 namespace sofa
00031 {
00032 namespace component
00033 {
00034 namespace topology
00035 {
00036     class HexahedronSetTopologyContainer;
00037     
00038     using core::componentmodel::topology::BaseMeshTopology;
00039     typedef BaseMeshTopology::HexaID HexaID;
00040     typedef BaseMeshTopology::Hexa Hexa;
00041     typedef BaseMeshTopology::SeqHexas SeqHexas;
00042     typedef BaseMeshTopology::VertexHexas VertexHexas;
00043     typedef BaseMeshTopology::EdgeHexas EdgeHexas;
00044     typedef BaseMeshTopology::QuadHexas QuadHexas;
00045     typedef BaseMeshTopology::HexaEdges HexaEdges;
00046     typedef BaseMeshTopology::HexaQuads HexaQuads;
00047 
00048     typedef Hexa Hexahedron;
00049     typedef HexaEdges HexahedronEdges;
00050     typedef HexaQuads HexahedronQuads;
00051     
00055     class HexahedronSetTopologyModifier : public QuadSetTopologyModifier
00056     {
00057     public:
00058         HexahedronSetTopologyModifier()
00059         : QuadSetTopologyModifier()
00060         { }
00061 
00062         virtual ~HexahedronSetTopologyModifier() {}
00063 
00064         virtual void init();
00065         
00070         void addHexahedraWarning(const unsigned int nHexahedra,
00071             const sofa::helper::vector< Hexahedron >& hexahedraList,
00072             const sofa::helper::vector< unsigned int >& hexahedraIndexList);
00073 
00078         void addHexahedraWarning(const unsigned int nHexahedra,
00079             const sofa::helper::vector< Hexahedron >& hexahedraList,
00080             const sofa::helper::vector< unsigned int >& hexahedraIndexList,
00081             const sofa::helper::vector< sofa::helper::vector< unsigned int > > & ancestors,
00082             const sofa::helper::vector< sofa::helper::vector< double > >& baryCoefs);
00083 
00086         void addHexahedronProcess(Hexahedron e);
00087 
00092         virtual void addHexahedraProcess(const sofa::helper::vector< Hexahedron > &hexahedra);
00093 
00100         void removeHexahedraWarning( sofa::helper::vector<unsigned int> &hexahedra);
00101 
00110         virtual void removeHexahedraProcess(const sofa::helper::vector<unsigned int>&indices,
00111                                             const bool removeIsolatedItems = false);
00112 
00117         virtual void addQuadsProcess(const sofa::helper::vector< Quad > &quads);
00118 
00125         virtual void removeQuadsProcess(const sofa::helper::vector<unsigned int> &indices, 
00126                                         const bool removeIsolatedEdges = false, 
00127                                         const bool removeIsolatedPoints = false);
00128 
00133         virtual void addEdgesProcess(const sofa::helper::vector< Edge > &edges);
00134 
00143         virtual void removeEdgesProcess(const sofa::helper::vector<unsigned int> &indices,
00144                                         const bool removeIsolatedItems = false);
00145 
00150         virtual void addPointsProcess(const unsigned int nPoints);
00151 
00160         virtual void removePointsProcess( sofa::helper::vector<unsigned int> &indices, const bool removeDOF = true);
00161 
00167         virtual void renumberPointsProcess( const sofa::helper::vector<unsigned int> &index, 
00168                                             const sofa::helper::vector<unsigned int>& inv_index, 
00169                                             const bool renumberDOF = true); 
00170 
00175         virtual void removeHexahedra(sofa::helper::vector< unsigned int >& hexahedra);
00176 
00179         virtual void removeItems(sofa::helper::vector< unsigned int >& items);
00180 
00183         virtual void renumberPoints( const sofa::helper::vector<unsigned int>& index, 
00184                                     const sofa::helper::vector<unsigned int>& inv_index);
00185 
00186 
00187     private:
00188         HexahedronSetTopologyContainer*     m_container;
00189     };
00190 
00191 } // namespace topology
00192 
00193 } // namespace component
00194 
00195 } // namespace sofa
00196 
00197 #endif

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