Hide menu
Loading...
Searching...
No Matches
cadex::Measurements::BoundingBox Class Reference

Computes bounding boxes of objects. More...

Static Public Member Functions

static void Compute (const ModelData::Model &theModel, ModelData::Box &theBox)
 Computes an axis-aligned bounding box (AABB) of the model.
 
static void Compute (const ModelData::ModelElement &theElement, ModelData::Box &theBox)
 Computes an axis-aligned bounding box (AABB) of the model element.
 
static void Compute (const ModelData::Body &theBody, ModelData::Box &theBox)
 Computes an axis-aligned bounding box (AABB) of the body.
 
static void Compute (const ModelData::Shape &theShape, const Geom::Transformation &theTransformation, ModelData::Box &theBox)
 Computes an axis-aligned bounding box (AABB) of the transformed shape.
 
static void Compute (const ModelData::MeshShape &theMeshShape, ModelData::Box &theBox, Geom::Transformation &theOutTransformation)
 Computes an axis-aligned bounding box (AABB) of the mesh shape.
 
static void ComputeMin (const ModelData::Shape &theShape, ModelData::Box &theBox, Geom::Transformation &theOutTransformation)
 Computes an oriented bounding box (OBB) of the shape.
 
static void ComputeMin (const ModelData::Shape &theShape, const Geom::Transformation &theTransformation, ModelData::Box &theBox, Geom::Transformation &theOutTransformation)
 Computes an oriented bounding box (OBB) of the transformed shape.
 
static void ComputeOptimal (const ModelData::Model &theModel, ModelData::Box &theBox, Geom::Transformation &theOutTransformation)
 Computes an optimal oriented bounding box (OBB) of the model.
 
static void ComputeOptimal (const ModelData::Part &thePart, ModelData::Box &theBox, Geom::Transformation &theOutTransformation)
 Computes an optimal oriented bounding box (OBB) of the part.
 
static void ComputeOptimal (const ModelData::Body &theBody, ModelData::Box &theBox, Geom::Transformation &theOutTransformation)
 Computes an optimal oriented bounding box (OBB) of the body.
 
static void ComputeOptimal (const ModelData::Shape &theShape, ModelData::Box &theBox, Geom::Transformation &theOutTransformation)
 Computes an optimal oriented bounding box (OBB) of the shape.
 
static void ComputeOptimal (const ModelData::MeshShape &theMeshShape, ModelData::Box &theBox, Geom::Transformation &theOutTransformation)
 Computes an optimal oriented bounding box (OBB) of the mesh shape.
 

Detailed Description

Computes bounding boxes of objects.

Bounding box can be computed for the following types of objects:

A bounding box of a model is accumulation of bounding boxes of its roots.

A bounding box of an assembly is a cumulative bounding box of its children taking into account their transformation matrices.

A part's bounding box is accumulation of bounding boxes of available part's representations.

Member Function Documentation

◆ Compute() [1/5]

void cadex::Measurements::BoundingBox::Compute ( const ModelData::Body & theBody,
ModelData::Box & theBox )
static

Computes an axis-aligned bounding box (AABB) of the body.

◆ Compute() [2/5]

void cadex::Measurements::BoundingBox::Compute ( const ModelData::MeshShape & theMeshShape,
ModelData::Box & theBox,
Geom::Transformation & theOutTransformation )
static

Computes an axis-aligned bounding box (AABB) of the mesh shape.

◆ Compute() [3/5]

void cadex::Measurements::BoundingBox::Compute ( const ModelData::Model & theModel,
ModelData::Box & theBox )
static

Computes an axis-aligned bounding box (AABB) of the model.

◆ Compute() [4/5]

void cadex::Measurements::BoundingBox::Compute ( const ModelData::ModelElement & theElement,
ModelData::Box & theBox )
static

Computes an axis-aligned bounding box (AABB) of the model element.

◆ Compute() [5/5]

void cadex::Measurements::BoundingBox::Compute ( const ModelData::Shape & theShape,
const Geom::Transformation & theTransformation,
ModelData::Box & theBox )
static

Computes an axis-aligned bounding box (AABB) of the transformed shape.

◆ ComputeMin() [1/2]

void cadex::Measurements::BoundingBox::ComputeMin ( const ModelData::Shape & theShape,
const Geom::Transformation & theTransformation,
ModelData::Box & theBox,
Geom::Transformation & theOutTransformation )
static

Computes an oriented bounding box (OBB) of the transformed shape.

theTransformation is the input transformation applied to the shape before computing the bounding box.

theOutTransformation specifies the translation and rotation needed to place the input object inside the returned axis-aligned box.

Note
This API is currently in feature preview state and may change.

◆ ComputeMin() [2/2]

void cadex::Measurements::BoundingBox::ComputeMin ( const ModelData::Shape & theShape,
ModelData::Box & theBox,
Geom::Transformation & theOutTransformation )
static

Computes an oriented bounding box (OBB) of the shape.

The method estimates the box orientation from the principal axes of inertia. Since ModelData::Box stores an axis-aligned bounding box (AABB), the computed orientation is returned as theOutTransformation.

theOutTransformation specifies the translation and rotation needed to place the input object inside the returned axis-aligned box.

Note
This API is currently in feature preview state and may change.

◆ ComputeOptimal() [1/5]

void cadex::Measurements::BoundingBox::ComputeOptimal ( const ModelData::Body & theBody,
ModelData::Box & theBox,
Geom::Transformation & theOutTransformation )
static

Computes an optimal oriented bounding box (OBB) of the body.

The method attemps to determinate the box orientation from the planar faces and linear edges, and falls back to ComputeMin() if no suitable orientation is found.

theOutTransformation specifies the translation and rotation needed to place the input object inside the returned axis-aligned box.

◆ ComputeOptimal() [2/5]

void cadex::Measurements::BoundingBox::ComputeOptimal ( const ModelData::MeshShape & theMeshShape,
ModelData::Box & theBox,
Geom::Transformation & theOutTransformation )
static

Computes an optimal oriented bounding box (OBB) of the mesh shape.

Note
For mesh shapes, this method curently returns an axis-aligned bounding box (AABB), and theOutTransformation is the identity transformation.

◆ ComputeOptimal() [3/5]

void cadex::Measurements::BoundingBox::ComputeOptimal ( const ModelData::Model & theModel,
ModelData::Box & theBox,
Geom::Transformation & theOutTransformation )
static

Computes an optimal oriented bounding box (OBB) of the model.

The method attemps to determinate the box orientation from the planar faces and linear edges, and falls back to ComputeMin() if no suitable orientation is found.

theOutTransformation specifies the translation and rotation needed to place the input object inside the returned axis-aligned box.

◆ ComputeOptimal() [4/5]

void cadex::Measurements::BoundingBox::ComputeOptimal ( const ModelData::Part & thePart,
ModelData::Box & theBox,
Geom::Transformation & theOutTransformation )
static

Computes an optimal oriented bounding box (OBB) of the part.

The method attemps to determinate the box orientation from the planar faces and linear edges, and falls back to ComputeMin() if no suitable orientation is found.

theOutTransformation specifies the translation and rotation needed to place the input object inside the returned axis-aligned box.

◆ ComputeOptimal() [5/5]

void cadex::Measurements::BoundingBox::ComputeOptimal ( const ModelData::Shape & theShape,
ModelData::Box & theBox,
Geom::Transformation & theOutTransformation )
static

Computes an optimal oriented bounding box (OBB) of the shape.

The method attemps to determinate the box orientation from the planar faces and linear edges of the shape, and falls back to ComputeMin() if no suitable orientation is found.

theOutTransformation specifies the translation and rotation needed to place the input object inside the returned axis-aligned box.