ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
cloudViewer::CCMiscTools Class Reference

Miscellaneous useful functions (geometrical elements handling) More...

#include <CVMiscTools.h>

Inheritance diagram for cloudViewer::CCMiscTools:
Collaboration diagram for cloudViewer::CCMiscTools:

Static Public Member Functions

static void EnlargeBox (CCVector3 &dimMin, CCVector3 &dimMax, double coef)
 Proportionally enlarges a 3D box. More...
 
static void MakeMinAndMaxCubical (CCVector3 &dimMin, CCVector3 &dimMax, double enlargeFactor=0.01)
 Transforms a 3D box into a 3D cube. More...
 
static void ComputeBaseVectors (const CCVector3 &N, CCVector3 &X, CCVector3 &Y)
 Computes base vectors for a given 3D plane. More...
 
static void ComputeBaseVectors (const CCVector3d &N, CCVector3d &X, CCVector3d &Y)
 Computes base vectors for a given 3D plane - double version. More...
 
static bool TriBoxOverlap (const CCVector3 &boxcenter, const CCVector3 &boxhalfsize, const CCVector3 *triverts[3])
 Ovelap test between a 3D box and a triangle. More...
 
static bool TriBoxOverlapd (const CCVector3d &boxcenter, const CCVector3d &boxhalfsize, const CCVector3d triverts[3])
 Ovelap test between a 3D box and a triangle (double version) More...
 

Detailed Description

Miscellaneous useful functions (geometrical elements handling)

Definition at line 16 of file CVMiscTools.h.

Member Function Documentation

◆ ComputeBaseVectors() [1/2]

void CCMiscTools::ComputeBaseVectors ( const CCVector3 N,
CCVector3 X,
CCVector3 Y 
)
static

Computes base vectors for a given 3D plane.

Determines at least two orthogonal vectors perpendicular to a third one

Parameters
[in]Na non null vector
[out]Xthe first vector (a 3 coordinates array to be updated by the algorithm)
[out]Ythe second vector (a 3 coordinates array to be updated by the algorithm)

Definition at line 370 of file CVMiscTools.cpp.

References Vector3Tpl< Type >::cross(), Vector3Tpl< Type >::normalize(), Vector3Tpl< Type >::orthogonal(), and X.

Referenced by ccDBRoot::alignCameraWithEntity(), define_CCMiscTools(), and cloudViewer::Neighbourhood::projectPointsOn2DPlane().

◆ ComputeBaseVectors() [2/2]

void CCMiscTools::ComputeBaseVectors ( const CCVector3d N,
CCVector3d X,
CCVector3d Y 
)
static

Computes base vectors for a given 3D plane - double version.

Determines at least two orthogonal vectors perpendicular to a third one

Parameters
[in]Na non null vector
[out]Xthe first vector (a 3 coordinates array to be updated by the algorithm)
[out]Ythe second vector (a 3 coordinates array to be updated by the algorithm)

Definition at line 384 of file CVMiscTools.cpp.

References Vector3Tpl< Type >::cross(), Vector3Tpl< Type >::normalize(), Vector3Tpl< Type >::orthogonal(), and X.

◆ EnlargeBox()

void CCMiscTools::EnlargeBox ( CCVector3 dimMin,
CCVector3 dimMax,
double  coef 
)
static

Proportionally enlarges a 3D box.

Parameters
dimMinthe upper-left corner of the box
dimMaxthe lower-right corner of the box
coefthe enlargement coefficient (1.1 <-> +10%)

Definition at line 114 of file CVMiscTools.cpp.

Referenced by define_CCMiscTools().

◆ MakeMinAndMaxCubical()

void CCMiscTools::MakeMinAndMaxCubical ( CCVector3 dimMin,
CCVector3 dimMax,
double  enlargeFactor = 0.01 
)
static

Transforms a 3D box into a 3D cube.

The cube dimensions will be equal to the largest box dimension.

Parameters
dimMinthe upper-left corner of the rectangle
dimMaxthe lower-right corner of the rectangle
enlargeFactorthe resulting box can be automatically enlarged if this parameter is greater than 0

Definition at line 88 of file CVMiscTools.cpp.

References max(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.

Referenced by cloudViewer::DistanceComputationTools::computeCloud2MeshDistances(), define_CCMiscTools(), cloudViewer::DistanceComputationTools::synchronizeOctrees(), and cloudViewer::DgmOctree::updateMinAndMaxTables().

◆ TriBoxOverlap()

bool CCMiscTools::TriBoxOverlap ( const CCVector3 boxcenter,
const CCVector3 boxhalfsize,
const CCVector3 triverts[3] 
)
static

Ovelap test between a 3D box and a triangle.

Parameters
boxcenterthe box center
boxhalfsizethe box half dimensions
trivertsthe 3 triangle vertices
Returns
true if the input box and triangle overlap, false otherwise

Definition at line 127 of file CVMiscTools.cpp.

References abs(), AXISTEST_X01, AXISTEST_X2, AXISTEST_Y02, AXISTEST_Y1, AXISTEST_Z0, AXISTEST_Z12, FINDMINMAX, Tuple3Tpl< Type >::u, Vector3Tpl< PointCoordinateType >::vcross(), Vector3Tpl< PointCoordinateType >::vdot(), Vector3Tpl< PointCoordinateType >::vsubstract(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.

Referenced by qVoxFallProcess::Compute(), define_CCMiscTools(), cloudViewer::DistanceComputationTools::intersectMeshWithOctree(), and cloudViewer::Grid3D< Type >::intersectWith().

◆ TriBoxOverlapd()

bool CCMiscTools::TriBoxOverlapd ( const CCVector3d boxcenter,
const CCVector3d boxhalfsize,
const CCVector3d  triverts[3] 
)
static

Ovelap test between a 3D box and a triangle (double version)

Parameters
boxcenterthe box center
boxhalfsizethe box half dimensions
trivertsthe 3 triangle vertices
Returns
true if the input box and triangle overlap, false otherwise

Definition at line 249 of file CVMiscTools.cpp.

References abs(), AXISTEST_X01, AXISTEST_X2, AXISTEST_Y02, AXISTEST_Y1, AXISTEST_Z0, AXISTEST_Z12, FINDMINMAX, Tuple3Tpl< Type >::u, Vector3Tpl< double >::vcross(), Vector3Tpl< double >::vdot(), Vector3Tpl< double >::vsubstract(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.

Referenced by define_CCMiscTools(), and cloudViewer::ManualSegmentationTools::segmentMeshWithAABox().


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