Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OSGDVRClipObjects.cpp

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002  *                                OpenSG                                     *
00003  *                                                                           *
00004  *                                                                           *
00005  *             Copyright (C) 2000,2001 by the OpenSG Forum                   *
00006  *                                                                           *
00007  *                            www.opensg.org                                 *
00008  *                                                                           *
00009  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
00010  *                                                                           *
00011  \*---------------------------------------------------------------------------*/
00012 /*---------------------------------------------------------------------------*\
00013  *                                License                                    *
00014  *                                                                           *
00015  * This library is free software; you can redistribute it and/or modify it   *
00016  * under the terms of the GNU Library General Public License as published    *
00017  * by the Free Software Foundation, version 2.                               *
00018  *                                                                           *
00019  * This library is distributed in the hope that it will be useful, but       *
00020  * WITHOUT ANY WARRANTY; without even the implied warranty of                *
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00022  * Library General Public License for more details.                          *
00023  *                                                                           *
00024  * You should have received a copy of the GNU Library General Public         *
00025  * License along with this library; if not, write to the Free Software       *
00026  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
00027  *                                                                           *
00028  \*---------------------------------------------------------------------------*/
00029 /*---------------------------------------------------------------------------*\
00030  *                                Changes                                    *
00031  *                                                                           *
00032  *                                                                           *
00033  *                                                                           *
00034  *                                                                           *
00035  *                                                                           *
00036  *                                                                           *
00037  \*---------------------------------------------------------------------------*/
00038 
00039 //---------------------------------------------------------------------------
00040 //  Includes
00041 //---------------------------------------------------------------------------
00042 
00043 #include <stdlib.h>
00044 #include <stdio.h>
00045 
00046 #include <OSGConfig.h>
00047 
00048 #include <OSGDVRClipGeometry.h>
00049 #include <OSGDVRClipObjects.h>
00050 
00051 OSG_USING_NAMESPACE
00052 
00057 /*----------------------- constructors & destructors ----------------------*/
00058 
00060 DVRClipObjects::DVRClipObjects(void) :
00061     Inherited()
00062 {
00063 }
00064 
00066 DVRClipObjects::DVRClipObjects(const DVRClipObjects &source) :
00067     Inherited(source)
00068 {
00069 }
00070 
00072 DVRClipObjects::~DVRClipObjects(void)
00073 {
00074 }
00075 
00076 /*----------------------------- class specific ----------------------------*/
00077 
00079 void DVRClipObjects::initMethod (void)
00080 {
00081 }
00082 
00084 void DVRClipObjects::changed(BitVector whichField, UInt32 origin)
00085 {
00086     Inherited::changed(whichField, origin);
00087 }
00088 
00090 void DVRClipObjects::dump(      UInt32    , 
00091                           const BitVector ) const
00092 {
00093     SLOG << "Dump DVRClipObjects NI" << std::endl;
00094 }
00095 
00097 UInt32 DVRClipObjects::count(void) const
00098 {
00099     return _mfClipObjects.size();
00100 }
00101 
00103 void DVRClipObjects::initialize(const Matrix &volumeToWorld, 
00104                                 const Plane  &referencePlane)
00105 {
00106     for(UInt32 i = 0; i < _mfClipObjects.size(); i++)
00107     {
00108         _mfClipObjects[i]->initialize       (volumeToWorld );
00109         _mfClipObjects[i]->setReferencePlane(referencePlane);
00110     }
00111 }
00112 
00113 // deprecated -> remove
00114 void DVRClipObjects::initialize(const Matrix &volumeToWorld)
00115 {
00116     for(UInt32 i = 0; i < _mfClipObjects.size(); i++)
00117         _mfClipObjects[i]->initialize(volumeToWorld);
00118 }
00119 
00121 // deprecated -> remove
00122 void DVRClipObjects::setReferencePlane(const Plane &referencePlane)
00123 {
00124     for(UInt32 i = 0; i < _mfClipObjects.size(); i++)
00125         _mfClipObjects[i]->setReferencePlane(referencePlane);
00126 }
00127 
00129 DVRClipGeometryPtr DVRClipObjects::get(UInt32 i)
00130 {
00131     return _mfClipObjects[i];
00132 }
00133 
00135 void DVRClipObjects::add(DVRClipGeometryPtr obj)
00136 {
00137     if(obj == NullFC)
00138         return;
00139 
00140     addRefCP(obj);
00141 
00142     _mfClipObjects.push_back(obj);
00143 }
00144 
00146 void DVRClipObjects::remove(DVRClipGeometryPtr obj)
00147 {
00148     if(obj == NullFC)
00149         return;
00150 
00151     for(MFDVRClipGeometryPtr::iterator i  = _mfClipObjects.begin(); 
00152                                        i != _mfClipObjects.end(); 
00153                                        i++)
00154     {
00155         if(*i == obj)
00156         {
00157             _mfClipObjects.erase(i);
00158             subRefCP(obj);
00159             break;
00160         }
00161     }
00162 }
00163 
00165 void DVRClipObjects::remove(UInt32 n)
00166 {
00167     MFDVRClipGeometryPtr::iterator it = _mfClipObjects.begin();
00168 
00169     for(UInt32 i = 0; i < n && it != _mfClipObjects.end(); i++) 
00170         it++;  
00171 
00172     if(it != _mfClipObjects.end())
00173     {
00174         subRefCP(*it);
00175         _mfClipObjects.erase(it);    
00176     }
00177 }
00178 
00179 /*------------------------------------------------------------------------*/
00180 /*                              cvs id's                                  */
00181 
00182 #ifdef OSG_SGI_CC
00183 #pragma set woff 1174
00184 #endif
00185 
00186 #ifdef OSG_LINUX_ICC
00187 #pragma warning( disable : 177 )
00188 #endif
00189 
00190 namespace
00191 {
00192     static Char8 cvsid_cpp       [] = "@(#)$Id: $";
00193     static Char8 cvsid_hpp       [] = OSGDVRCLIPOBJECTSBASE_HEADER_CVSID;
00194     static Char8 cvsid_inl       [] = OSGDVRCLIPOBJECTSBASE_INLINE_CVSID;
00195 
00196     static Char8 cvsid_fields_hpp[] = OSGDVRCLIPOBJECTSFIELDS_HEADER_CVSID;
00197 }
00198 
00199 #ifdef __sgi
00200 #pragma reset woff 1174
00201 #endif

Generated on Thu Aug 25 04:03:22 2005 for OpenSG by  doxygen 1.4.3