00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _PB_DOMAIN_
00025 #define _PB_DOMAIN_
00026
00027 #include <Inventor/SbLinear.h>
00028 #include <Inventor/SbBox.h>
00029 #include <MeshViz/graph/PbBase.h>
00030
00031 class SoTransform ;
00032 class SoMatrixTransform ;
00033
00092 class PbDomain : public PbBase {
00093
00094
00095 public:
00096
00097
00098
00102 enum TransformType {
00103 TRANSFORM_01,
00104 SCALE_X_FIXED,
00105 SCALE_Y_FIXED,
00106 SCALE_Z_FIXED,
00107 SCALE_MAX_XYZ_FIXED
00108 } ;
00109
00110
00111
00115 enum BoundingBoxType {
00116 AS_IS,
00117 MIN_BOUNDING_CUBE,
00118 MAX_BOUNDED_CUBE
00119 } ;
00120
00124 PbDomain() ;
00125
00129 PbDomain(const PbDomain &domain) ;
00130
00134 PbDomain(SbBox2f &box, BoundingBoxType type = AS_IS) ;
00135
00139 PbDomain(SbBox3f &box, BoundingBoxType type = AS_IS) ;
00140
00144 PbDomain(float xmin, float ymin, float xmax, float ymax, BoundingBoxType type = AS_IS) ;
00145
00149 PbDomain(float xmin, float ymin, float zmin, float xmax, float ymax, float zmax,
00150 BoundingBoxType type = AS_IS) ;
00151
00155 void setDomain(float xmin, float ymin, float xmax, float ymax, BoundingBoxType type = AS_IS) ;
00156
00160 void setDomain(float xmin, float ymin, float zmin, float xmax, float ymax, float zmax,
00161 BoundingBoxType type = AS_IS) ;
00162
00166 void setDomain(SbBox2f &box, BoundingBoxType type = AS_IS) ;
00167
00171 void setDomain(SbBox3f &box, BoundingBoxType type = AS_IS) ;
00172
00177 void getDomain(float &xmin, float &ymin, float &xmax, float &ymax) const ;
00178
00183 void getDomain(float &xmin, float &ymin, float &zmin, float &xmax, float &ymax, float &zmax) const ;
00184
00189 void getDomain(SbBox2f &box) const ;
00190
00195 void getDomain(SbBox3f &box) const ;
00196
00200 void setTransformType(TransformType type) ;
00201
00205 TransformType getTransformType() const
00206 { return m_transformType ; }
00207
00211 SoMatrixTransform* getMatrixTransform() const ;
00212
00216 SoTransform* getTransform() const ;
00217
00221 SbMatrix getMatrix() const ;
00222
00226 int operator==(const PbDomain &dom) ;
00227
00231 int operator!=(const PbDomain &dom) {return !(*this == dom) ;}
00232
00236 PbDomain& operator=(const PbDomain &domain) ;
00237
00238
00239 private:
00240 void getDelta(float &deltaX, float &deltaY) const
00241 { deltaX = m_delta[0] ; deltaY = m_delta[1] ; }
00242
00243 void getDelta(float &deltaX, float &deltaY, float &deltaZ) const
00244 { deltaX = m_delta[0] ; deltaY = m_delta[1] ; deltaZ = m_delta[2] ; }
00245
00246 float getDeltaX() const
00247 { return m_delta[0] ; }
00248
00249 float getDeltaY() const
00250 { return m_delta[1] ; }
00251
00252 float getDeltaZ() const
00253 { return m_delta[2] ; }
00254
00255 SbBool isHomogeneous() const ;
00256
00257 private:
00258
00259 void copy(const PbDomain &domain, SbBool isConstructorPerCopy) ;
00260
00261 void init(float xmin, float ymin, float xmax, float ymax, BoundingBoxType type = AS_IS) ;
00262 void init3(float xmin, float ymin, float zmin, float xmax, float ymax, float zmax,
00263 BoundingBoxType type = AS_IS) ;
00264
00265 float m_min[3], m_max[3], m_delta[3] ;
00266 TransformType m_transformType ;
00267 } ;
00268
00269
00270
00271 #endif
00272
00273