Abstract Interface class for Elementary Shape Representation. More...

#include <BasicShapes.hpp>

Inheritance diagram for mimmo::BasicShape:

Public Member Functions

 BasicShape ()
 
virtual ~BasicShape ()
 
livector1D excludeCloudPoints (bitpit::PatchKernel *)
 
livector1D excludeCloudPoints (const dvecarr3E &)
 
livector1D excludeCloudPoints (MimmoSharedPointer< MimmoObject >)
 
livector1D excludeGeometry (bitpit::PatchKernel *)
 
livector1D excludeGeometry (MimmoSharedPointer< MimmoObject >)
 
CoordType getCoordinateType (int dir)
 
darray3E getInfLimits ()
 
virtual darray3E getLocalOrigin ()=0
 
darray3E getLocalSpan ()
 
darray3E getOrigin ()
 
dmatrix33E getRefSystem ()
 
darray3E getScaling ()
 
ShapeType getShapeType ()
 
ShapeType getShapeType () const
 
darray3E getSpan ()
 
livector1D includeCloudPoints (bitpit::PatchKernel *)
 
livector1D includeCloudPoints (const dvecarr3E &)
 
livector1D includeCloudPoints (MimmoSharedPointer< MimmoObject >)
 
livector1D includeGeometry (bitpit::PatchKernel *)
 
livector1D includeGeometry (MimmoSharedPointer< MimmoObject >)
 
virtual bool intersectShapeAABBox (const darray3E &bMin, const darray3E &bMax)=0
 
bool isPointIncluded (bitpit::PatchKernel *, const long int &indexV)
 
bool isPointIncluded (const darray3E &)
 
bool isSimplexIncluded (bitpit::PatchKernel *, const long int &indexT)
 
bool isSimplexIncluded (const dvecarr3E &)
 
void setCoordinateType (CoordType, int dir)
 
void setInfLimits (darray3E val)
 
void setInfLimits (double val, int dir)
 
void setOrigin (darray3E)
 
void setRefSystem (darray3E, darray3E, darray3E)
 
void setRefSystem (dmatrix33E axes)
 
void setRefSystem (int, darray3E)
 
void setSpan (darray3E)
 
void setSpan (double, double, double)
 
virtual darray3E toLocalCoord (const darray3E &point)=0
 
virtual darray3E toWorldCoord (const darray3E &point)=0
 

Protected Member Functions

darray3E checkNearestPointToAABBox (const darray3E &point, const darray3E &bMin, const darray3E &bMax)
 
uint32_t intersectShapePlane (int level, const darray3E &target)
 
void swap (BasicShape &) noexcept
 

Static Protected Member Functions

static dmatrix33E inverse (const dmatrix33E &mat)
 
static darray3E matmul (const darray3E &vec, const dmatrix33E &mat)
 
static darray3E matmul (const dmatrix33E &mat, const darray3E &vec)
 
static dmatrix33E transpose (const dmatrix33E &mat)
 

Protected Attributes

dvecarr3E m_bbox
 
darray3E m_infLimits
 
darray3E m_origin
 
darray3E m_scaling
 
dmatrix33E m_sdr
 
dmatrix33E m_sdr_inverse
 
ShapeType m_shape
 
darray3E m_span
 
std::array< CoordType, 3 > m_typeCoord
 

Detailed Description

Abstract Interface class for Elementary Shape Representation.

Interface class for Volumetric Core Element, suitable for interaction with Data Structure stored in a MimmoObject class. Object orientation in 3D space can be externally manipulated with dedicated transformation blocks. Class internally implements transformation to/from local sdr to/from world sdr, that can be used in derived objects from it.

Class works with three reference systems:

  • Global Absolute SDR: is the external World reference system
  • Local Relative SDR: is the local reference system, not affected by Rigid Transformations as RotoTranslations or Scalings
  • basic SDR: local system remapping to unitary cube, not accounting of the shape type.

Definition at line 91 of file BasicShapes.hpp.

Constructor & Destructor Documentation

◆ BasicShape()

mimmo::BasicShape::BasicShape ( )

Basic Constructor

Definition at line 91 of file BasicShapes.cpp.

◆ ~BasicShape()

mimmo::BasicShape::~BasicShape ( )
virtual

Basic Destructor

Definition at line 105 of file BasicShapes.cpp.

Member Function Documentation

◆ checkNearestPointToAABBox()

darray3E mimmo::BasicShape::checkNearestPointToAABBox ( const darray3E point,
const darray3E bMin,
const darray3E bMax 
)
protected
Returns
the nearest point belonging to an Axis Aligned Bounding Box, given a target vertex. If the target is internal to or on surface of the AABB, return the target itself.
Parameters
[in]pointtarget vertex
[in]bMininferior extremal point of the AABB
[in]bMaxsuperior extremal point of the AABB

Definition at line 666 of file BasicShapes.cpp.

◆ excludeCloudPoints() [1/3]

livector1D mimmo::BasicShape::excludeCloudPoints ( bitpit::PatchKernel *  tri)

Given a bitpit class bitpit::PatchKernel point cloud, return identifiers of those points outside the volume of the BasicShape object.The method force a one-by-one vertex search.

Parameters
[in]tripointer to bitpit::PatchKernel object retaining the cloud point
Returns
list-by-ids of vertices outside the volumetric patch

Definition at line 525 of file BasicShapes.cpp.

◆ excludeCloudPoints() [2/3]

livector1D mimmo::BasicShape::excludeCloudPoints ( const dvecarr3E list)

Given a list of vertices of a point cloud, return indices of those vertices outside the volume of BasicShape object

Parameters
[in]listlist of cloud points
Returns
list-by-indices of vertices outside the volumetric patch

Definition at line 479 of file BasicShapes.cpp.

◆ excludeCloudPoints() [3/3]

livector1D mimmo::BasicShape::excludeCloudPoints ( MimmoSharedPointer< MimmoObject geo)

Given a geometry by MimmoObject class, return vertex identifiers of those vertices outside the volume of the BasicShape object. The methods implicitly use search algorithms based on the bitpit::KdTree of the class MimmoObject.

Parameters
[in]geotarget geometry
Returns
list-by-ids of vertices outside the volumetric patch

Definition at line 572 of file BasicShapes.cpp.

◆ excludeGeometry() [1/2]

livector1D mimmo::BasicShape::excludeGeometry ( bitpit::PatchKernel *  tri)

Given a bitpit class bitpit::PatchKernel tessellation, return cell identifiers of those simplex outside the volume of the BasicShape object.The method searches simplex one-by-one on the whole tesselation.

Parameters
[in]tritarget tesselation
Returns
list-by-ids of simplicies outside the volumetric patch

Definition at line 432 of file BasicShapes.cpp.

◆ excludeGeometry() [2/2]

livector1D mimmo::BasicShape::excludeGeometry ( MimmoSharedPointer< MimmoObject geo)

Given a geometry by MimmoObject class, return cell identifiers of those simplex outside the volume of the BasicShape object. The methods implicitly use search algorithms based on the SkdTree of the class MimmoObject. Ghost elements are considered.

Parameters
[in]geotarget tesselation
Returns
list-by-ids of simplicies outside the volumetric patch

Definition at line 376 of file BasicShapes.cpp.

◆ getCoordinateType()

CoordType mimmo::BasicShape::getCoordinateType ( int  dir)
Returns
type of your current shape coordinate "dir". See CoordType enum
Parameters
[in]dir0,1,2 int flag identifying coordinate

Definition at line 317 of file BasicShapes.cpp.

◆ getInfLimits()

darray3E mimmo::BasicShape::getInfLimits ( )
Returns
current inferior limits of your shape, in local coord reference system

Definition at line 302 of file BasicShapes.cpp.

◆ getLocalOrigin()

virtual darray3E mimmo::BasicShape::getLocalOrigin ( )
pure virtual

Pure virtual method to get local Coordinate inferior limits of primitive shape

Returns
local origin

Implemented in mimmo::Wedge, mimmo::Sphere, mimmo::Cylinder, and mimmo::Cube.

◆ getLocalSpan()

darray3E mimmo::BasicShape::getLocalSpan ( )
Returns
span of your elementary shape, in local coord system

Definition at line 344 of file BasicShapes.cpp.

◆ getOrigin()

darray3E mimmo::BasicShape::getOrigin ( )
Returns
current origin of your shape

Definition at line 282 of file BasicShapes.cpp.

◆ getRefSystem()

dmatrix33E mimmo::BasicShape::getRefSystem ( )
Returns
actual axis of global relative sdr

Definition at line 309 of file BasicShapes.cpp.

◆ getScaling()

darray3E mimmo::BasicShape::getScaling ( )
Returns
current scaling w.r.t the local sdr elemental shape

Definition at line 337 of file BasicShapes.cpp.

◆ getShapeType()

ShapeType mimmo::BasicShape::getShapeType ( )
Returns
current type of shape instantiated
current type of shape instantiated. Const method overloading

Definition at line 323 of file BasicShapes.cpp.

◆ getSpan()

darray3E mimmo::BasicShape::getSpan ( )
Returns
current span of your shape

Definition at line 290 of file BasicShapes.cpp.

◆ includeCloudPoints() [1/3]

livector1D mimmo::BasicShape::includeCloudPoints ( bitpit::PatchKernel *  tri)

Given a bitpit class bitpit::PatchKernel point cloud, return identifiers of those points inside the volume of the BasicShape object. The method force a one-by-one vertex search.

Parameters
[in]tripointer to bitpit::PatchKernel object retaining the cloud point
Returns
list-by-ids of vertices included in the volumetric patch

Definition at line 502 of file BasicShapes.cpp.

◆ includeCloudPoints() [2/3]

livector1D mimmo::BasicShape::includeCloudPoints ( const dvecarr3E list)

Given a list of vertices of a point cloud, return indices of those vertices included into the volume of the object. The method searches vertex one-by-one on the whole point cloud.

Parameters
[in]listlist of cloud points
Returns
list-by-indices of vertices included in the volumetric patch

Definition at line 456 of file BasicShapes.cpp.

◆ includeCloudPoints() [3/3]

livector1D mimmo::BasicShape::includeCloudPoints ( MimmoSharedPointer< MimmoObject geo)

Given a geometry by MimmoObject class, return vertex identifiers of those vertices inside the volume of the BasicShape object. The methods implicitly use search algorithms based on the bitpit::KdTree of the class MimmoObject. Ghost vertices are included.

Parameters
[in]geotarget geometry
Returns
list-by-ids of vertices included in the volumetric patch

Definition at line 551 of file BasicShapes.cpp.

◆ includeGeometry() [1/2]

livector1D mimmo::BasicShape::includeGeometry ( bitpit::PatchKernel *  tri)

Given a bitpit class bitpit::PatchKernel tessellation, return cell identifiers of those simplex inside the volume of the BasicShape object. The method searches simplex one-by-one on the whole tesselation.

Parameters
[in]tritarget tessellation
Returns
list-by-ids of simplicies included in the volumetric patch

Definition at line 408 of file BasicShapes.cpp.

◆ includeGeometry() [2/2]

livector1D mimmo::BasicShape::includeGeometry ( MimmoSharedPointer< MimmoObject geo)

Given a geometry by MimmoObject class, return cell identifiers of those simplex inside the volume of the BasicShape object. The methods implicitly use search algorithms based on the SkdTree of the class MimmoObject.

Parameters
[in]geotarget tessellation
Returns
list-by-ids of simplicies included in the volumetric patch

Definition at line 355 of file BasicShapes.cpp.

◆ intersectShapeAABBox()

virtual bool mimmo::BasicShape::intersectShapeAABBox ( const darray3E bMin,
const darray3E bMax 
)
pure virtual

Pure virtual method to get if the current shape an a given Axis Aligned Bounding Box intersects

Parameters
[in]bMinmin point of AABB
[in]bMaxmax point of AABB

Implemented in mimmo::Wedge, mimmo::Sphere, mimmo::Cylinder, and mimmo::Cube.

◆ intersectShapePlane()

uint32_t mimmo::BasicShape::intersectShapePlane ( int  level,
const darray3E target 
)
protected

Given a 3D point, Check if the Axis Aligned Bounding box of your current shape intersects a given fundamental plane, x=a, y=b, z=c passing from such point.

Return unsigned integer 0,1,2 with the following meaning:

  • 0 : no intersection , shape on the left/bottom/before the plane
  • 1 : no intersection , shape on the right/top/after the plane
  • 2 : intersection occurs
Parameters
[in]levelcurrent level of kdTree. 0-> xplane, 1-> yplane, 2->zplane, no other value are allowed.
[in]target3D point
Returns
unsigned integer flag between 0 and 2

Definition at line 798 of file BasicShapes.cpp.

◆ inverse()

dmatrix33E mimmo::BasicShape::inverse ( const dmatrix33E mat)
staticprotected

Invert a 3x3 double matrix

Parameters
[in]matinput matrix
Returns
new transposed matrix

Definition at line 829 of file BasicShapes.cpp.

◆ isPointIncluded() [1/2]

bool mimmo::BasicShape::isPointIncluded ( bitpit::PatchKernel *  tri,
const long int &  indexV 
)
Returns
true if the given point is included in the volume of the patch
Parameters
[in]tripointer to a bitpit::Patch tesselation / point cloud
[in]indexVid of a vertex belonging to tri;

Definition at line 652 of file BasicShapes.cpp.

◆ isPointIncluded() [2/2]

bool mimmo::BasicShape::isPointIncluded ( const darray3E point)
Returns
true if the given point is included in the volume of the patch
Parameters
[in]pointgiven vertex

Definition at line 634 of file BasicShapes.cpp.

◆ isSimplexIncluded() [1/2]

bool mimmo::BasicShape::isSimplexIncluded ( bitpit::PatchKernel *  tri,
const long int &  indexT 
)
Returns
true if if all vertices of a given simplex are included in the volume of the shape
Parameters
[in]tripointer to a Class_SurfTri tesselation
[in]indexTtriangle index of tri.

Definition at line 618 of file BasicShapes.cpp.

◆ isSimplexIncluded() [2/2]

bool mimmo::BasicShape::isSimplexIncluded ( const dvecarr3E simplexVert)
Returns
true if all vertices of a given simplex are included in the volume of the shape
Parameters
[in]simplexVert3 vertices of the given Triangle

Definition at line 604 of file BasicShapes.cpp.

◆ matmul() [1/2]

darray3E mimmo::BasicShape::matmul ( const darray3E vec,
const dmatrix33E mat 
)
staticprotected

Matrix M-vector V multiplication V*M (V row dot M columns).

Parameters
[in]vecvector V with 3 elements
[in]matmatrix M 3x3 square
Returns
3 element vector result of multiplication

Definition at line 856 of file BasicShapes.cpp.

◆ matmul() [2/2]

darray3E mimmo::BasicShape::matmul ( const dmatrix33E mat,
const darray3E vec 
)
staticprotected

Matrix M-vector V multiplication M*V (M rows dot V column).

Parameters
[in]vecvector V with 3 elements
[in]matmatrix M 3x3 square
Returns
3 element vector result of multiplication

Definition at line 875 of file BasicShapes.cpp.

◆ setCoordinateType()

void mimmo::BasicShape::setCoordinateType ( CoordType  type,
int  dir 
)

Set type to treat your shape coordinates.

Parameters
[in]typeCoordType enum.
[in]dir0,1,2 int flag identifying coordinate

Definition at line 275 of file BasicShapes.cpp.

◆ setInfLimits() [1/2]

void mimmo::BasicShape::setInfLimits ( darray3E  val)

Set inferior limits your shape, in its local reference system. The method is useful when drawing part of your original shape, as in the case of cylinders or sphere portions, by manipulating the adimensional curvilinear coordinate.

Parameters
[in]vallower value origin for all three coordinates

Definition at line 182 of file BasicShapes.cpp.

◆ setInfLimits() [2/2]

void mimmo::BasicShape::setInfLimits ( double  orig,
int  dir 
)

Set inferior limits of your shape, in its local reference system. The method is useful when drawing part of your original shape, as in the case of cylinders or sphere portions, by manipulating the adimensional curvilinear coordinate.

Parameters
[in]origfirst coordinate origin
[in]dir0,1,2 int flag identifying coordinate
Examples
geohandlers_example_00000.cpp.

Definition at line 163 of file BasicShapes.cpp.

◆ setOrigin()

void mimmo::BasicShape::setOrigin ( darray3E  origin)

Set origin of your shape. The origin is meant as the baricenter of your shape in absolute reference system.

Parameters
[in]originnew origin point
Examples
geohandlers_example_00000.cpp, geohandlers_example_00001.cpp, and iocgns_example_00001.cpp.

Definition at line 130 of file BasicShapes.cpp.

◆ setRefSystem() [1/3]

void mimmo::BasicShape::setRefSystem ( darray3E  axis0,
darray3E  axis1,
darray3E  axis2 
)

Set new axis orientation of the local reference system

Parameters
[in]axis0first axis
[in]axis1second axis
[in]axis2third axis

if chosen axes are not orthogonal, doing nothing

Examples
geohandlers_example_00000.cpp.

Definition at line 196 of file BasicShapes.cpp.

◆ setRefSystem() [2/3]

void mimmo::BasicShape::setRefSystem ( dmatrix33E  axes)

Set new axes orientation of the local reference system

Parameters
[in]axesnew direction of local axes.

Definition at line 266 of file BasicShapes.cpp.

◆ setRefSystem() [3/3]

void mimmo::BasicShape::setRefSystem ( int  label,
darray3E  axis 
)

Set new axis orientation of the local reference system

Parameters
[in]label0,1,2 identify local x,y,z axis of the primitive shape
[in]axisnew direction of selected local axis.

Definition at line 232 of file BasicShapes.cpp.

◆ setSpan() [1/2]

void mimmo::BasicShape::setSpan ( darray3E  span)

Set span of your shape, according to its local reference system

Parameters
[in]spancoordinate span

Definition at line 149 of file BasicShapes.cpp.

◆ setSpan() [2/2]

void mimmo::BasicShape::setSpan ( double  s0,
double  s1,
double  s2 
)

Set span of your shape, according to its local reference system

Parameters
[in]s0first coordinate span
[in]s1second coordinate span
[in]s2third coordinate span
Examples
geohandlers_example_00000.cpp, geohandlers_example_00001.cpp, and iocgns_example_00001.cpp.

Definition at line 140 of file BasicShapes.cpp.

◆ swap()

void mimmo::BasicShape::swap ( BasicShape x)
protectednoexcept

Swap method, assign data of the current class to an external one of the same type and vice-versa

Parameters
[in]xBasicShape object to be swapped;

Definition at line 113 of file BasicShapes.cpp.

◆ toLocalCoord()

virtual darray3E mimmo::BasicShape::toLocalCoord ( const darray3E point)
pure virtual

Pure virtual method to convert from World to Local Coordinates

Parameters
[in]point3D point in world global coordinates
Returns
point in local world coordinate

Implemented in mimmo::Wedge, mimmo::Sphere, mimmo::Cylinder, and mimmo::Cube.

◆ toWorldCoord()

virtual darray3E mimmo::BasicShape::toWorldCoord ( const darray3E point)
pure virtual

Pure virtual method to convert from Local to World Coordinates

Parameters
[in]point3D point in local shape coordinates
Returns
point in world global coordinate

Implemented in mimmo::Wedge, mimmo::Sphere, mimmo::Cylinder, and mimmo::Cube.

◆ transpose()

dmatrix33E mimmo::BasicShape::transpose ( const dmatrix33E mat)
staticprotected

Transpose a 3x3 double matrix

Parameters
[in]matinput matrix
Returns
new transposed matrix

Definition at line 812 of file BasicShapes.cpp.

Member Data Documentation

◆ m_bbox

dvecarr3E mimmo::BasicShape::m_bbox
protected

points of bounding box of the shape

Definition at line 104 of file BasicShapes.hpp.

◆ m_infLimits

darray3E mimmo::BasicShape::m_infLimits
protected

inferior limits of coordinate of your current shape

Definition at line 97 of file BasicShapes.hpp.

◆ m_origin

darray3E mimmo::BasicShape::m_origin
protected

origin of your shape. May change according to the shape type

Definition at line 95 of file BasicShapes.hpp.

◆ m_scaling

darray3E mimmo::BasicShape::m_scaling
protected

scaling vector of dimensional coordinates

Definition at line 100 of file BasicShapes.hpp.

◆ m_sdr

dmatrix33E mimmo::BasicShape::m_sdr
protected

axis position of the local reference system w.r.t absolute one

Definition at line 98 of file BasicShapes.hpp.

◆ m_sdr_inverse

dmatrix33E mimmo::BasicShape::m_sdr_inverse
protected

inverse rotating sdr

Definition at line 99 of file BasicShapes.hpp.

◆ m_shape

ShapeType mimmo::BasicShape::m_shape
protected

shape identifier, see BasicShape::ShapeType enum

Definition at line 94 of file BasicShapes.hpp.

◆ m_span

darray3E mimmo::BasicShape::m_span
protected

coordinate span of your current shape, in its local reference system

Definition at line 96 of file BasicShapes.hpp.

◆ m_typeCoord

std::array<CoordType,3> mimmo::BasicShape::m_typeCoord
protected

identifiers for coordinate type definition.DEFAULT is clamped

Definition at line 102 of file BasicShapes.hpp.


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