00001 //----------------------------------------------------------------------------------- 00002 // 00003 // Pro-Vocation Light Engine (PVLE) 00004 // Copyright (C) 2007-2009 Sukender, KinoX & Buzib 00005 // For more information, contact us : sukender@free.fr 00006 // 00007 // This program is free software; you can redistribute it and/or modify 00008 // it under the terms of the GNU General Public License as published by 00009 // the Free Software Foundation; either version 3 of the License, or 00010 // (at your option) any later version. 00011 // 00012 // For any use that is not compatible with the terms of the GNU 00013 // General Public License, please contact the authors for alternative 00014 // licensing options. 00015 // 00016 // This program is distributed in the hope that it will be useful, 00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 // GNU General Public License for more details. 00020 // 00021 // You should have received a copy of the GNU General Public License along 00022 // with this program; if not, write to the Free Software Foundation, Inc., 00023 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00024 // 00025 //----------------------------------------------------------------------------------- 00026 00027 #include <PVLE/Physics/AbstractGeom.h> 00028 #include <PVLE/Physics/Geom.h> 00029 #include <PVLE/Physics/Space.h> 00030 #include <PVLE/Physics/Visitor.h> 00031 00032 namespace Physics { 00033 00034 AbstractGeom * AbstractGeom::clone(const AbstractGeom & v, UINT opts, IGeomCollisionContainer * pGeomsContainer, TDuplicatedBodiesMap * pDuplicatedBodies) { 00035 const Geom * pGeom = v.asGeom(); 00036 if (pGeom) return new Geom(*pGeom, opts, pGeomsContainer, pDuplicatedBodies); 00037 ASSERT(v.asSpace()); 00038 return new Space(*v.asSpace(), opts, pGeomsContainer, pDuplicatedBodies); 00039 } 00040 00041 00042 void AbstractGeom::accept(Visitor & v) { 00043 // Code from OSG: 00044 //if (nv.validNodeMask(*this)) 00045 //{ 00046 // nv.pushOntoNodePath(this); 00047 // nv.apply(*this); 00048 // nv.popFromNodePath(); 00049 //} 00050 00051 // Code MUST be the same for geoms and spaces 00052 00053 v.apply(*this); 00054 } 00055 00056 } // namespace Physics