SOFA API  014b24ea
Open source framework for multi-physics simuation
sofa::component::engine::boxroi::BoxROI< DataTypes > Class Template Reference

#include <BoxROI.h>

Inheritance diagram for sofa::component::engine::boxroi::BoxROI< DataTypes >:

Detailed Description

template<class DataTypes>
class sofa::component::engine::boxroi::BoxROI< DataTypes >

This class find all the points/edges/triangles/quads/tetrahedras/hexahedras located inside given boxes.

Classes

struct  OrientedBox
 

Public Attributes

Data< vector< Vec6 > > d_alignedBoxes
 each box is defined using xmin, ymin, zmin, xmax, ymax, zmax More...
 
Data< vector< Vec10 > > d_orientedBoxes
 
Data< VecCoordd_X0
 
Data< vector< Edge > > d_edges
 Edge Topology. More...
 
Data< vector< Triangle > > d_triangles
 Triangle Topology. More...
 
Data< vector< Tetra > > d_tetrahedra
 Tetrahedron Topology. More...
 
Data< vector< Hexa > > d_hexahedra
 Hexahedron Topology. More...
 
Data< vector< Quad > > d_quad
 Quad Topology. More...
 
Data< boold_computeEdges
 If true, will compute edge list and index list inside the ROI. (default = true) More...
 
Data< boold_computeTriangles
 If true, will compute triangle list and index list inside the ROI. (default = true) More...
 
Data< boold_computeTetrahedra
 If true, will compute tetrahedra list and index list inside the ROI. (default = true) More...
 
Data< boold_computeHexahedra
 If true, will compute hexahedra list and index list inside the ROI. (default = true) More...
 
Data< boold_computeQuad
 If true, will compute quad list and index list inside the ROI. (default = true) More...
 
Data< boold_strict
 If true, an element is inside the box if all of its nodes are inside. If False, only the center point of the element is checked. (default = true) More...
 
Data< SetIndexd_indices
 Indices of the points contained in the ROI. More...
 
Data< SetIndexd_edgeIndices
 Indices of the edges contained in the ROI. More...
 
Data< SetIndexd_triangleIndices
 Indices of the triangles contained in the ROI. More...
 
Data< SetIndexd_tetrahedronIndices
 Indices of the tetrahedra contained in the ROI. More...
 
Data< SetIndexd_hexahedronIndices
 Indices of the hexahedra contained in the ROI. More...
 
Data< SetIndexd_quadIndices
 Indices of the quad contained in the ROI. More...
 
Data< VecCoordd_pointsInROI
 Points contained in the ROI. More...
 
Data< vector< Edge > > d_edgesInROI
 Edges contained in the ROI. More...
 
Data< vector< Triangle > > d_trianglesInROI
 Triangles contained in the ROI. More...
 
Data< vector< Tetra > > d_tetrahedraInROI
 Tetrahedra contained in the ROI. More...
 
Data< vector< Hexa > > d_hexahedraInROI
 Hexahedra contained in the ROI. More...
 
Data< vector< Quad > > d_quadInROI
 Quad contained in the ROI. More...
 
Data< unsigned intd_nbIndices
 Number of selected indices. More...
 
Data< boold_drawBoxes
 Draw Boxes. (default = false) More...
 
Data< boold_drawPoints
 Draw Points. (default = false) More...
 
Data< boold_drawEdges
 Draw Edges. (default = false) More...
 
Data< boold_drawTriangles
 Draw Triangles. (default = false) More...
 
Data< boold_drawTetrahedra
 Draw Tetrahedra. (default = false) More...
 
Data< boold_drawHexahedra
 Draw Tetrahedra. (default = false) More...
 
Data< boold_drawQuads
 Draw Quads. (default = false) More...
 
Data< doubled_drawSize
 rendering size for box and topological elements More...
 
Data< boold_doUpdate
 If true, updates the selection at the beginning of simulation steps. (default = true) More...
 

Protected Attributes

vector< OrientedBoxm_orientedBoxes
 

Public Member Functions

 SOFA_CLASS (SOFA_TEMPLATE(BoxROI, DataTypes), DataEngine)
 
void parse (sofa::core::objectmodel::BaseObjectDescription *arg) override
 
void init () override
 
void reinit () override
 
void doUpdate () override
 
void draw (const VisualParams *) override
 
void computeBBox (const ExecParams *params, bool onlyVisible=false) override
 
void handleEvent (Event *event) override
 

Static Public Member Functions

template<class T >
static bool canCreate (T *&obj, BaseContext *context, BaseObjectDescription *arg)
 
template<class T >
static T::SPtr create (T *tObj, BaseContext *context, BaseObjectDescription *arg)
 Construction method called by ObjectFactory. More...
 

Protected Member Functions

 BoxROI ()
 
 ~BoxROI () override
 
void computeOrientedBoxes ()
 
bool isPointInOrientedBox (const CPos &p, const OrientedBox &box)
 
bool isPointInAlignedBox (const typename DataTypes::CPos &p, const Vec6 &box)
 
bool isPointInBoxes (const CPos &p)
 
bool isPointInBoxes (const PointID &pid)
 
bool isEdgeInBoxes (const Edge &e)
 
bool isEdgeInBoxesStrict (const Edge &e)
 
bool isTriangleInBoxes (const Triangle &t)
 
bool isTriangleInBoxesStrict (const Triangle &t)
 
bool isTetrahedronInBoxes (const Tetra &t)
 
bool isTetrahedronInBoxesStrict (const Tetra &t)
 
bool isHexahedronInBoxes (const Hexa &t)
 
bool isHexahedronInBoxesStrict (const Hexa &t)
 
bool isQuadInBoxes (const Quad &q)
 
bool isQuadInBoxesStrict (const Quad &q)
 
void getPointsFromOrientedBox (const Vec10 &box, vector< Vec3 > &points)
 

Attribute details

template<class DataTypes >
Data<vector<Vec6> > sofa::component::engine::boxroi::BoxROI< DataTypes >::d_alignedBoxes

each box is defined using xmin, ymin, zmin, xmax, ymax, zmax

template<class DataTypes >
Data<bool> sofa::component::engine::boxroi::BoxROI< DataTypes >::d_computeEdges

If true, will compute edge list and index list inside the ROI. (default = true)

template<class DataTypes >
Data<bool> sofa::component::engine::boxroi::BoxROI< DataTypes >::d_computeHexahedra

If true, will compute hexahedra list and index list inside the ROI. (default = true)

template<class DataTypes >
Data<bool> sofa::component::engine::boxroi::BoxROI< DataTypes >::d_computeQuad

If true, will compute quad list and index list inside the ROI. (default = true)

template<class DataTypes >
Data<bool> sofa::component::engine::boxroi::BoxROI< DataTypes >::d_computeTetrahedra

If true, will compute tetrahedra list and index list inside the ROI. (default = true)

template<class DataTypes >
Data<bool> sofa::component::engine::boxroi::BoxROI< DataTypes >::d_computeTriangles

If true, will compute triangle list and index list inside the ROI. (default = true)

template<class DataTypes >
Data<bool> sofa::component::engine::boxroi::BoxROI< DataTypes >::d_doUpdate

If true, updates the selection at the beginning of simulation steps. (default = true)

template<class DataTypes >
Data<bool> sofa::component::engine::boxroi::BoxROI< DataTypes >::d_drawBoxes

Draw Boxes. (default = false)

template<class DataTypes >
Data<bool> sofa::component::engine::boxroi::BoxROI< DataTypes >::d_drawEdges

Draw Edges. (default = false)

template<class DataTypes >
Data<bool> sofa::component::engine::boxroi::BoxROI< DataTypes >::d_drawHexahedra

Draw Tetrahedra. (default = false)

template<class DataTypes >
Data<bool> sofa::component::engine::boxroi::BoxROI< DataTypes >::d_drawPoints

Draw Points. (default = false)

template<class DataTypes >
Data<bool> sofa::component::engine::boxroi::BoxROI< DataTypes >::d_drawQuads

Draw Quads. (default = false)

template<class DataTypes >
Data<double> sofa::component::engine::boxroi::BoxROI< DataTypes >::d_drawSize

rendering size for box and topological elements

template<class DataTypes >
Data<bool> sofa::component::engine::boxroi::BoxROI< DataTypes >::d_drawTetrahedra

Draw Tetrahedra. (default = false)

template<class DataTypes >
Data<bool> sofa::component::engine::boxroi::BoxROI< DataTypes >::d_drawTriangles

Draw Triangles. (default = false)

template<class DataTypes >
Data<SetIndex> sofa::component::engine::boxroi::BoxROI< DataTypes >::d_edgeIndices

Indices of the edges contained in the ROI.

template<class DataTypes >
Data<vector<Edge> > sofa::component::engine::boxroi::BoxROI< DataTypes >::d_edges

Edge Topology.

template<class DataTypes >
Data<vector<Edge> > sofa::component::engine::boxroi::BoxROI< DataTypes >::d_edgesInROI

Edges contained in the ROI.

template<class DataTypes >
Data<vector<Hexa> > sofa::component::engine::boxroi::BoxROI< DataTypes >::d_hexahedra

Hexahedron Topology.

template<class DataTypes >
Data<vector<Hexa> > sofa::component::engine::boxroi::BoxROI< DataTypes >::d_hexahedraInROI

Hexahedra contained in the ROI.

template<class DataTypes >
Data<SetIndex> sofa::component::engine::boxroi::BoxROI< DataTypes >::d_hexahedronIndices

Indices of the hexahedra contained in the ROI.

template<class DataTypes >
Data<SetIndex> sofa::component::engine::boxroi::BoxROI< DataTypes >::d_indices

Indices of the points contained in the ROI.

template<class DataTypes >
Data< unsigned int > sofa::component::engine::boxroi::BoxROI< DataTypes >::d_nbIndices

Number of selected indices.

template<class DataTypes >
Data<vector<Vec10> > sofa::component::engine::boxroi::BoxROI< DataTypes >::d_orientedBoxes

each box is defined using three point coordinates and a depth value

template<class DataTypes >
Data<VecCoord > sofa::component::engine::boxroi::BoxROI< DataTypes >::d_pointsInROI

Points contained in the ROI.

template<class DataTypes >
Data<vector<Quad> > sofa::component::engine::boxroi::BoxROI< DataTypes >::d_quad

Quad Topology.

template<class DataTypes >
Data<SetIndex> sofa::component::engine::boxroi::BoxROI< DataTypes >::d_quadIndices

Indices of the quad contained in the ROI.

template<class DataTypes >
Data<vector<Quad> > sofa::component::engine::boxroi::BoxROI< DataTypes >::d_quadInROI

Quad contained in the ROI.

template<class DataTypes >
Data<bool> sofa::component::engine::boxroi::BoxROI< DataTypes >::d_strict

If true, an element is inside the box if all of its nodes are inside. If False, only the center point of the element is checked. (default = true)

template<class DataTypes >
Data<vector<Tetra> > sofa::component::engine::boxroi::BoxROI< DataTypes >::d_tetrahedra

Tetrahedron Topology.

template<class DataTypes >
Data<vector<Tetra> > sofa::component::engine::boxroi::BoxROI< DataTypes >::d_tetrahedraInROI

Tetrahedra contained in the ROI.

template<class DataTypes >
Data<SetIndex> sofa::component::engine::boxroi::BoxROI< DataTypes >::d_tetrahedronIndices

Indices of the tetrahedra contained in the ROI.

template<class DataTypes >
Data<SetIndex> sofa::component::engine::boxroi::BoxROI< DataTypes >::d_triangleIndices

Indices of the triangles contained in the ROI.

template<class DataTypes >
Data<vector<Triangle> > sofa::component::engine::boxroi::BoxROI< DataTypes >::d_triangles

Triangle Topology.

template<class DataTypes >
Data<vector<Triangle> > sofa::component::engine::boxroi::BoxROI< DataTypes >::d_trianglesInROI

Triangles contained in the ROI.

template<class DataTypes >
Data<VecCoord> sofa::component::engine::boxroi::BoxROI< DataTypes >::d_X0

Rest position coordinates of the degrees of freedom. If empty the positions from a MechanicalObject then a MeshLoader are searched in the current context. If none are found the parent's context is searched for MechanicalObject.

template<class DataTypes >
vector<OrientedBox> sofa::component::engine::boxroi::BoxROI< DataTypes >::m_orientedBoxes
protected

Constructor details

template<class DataTypes >
sofa::component::engine::boxroi::BoxROI< DataTypes >::BoxROI ( )
protected

In case you add a new attribute please also add it into to the BoxROI_test.cpp::attributesTests In case you want to remove or rename an attribute, please keep it as-is but add a warning message using msg_warning saying to the user of this component that the attribute is deprecated and solutions/replacement he has to fix his scene.

template<class DataTypes >
sofa::component::engine::boxroi::BoxROI< DataTypes >::~BoxROI ( )
inlineoverrideprotected

Function details

template<class DataTypes >
template<class T >
static bool sofa::component::engine::boxroi::BoxROI< DataTypes >::canCreate ( T *&  obj,
BaseContext *  context,
BaseObjectDescription *  arg 
)
inlinestatic

Pre-construction check method called by ObjectFactory. Check that DataTypes matches the MechanicalState.

template<class DataTypes >
void sofa::component::engine::boxroi::BoxROI< DataTypes >::computeBBox ( const ExecParams *  params,
bool  onlyVisible = false 
)
override
template<class DataTypes >
void sofa::component::engine::boxroi::BoxROI< DataTypes >::computeOrientedBoxes ( )
protected
template<class DataTypes >
template<class T >
static T::SPtr sofa::component::engine::boxroi::BoxROI< DataTypes >::create ( T *  tObj,
BaseContext *  context,
BaseObjectDescription *  arg 
)
inlinestatic

Construction method called by ObjectFactory.

template<class DataTypes >
void sofa::component::engine::boxroi::BoxROI< DataTypes >::doUpdate ( )
override
template<class DataTypes >
void sofa::component::engine::boxroi::BoxROI< DataTypes >::draw ( const VisualParams *  )
override
template<class DataTypes >
void sofa::component::engine::boxroi::BoxROI< DataTypes >::getPointsFromOrientedBox ( const Vec10 box,
vector< Vec3 > &  points 
)
protected
template<class DataTypes >
void sofa::component::engine::boxroi::BoxROI< DataTypes >::handleEvent ( Event *  event)
override
template<class DataTypes >
void sofa::component::engine::boxroi::BoxROI< DataTypes >::init ( )
override
template<class DataTypes >
bool sofa::component::engine::boxroi::BoxROI< DataTypes >::isEdgeInBoxes ( const Edge e)
protected
template<class DataTypes >
bool sofa::component::engine::boxroi::BoxROI< DataTypes >::isEdgeInBoxesStrict ( const Edge e)
protected
template<class DataTypes >
bool sofa::component::engine::boxroi::BoxROI< DataTypes >::isHexahedronInBoxes ( const Hexa t)
protected
template<class DataTypes >
bool sofa::component::engine::boxroi::BoxROI< DataTypes >::isHexahedronInBoxesStrict ( const Hexa t)
protected
template<class DataTypes >
bool sofa::component::engine::boxroi::BoxROI< DataTypes >::isPointInAlignedBox ( const typename DataTypes::CPos &  p,
const Vec6 box 
)
protected
template<class DataTypes >
bool sofa::component::engine::boxroi::BoxROI< DataTypes >::isPointInBoxes ( const CPos p)
protected
template<class DataTypes >
bool sofa::component::engine::boxroi::BoxROI< DataTypes >::isPointInBoxes ( const PointID pid)
protected
template<class DataTypes >
bool sofa::component::engine::boxroi::BoxROI< DataTypes >::isPointInOrientedBox ( const CPos p,
const OrientedBox box 
)
protected
template<class DataTypes >
bool sofa::component::engine::boxroi::BoxROI< DataTypes >::isQuadInBoxes ( const Quad q)
protected
template<class DataTypes >
bool sofa::component::engine::boxroi::BoxROI< DataTypes >::isQuadInBoxesStrict ( const Quad q)
protected
template<class DataTypes >
bool sofa::component::engine::boxroi::BoxROI< DataTypes >::isTetrahedronInBoxes ( const Tetra t)
protected
template<class DataTypes >
bool sofa::component::engine::boxroi::BoxROI< DataTypes >::isTetrahedronInBoxesStrict ( const Tetra t)
protected
template<class DataTypes >
bool sofa::component::engine::boxroi::BoxROI< DataTypes >::isTriangleInBoxes ( const Triangle t)
protected
template<class DataTypes >
bool sofa::component::engine::boxroi::BoxROI< DataTypes >::isTriangleInBoxesStrict ( const Triangle t)
protected
template<class DataTypes >
void sofa::component::engine::boxroi::BoxROI< DataTypes >::parse ( sofa::core::objectmodel::BaseObjectDescription arg)
override
template<class DataTypes >
void sofa::component::engine::boxroi::BoxROI< DataTypes >::reinit ( )
override
template<class DataTypes >
sofa::component::engine::boxroi::BoxROI< DataTypes >::SOFA_CLASS ( SOFA_TEMPLATE(BoxROI< DataTypes >, DataTypes)  ,
DataEngine   
)