Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
PbDomain Class Reference

MeshViz Class to define a domain. More...

#include <MeshViz/graph/PbDomain.h>

+ Inheritance diagram for PbDomain:

Public Types

enum  TransformType {
  TRANSFORM_01 ,
  SCALE_X_FIXED ,
  SCALE_Y_FIXED ,
  SCALE_Z_FIXED ,
  SCALE_MAX_XYZ_FIXED
}
 Transform type. More...
 
enum  BoundingBoxType {
  AS_IS ,
  MIN_BOUNDING_CUBE ,
  MAX_BOUNDED_CUBE
}
 Bounding box interpretation. More...
 

Public Member Functions

 PbDomain ()
 Default constructor.
 
 PbDomain (const PbDomain &domain)
 Copy constructor.
 
 PbDomain (SbBox2f &box, BoundingBoxType type=AS_IS)
 Constructor of a 2D domain.
 
 PbDomain (SbBox3f &box, BoundingBoxType type=AS_IS)
 Constructor of a 3D domain.
 
 PbDomain (float xmin, float ymin, float xmax, float ymax, BoundingBoxType type=AS_IS)
 Constructor of a 2D domain.
 
 PbDomain (float xmin, float ymin, float zmin, float xmax, float ymax, float zmax, BoundingBoxType type=AS_IS)
 Constructor of a 3D domain.
 
void setDomain (float xmin, float ymin, float xmax, float ymax, BoundingBoxType type=AS_IS)
 Sets a 2D domain.
 
void setDomain (float xmin, float ymin, float zmin, float xmax, float ymax, float zmax, BoundingBoxType type=AS_IS)
 Sets a 3D domain.
 
void setDomain (SbBox2f &box, BoundingBoxType type=AS_IS)
 Sets a 2D domain.
 
void setDomain (SbBox3f &box, BoundingBoxType type=AS_IS)
 Sets a 3D domain.
 
void getDomain (float &xmin, float &ymin, float &xmax, float &ymax) const
 Gets the 2D domain.
 
void getDomain (float &xmin, float &ymin, float &zmin, float &xmax, float &ymax, float &zmax) const
 Gets the 3D domain.
 
void getDomain (SbBox2f &box) const
 Gets the 2D domain.
 
void getDomain (SbBox3f &box) const
 Gets the 3D domain.
 
void setTransformType (TransformType type)
 Sets the type of transformation.
 
TransformType getTransformType () const
 Gets the type of transformation.
 
SoMatrixTransformgetMatrixTransform () const
 Get the domain transform matrix in an SoMatrixTransform object.
 
SoTransformgetTransform () const
 Get the domain transform matrix in an SoTransform object.
 
SbMatrix getMatrix () const
 Get the domain transform matrix in an SbMatrix object.
 
int operator== (const PbDomain &dom)
 Equality comparison operator.
 
int operator!= (const PbDomain &dom)
 Inequality comparison operator.
 
PbDomainoperator= (const PbDomain &domain)
 Assignment operator.
 
- Public Member Functions inherited from PbBase
void enableConnection (SbBool flag)
 Activates/deactivates the mechanism of connection.
 
SbBool isConnectionEnabled () const
 Returns TRUE if the connection mechanism is active, otherwise FALSE.
 
void touch ()
 Simulates the changing of an instance of this object, so all connected objects are informed of this change.
 
PbBaseoperator= (const PbBase &base)
 Assignment operator.
 

Detailed Description

MeshViz Class to define a domain.

This class is used to define a 2D/3D domain. It is the reference of all Graph Master & 3D Data Master nodekits classes and some fields of these classes are expressed in a domain.

The domain usually defines the data coordinate limits of graphics to be generated. Graph Master & 3D Data Master do not calculate these limits, so this class provides them. In conceptual terms, a 2D domain (3D domain) is the smallest rectangle (parallelepiped) capable of containing the data for the image to be generated. The sides of this rectangle (parallelepiped) are parallel to the axis.Furthermore all Graph Master & 3D Data Master nodekits classes may be transformed according to the domain which they refer to.

There are five possible transformations (we note dx = xmax - xmin, dy = ymax - ymin and dz = zmax - zmin, xmin, ymin,..., zmax are the limits of the domain):

  • The transformation is a scaling and a translation (all representations are drawn between [0-1] x [0-1] x ([0-1])). (type of transformation = TRANSFORM_01).
  • All representations are scaled with scaling factors x = 1, y = dx/dy, z = dx/dz. (type of transformation = SCALE_X_FIXED).
  • All representations are scaled with scaling factors x = dy/dx, y =1, z = dy/dz. (type of transformation = SCALE_Y_FIXED).
  • All representations are scaled with scaling factors x = dz/dx, y = dz/dy, z = 1. (type of transformation = SCALE_Z_FIXED).
  • One of scale 2,3,4 is applied according to the max(dx,dy,dz). (type of transformation = SCALE_MAX_XYZ_FIXED).

Except the first transformation type, the others compute a scaling only if the domain is heterogeneous.

All methods concerning 2D domain, set the value zmin to 0 and the value zmax to 1. By default xmin = ymin = zmin = 0, xmax = ymax = zmax = 1 and the type of transformation is SCALE_X_FIXED.

Data given by the user to define the coordinates of the domain (xmin, ymin,
zmin, xmax,...) can be interpreted if the user wants to. The interpretation of these data depends on the value of the last attribute (of type BoundingBoxType) of each method for setting domain coordinates. Values for this attribute can be :

  • AS_IS: Data are not interpreted. This is the default value.
  • MIN_BOUNDING_CUBE: The miminum bounding square(2D domain)/cube(3D domain) is computed from the user data to set the domain coordinates.
  • MAX_BOUNDED_CUBE: The maximum bounded square(2D domain)/cube(3D domain) is computed from the user data to set the domain coordinates.

Definition at line 92 of file PbDomain.h.

Member Enumeration Documentation

◆ BoundingBoxType

Bounding box interpretation.

Enumerator
AS_IS 
MIN_BOUNDING_CUBE 
MAX_BOUNDED_CUBE 

Definition at line 115 of file PbDomain.h.

◆ TransformType

Transform type.

Enumerator
TRANSFORM_01 
SCALE_X_FIXED 
SCALE_Y_FIXED 
SCALE_Z_FIXED 
SCALE_MAX_XYZ_FIXED 

Definition at line 102 of file PbDomain.h.

Constructor & Destructor Documentation

◆ PbDomain() [1/6]

PbDomain::PbDomain ( )

Default constructor.

◆ PbDomain() [2/6]

PbDomain::PbDomain ( const PbDomain domain)

Copy constructor.

◆ PbDomain() [3/6]

PbDomain::PbDomain ( SbBox2f box,
BoundingBoxType  type = AS_IS 
)

Constructor of a 2D domain.

◆ PbDomain() [4/6]

PbDomain::PbDomain ( SbBox3f box,
BoundingBoxType  type = AS_IS 
)

Constructor of a 3D domain.

◆ PbDomain() [5/6]

PbDomain::PbDomain ( float  xmin,
float  ymin,
float  xmax,
float  ymax,
BoundingBoxType  type = AS_IS 
)

Constructor of a 2D domain.

◆ PbDomain() [6/6]

PbDomain::PbDomain ( float  xmin,
float  ymin,
float  zmin,
float  xmax,
float  ymax,
float  zmax,
BoundingBoxType  type = AS_IS 
)

Constructor of a 3D domain.

Member Function Documentation

◆ getDomain() [1/4]

void PbDomain::getDomain ( float &  xmin,
float &  ymin,
float &  xmax,
float &  ymax 
) const

Gets the 2D domain.

◆ getDomain() [2/4]

void PbDomain::getDomain ( float &  xmin,
float &  ymin,
float &  zmin,
float &  xmax,
float &  ymax,
float &  zmax 
) const

Gets the 3D domain.

◆ getDomain() [3/4]

void PbDomain::getDomain ( SbBox2f box) const

Gets the 2D domain.

◆ getDomain() [4/4]

void PbDomain::getDomain ( SbBox3f box) const

Gets the 3D domain.

◆ getMatrix()

SbMatrix PbDomain::getMatrix ( ) const

Get the domain transform matrix in an SbMatrix object.

◆ getMatrixTransform()

SoMatrixTransform * PbDomain::getMatrixTransform ( ) const

Get the domain transform matrix in an SoMatrixTransform object.

◆ getTransform()

SoTransform * PbDomain::getTransform ( ) const

Get the domain transform matrix in an SoTransform object.

◆ getTransformType()

TransformType PbDomain::getTransformType ( ) const
inline

Gets the type of transformation.

Definition at line 205 of file PbDomain.h.

◆ operator!=()

int PbDomain::operator!= ( const PbDomain dom)
inline

Inequality comparison operator.

Definition at line 231 of file PbDomain.h.

◆ operator=()

PbDomain & PbDomain::operator= ( const PbDomain domain)

Assignment operator.

◆ operator==()

int PbDomain::operator== ( const PbDomain dom)

Equality comparison operator.

◆ setDomain() [1/4]

void PbDomain::setDomain ( float  xmin,
float  ymin,
float  xmax,
float  ymax,
BoundingBoxType  type = AS_IS 
)

Sets a 2D domain.

◆ setDomain() [2/4]

void PbDomain::setDomain ( float  xmin,
float  ymin,
float  zmin,
float  xmax,
float  ymax,
float  zmax,
BoundingBoxType  type = AS_IS 
)

Sets a 3D domain.

◆ setDomain() [3/4]

void PbDomain::setDomain ( SbBox2f box,
BoundingBoxType  type = AS_IS 
)

Sets a 2D domain.

◆ setDomain() [4/4]

void PbDomain::setDomain ( SbBox3f box,
BoundingBoxType  type = AS_IS 
)

Sets a 3D domain.

◆ setTransformType()

void PbDomain::setTransformType ( TransformType  type)

Sets the type of transformation.

(SCALE_X_FIXED by default)


The documentation for this class was generated from the following file: