BaseTopology.cpp

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 :: Framework                              *
00020 *                                                                             *
00021 * Authors: M. Adam, J. Allard, B. Andre, P-J. Bensoussan, S. Cotin, C. Duriez,*
00022 * H. Delingette, F. Falipou, F. Faure, S. Fonteneau, L. Heigeas, C. Mendoza,  *
00023 * M. Nesme, P. Neumann, J-P. de la Plata Alcade, F. Poyer and F. Roy          *
00024 *                                                                             *
00025 * Contact information: contact@sofa-framework.org                             *
00026 ******************************************************************************/
00027 #include <sofa/core/componentmodel/topology/BaseTopology.h>
00028 
00029 namespace sofa
00030 {
00031 
00032 namespace core
00033 {
00034 
00035 namespace componentmodel
00036 {
00037 
00038 namespace topology
00039 {
00040     // GeometryAlgorithms implementation
00041 
00042     void GeometryAlgorithms::init()
00043     {       
00044     }
00045 
00046     // TopologyAlgorithms implementation
00047 
00048     void TopologyAlgorithms::init()
00049     {
00050         this->getContext()->get(m_topologyContainer);
00051     }
00052 
00053     void TopologyAlgorithms::addTopologyChange(const TopologyChange *topologyChange) 
00054     {
00055         m_topologyContainer->addTopologyChange(topologyChange);
00056     }
00057 
00058     // TopologyModifier implementation
00059 
00060     void TopologyModifier::init()
00061     {
00062         this->getContext()->get(m_topologyContainer);
00063     }
00064 
00065     void TopologyModifier::addTopologyChange(const TopologyChange *topologyChange)
00066     {
00067         m_topologyContainer->addTopologyChange(topologyChange);
00068     }
00069 
00070     void TopologyModifier::addStateChange(const TopologyChange *topologyChange) 
00071     {
00072         m_topologyContainer->addStateChange(topologyChange);
00073     }
00074 
00075     void TopologyModifier::propagateStateChanges(){}
00076     void TopologyModifier::propagateTopologicalChanges(){}
00077     void TopologyModifier::notifyEndingEvent(){}
00078     void TopologyModifier::removeItems(sofa::helper::vector< unsigned int >& /*items*/){}
00079 
00080     // TopologyContainer implementation
00081 
00082     void TopologyContainer::init()
00083     {
00084     }
00085 
00086     std::list<const TopologyChange *>::const_iterator TopologyContainer::lastChange() const 
00087     {
00088         return m_changeList.end();
00089     }
00090 
00091     std::list<const TopologyChange *>::const_iterator TopologyContainer::firstChange() const 
00092     {
00093         return m_changeList.begin();
00094     }
00095 
00096     std::list<const TopologyChange *>::const_iterator TopologyContainer::lastStateChange() const 
00097     {
00098         return m_stateChangeList.end();
00099     }
00100 
00101     std::list<const TopologyChange *>::const_iterator TopologyContainer::firstStateChange() const 
00102     {
00103         return m_stateChangeList.begin();
00104     }
00105 
00106     void TopologyContainer::resetTopologyChangeList()
00107     {
00108         for (std::list<const TopologyChange *>::iterator it=m_changeList.begin(); 
00109             it!=m_changeList.end(); ++it) 
00110         {
00111             delete (*it);
00112         }
00113 
00114         m_changeList.clear();
00115     }
00116 
00117     void TopologyContainer::resetStateChangeList()
00118     {
00119         for (std::list<const TopologyChange *>::iterator it=m_stateChangeList.begin();
00120             it!=m_stateChangeList.end();++it) 
00121         {
00122             delete (*it);
00123         }
00124 
00125         m_stateChangeList.clear();
00126     }
00127 
00128 } // namespace topology
00129 
00130 } // namespace componentmodel
00131 
00132 } // namespace core
00133 
00134 } // namespace sofa
00135 

Generated on Sun Nov 23 02:29:24 2008 for Sofa by  doxygen 1.5.7.1