00001 /*---------------------------------------------------------------------------*\ 00002 * OpenSG * 00003 * * 00004 * * 00005 * Copyright (C) 2000-2002 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 /*---------------------------------------------------------------------------*\ 00031 * Changes * 00032 * * 00033 * * 00034 * * 00035 * * 00036 * * 00037 * * 00038 \*---------------------------------------------------------------------------*/ 00039 00040 00041 //--------------------------------------------------------------------------- 00042 // Includes 00043 //--------------------------------------------------------------------------- 00044 00045 #include "OSGConfig.h" 00046 #include "OSGVolume.h" 00047 00048 OSG_BEGIN_NAMESPACE 00049 00050 /*-------------------------- constructor ----------------------------------*/ 00051 00055 inline 00056 PolytopeVolume::PolytopeVolume() : 00057 Volume() 00058 { 00059 } 00060 00062 00063 inline 00064 PolytopeVolume::PolytopeVolume ( const UInt16& s ) : 00065 Volume(), _numPlanes(s) 00066 { 00067 _planes = new Plane[_numPlanes]; 00068 } 00069 00071 inline 00072 PolytopeVolume::PolytopeVolume(const PolytopeVolume &obj) : 00073 Volume(obj), _numPlanes(obj._numPlanes) 00074 { 00075 _planes=new Plane[_numPlanes]; 00076 for(UInt16 i=0; i<_numPlanes; i++) 00077 _planes[i]=obj._planes[i]; 00078 } 00079 00081 inline 00082 PolytopeVolume::~PolytopeVolume() 00083 { 00084 delete[] _planes; 00085 } 00086 00087 /*------------------------------ feature ----------------------------------*/ 00088 00090 inline 00091 const Plane &PolytopeVolume::getNear (void) const 00092 { 00093 return _planes[0]; 00094 } 00095 00097 inline 00098 const Plane *PolytopeVolume::getPlanes(void) 00099 { 00100 return _planes; 00101 } 00102 00104 inline 00105 const Plane *PolytopeVolume::getPlanes(void) const 00106 { 00107 return _planes; 00108 } 00109 00110 /*-------------------------- extending ------------------------------------*/ 00111 00112 inline 00113 void PolytopeVolume::extendBy(const Volume &volume) 00114 { 00115 // not implemented 00116 } 00117 00118 inline 00119 void PolytopeVolume::extendBy(const PolytopeVolume &volume) 00120 { 00121 // not implemented 00122 } 00123 00124 /*-------------------------- intersection ---------------------------------*/ 00125 00126 inline 00127 bool PolytopeVolume::intersect (const Volume &volume) const 00128 { 00129 // not implemented 00130 return(1); 00131 } 00132 00133 inline 00134 bool PolytopeVolume::intersect(const PolytopeVolume &volume) const 00135 { 00136 // not implemented 00137 return(1); 00138 } 00139 00140 00141 /*-------------------------- operators ------------------------------------*/ 00142 00146 00147 inline 00148 bool operator != (const PolytopeVolume &b1, const PolytopeVolume &b2) 00149 { 00150 return !(b1 == b2); 00151 } 00152 00153 /***************************************************************************\ 00154 * Instance methods * 00155 \***************************************************************************/ 00156 00157 OSG_END_NAMESPACE
1.5.5