00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #ifndef _OSGVOLUME_H_
00040 #define _OSGVOLUME_H_
00041
00042 #include <OSGBaseTypes.h>
00043 #include <OSGBaseFunctions.h>
00044
00045 #include "OSGVector.h"
00046 #include "OSGMatrix.h"
00047 #include "OSGLine.h"
00048 #include "OSGVolumeFunctions.h"
00049
00050 OSG_BEGIN_NAMESPACE
00051
00055 class OSG_BASE_DLLMAPPING Volume
00056 {
00057
00058
00059 public:
00060
00061
00065 virtual ~Volume(void);
00066
00068
00072 void setValid (const bool value = true);
00073 bool isValid ( void ) const;
00074
00075 void setEmpty (const bool value = true);
00076 bool isEmpty ( void ) const;
00077
00078 void setStatic (const bool value = true);
00079 bool isStatic ( void ) const;
00080
00081 void setInfinite (const bool value = true);
00082 bool isInfinite ( void ) const;
00083
00084 bool isUntouchable( void ) const;
00085
00086 UInt16 getState ( void ) const;
00087 void setState ( UInt16 state );
00088
00090
00094 virtual void getCenter (Pnt3f ¢er ) const = 0;
00095
00096 virtual float getScalarVolume(void ) const = 0;
00097
00098 virtual void getBounds (Pnt3f &min, Pnt3f &max) const = 0;
00099
00100 Pnt3f getMin (void ) const;
00101 Pnt3f getMax (void ) const;
00102
00104
00108 virtual void extendBy(const Pnt3f &pt ) = 0;
00109 virtual void extendBy(const Volume &volume) = 0;
00110
00112
00116 virtual bool intersect (const Pnt3f &point ) const = 0;
00117 virtual bool intersect (const Line &line ) const = 0;
00118 virtual bool intersect (const Line &line,
00119 Real32 &enter,
00120 Real32 &exit ) const = 0;
00121 virtual bool intersect (const Volume &volume) const = 0;
00122
00123 virtual bool isOnSurface(const Pnt3f &point ) const = 0;
00124
00126
00130 virtual void transform(const Matrix &matrix) = 0;
00131
00133
00137 virtual void dump( UInt32 uiIndent = 0,
00138 const BitVector bvFlags = 0) const = 0;
00139
00142 bool operator ==(const Volume &other) const;
00143 bool operator !=(const Volume &other) const;
00144
00145
00146
00147 protected:
00148
00149 UInt16 _state;
00150
00151
00155 Volume(void);
00156 Volume(const Volume &obj);
00157
00159
00160
00161 private:
00162
00163 enum State
00164 {
00165 OSGVALID = 1,
00166 OSGEMPTY = 2,
00167 OSGSTATIC = 4,
00168 OSGINFINITE = 8
00169 };
00170 };
00171
00172 typedef Volume* VolumeP;
00173
00175 OSG_BASE_DLLMAPPING void volDump(Volume *vol);
00176
00177 OSG_END_NAMESPACE
00178
00179 #include <OSGVolume.inl>
00180
00181 #endif // _OSGVOLUME_H_