RobWorkProject  22.2.21-
Classes | Public Types | Public Member Functions | Protected Member Functions | List of all members
ImplicitBREP Class Reference

Type of BREP where all surfaces are of type ImplicitSurface, and edges are of type ParametricCurve. More...

#include <ImplicitBREP.hpp>

Inherits BREP.

Classes

class  CommonParametricCurveSet
 Convenience type for a set of curves in a BREP. More...
 

Public Types

typedef rw::core::Ptr< ImplicitBREPPtr
 Smart pointer type to ImplicitBREP.
 
typedef rw::core::Ptr< const ImplicitBREPCPtr
 Smart pointer type to const ImplicitBREP.
 
- Public Types inherited from BREP
typedef rw::core::Ptr< BREPPtr
 Smart pointer type to BREP.
 
typedef rw::core::Ptr< const BREPCPtr
 Smart pointer type to const BREP.
 
- Public Types inherited from GeometryData
enum  GeometryType {
  PointCloud, LineMesh, PlainTriMesh, IdxTriMesh,
  SpherePrim, BoxPrim, OBBPrim, AABBPrim,
  LinePrim, PointPrim, PyramidPrim, ConePrim,
  TrianglePrim, CylinderPrim, TubePrim, PlanePrim,
  RayPrim, Implicit, Quadratic, UserType
}
 geometry data types
 
typedef rw::core::Ptr< GeometryDataPtr
 smart pointer type to this class
 

Public Member Functions

 ImplicitBREP ()
 Constructor.
 
virtual ~ImplicitBREP ()
 Destructor.
 
virtual GeometryType getType () const
 the type of this primitive More...
 
virtual const rw::geometry::ImplicitSurfacegetSurface (std::size_t surfaceIndex) const
 Get surface. More...
 
virtual const rw::geometry::ParametricCurvegetCurve (std::size_t curveIndex) const
 Get curve. More...
 
virtual void scale (double factor)
 Scale the object. More...
 
ImplicitBREP::Ptr clone () const
 Make a deep copy of the BREP. More...
 
rw::core::Ptr< const rw::geometry::ImplicitShellshellProxy () const
 Get a Shell representation as a proxy to the BREP. More...
 
std::vector< rw::core::Ptr< rw::geometry::ParametricCurve > > getCurves (std::size_t loopIdx) const
 Get the curves in a given loop. More...
 
CommonParametricCurveSet::CPtr getCommonCurves (const std::set< std::size_t > &faces) const
 Get a set of common curves between a set of faces. More...
 
void addEdge (const rw::geometry::ParametricCurve &curve, std::size_t v1, std::size_t v2)
 Add a ParametricCurve to the BREP. More...
 
void setFace (const rw::geometry::ImplicitSurface &surface, std::size_t loop)
 Attach an ImplicitSurface to a face of the BREP. More...
 
- Public Member Functions inherited from BREP
virtual ~BREP ()
 Destructor.
 
virtual rw::core::Ptr< TriMeshgetTriMesh (bool forceCopy=true)
 Create a TriMesh representation from this boundary representation. More...
 
virtual bool isConvex ()
 test if this geometry data is convex More...
 
virtual bool isConvex () const
 test if this geometry data is convex More...
 
BREP::Ptr clone () const
 Make a deep copy of the BREP. More...
 
rw::core::Ptr< const rw::geometry::ShellshellProxy () const
 Get a Shell representation as a proxy to the BREP. More...
 
std::vector< rw::core::Ptr< rw::geometry::Curve > > getCurves (std::size_t loopIdx) const
 Get the curves in a given loop. More...
 
CommonCurveSet::CPtr getCommonCurves (const std::set< std::size_t > &faces) const
 Get a set of common curves between a set of faces. More...
 
std::size_t faceCount () const
 The number of faces. More...
 
std::size_t loopCount () const
 The number of loops. More...
 
std::size_t edgeCount () const
 The number of edges. More...
 
std::size_t verticeCount () const
 The number of vertices. More...
 
const rw::math::Vector3D< double > & getVertex (std::size_t vertexIndex) const
 Get vertex. More...
 
std::vector< rw::math::Vector3D< double > > getVertices (std::size_t loopIdx) const
 Get the vertices in a given loop. More...
 
bool hasSurfaceSet (std::size_t loop)
 Check if a certain loop has a surface set. More...
 
std::size_t getSurfaceIndex (std::size_t loop)
 Get the surface index of a loop. More...
 
rw::geometry::OBB obb (const rw::math::Rotation3D<> &R)
 Create Oriented Bounding Box with certain principal directions. More...
 
rw::geometry::OBB obb ()
 Create Oriented Bounding Box where the directions are estimated. More...
 
void addVertex (const rw::math::Vector3D< double > &point)
 Add a vertex to the BREP. More...
 
void makeLoop (int singleEdgeId)
 Create a loop containing a single edge (typically for circles and ellipses and similar). More...
 
template<typename T >
int makeLoop (T first, T second)
 Create a loop containing two edges. More...
 
template<typename T , typename... Args>
int makeLoop (T first, Args... args)
 Create a loop with a variable number of edges. More...
 
void stitchEdges (std::size_t first, std::size_t second)
 Connect two half-edges. More...
 
void stitchAuto (double eps)
 Try to stitch edges automatically. More...
 
rw::geometry::OBB faceOBB (std::size_t faceIndex)
 Create Oriented Bounding Box for a face. More...
 
rw::geometry::OBB edgeOBR (std::size_t edge) const
 Create Oriented Bounding Rectangle for an edge. More...
 
std::pair< double, double > faceExtremums (std::size_t faceIndex, const rw::math::Vector3D< double > &dir) const
 Find the extent of the surface along a specific direction. More...
 
rw::core::Ptr< rw::geometry::TriMeshfaceTriMesh (std::size_t faceIndex)
 Construct a Triangle Mesh for a face. More...
 
void setMeshResolution (double resolution=10)
 Set the resolution used for discretization in the getTriMesh and faceTriMesh functions. More...
 
virtual void print ()
 Print the structure of the BREP for debugging purposes.
 
- Public Member Functions inherited from GeometryData
virtual ~GeometryData ()
 Destructor.
 

Protected Member Functions

virtual void doRemoveCurve (std::size_t curveIndex)
 Remove specific curve. More...
 
- Protected Member Functions inherited from BREP
 BREP ()
 Constructor.
 
void copyTopologyTo (BREP::Ptr brep) const
 Copy the topology of this BREP to another brep. More...
 
void addBREPEdge (std::size_t curveIndex, std::size_t vertex1, std::size_t vertex2)
 Add a edge (will insert a pair of half-edges). More...
 
void setBREPFace (std::size_t surfaceIndex, std::size_t loop)
 Attach a surface to a loop. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from GeometryData
static std::string toString (GeometryType type)
 format GeometryType to string More...
 
- Protected Attributes inherited from BREP
std::vector< Vertex * > _vertices
 The vertices in the BREP.
 
std::vector< std::pair< HalfEdge *, HalfEdge * > > _edges
 The half-edges in the BREP.
 
std::vector< Face * > _faces
 The faces in the BREP. A face is added for each loop constructed.
 
double _resolution
 Resolution used for discretization functions.
 

Detailed Description

Type of BREP where all surfaces are of type ImplicitSurface, and edges are of type ParametricCurve.

Member Function Documentation

◆ addEdge()

void addEdge ( const rw::geometry::ParametricCurve curve,
std::size_t  v1,
std::size_t  v2 
)

Add a ParametricCurve to the BREP.

Notice that the curve has direction. It is expected to have limits such that it starts in vertex v1 and end in v2.

Parameters
curve[in] curve to add.
v1[in] the start vertex.
v2[in] the end vertex.

◆ clone()

ImplicitBREP::Ptr clone ( ) const

Make a deep copy of the BREP.

Returns
a copy of the BREP.

◆ doRemoveCurve()

virtual void doRemoveCurve ( std::size_t  curveIndex)
protectedvirtual

Remove specific curve.

Parameters
curveIndex[in] the index of the curve to remove.

Implements BREP.

◆ getCommonCurves()

CommonParametricCurveSet::CPtr getCommonCurves ( const std::set< std::size_t > &  faces) const

Get a set of common curves between a set of faces.

Parameters
faces[in] loop indexes for the faces to consider.
Returns
set of common curves as a CommonCurveSet.

◆ getCurve()

virtual const rw::geometry::ParametricCurve& getCurve ( std::size_t  curveIndex) const
virtual

Get curve.

Parameters
curveIndex[in] index of the curve. Should be less than the number returned by edgeCount().
Returns
a reference to the curve.

Implements BREP.

◆ getCurves()

std::vector< rw::core::Ptr< rw::geometry::ParametricCurve > > getCurves ( std::size_t  loopIdx) const

Get the curves in a given loop.

The curves will be traversed in an ordered way, and curves will have a direction that leads to the next curve.

Parameters
loopIdx[in] the loop index.
Returns
an ordered vector of curves.

◆ getSurface()

virtual const rw::geometry::ImplicitSurface& getSurface ( std::size_t  surfaceIndex) const
virtual

Get surface.

Parameters
surfaceIndex[in] the index of the surface. Should be less than the number returned by size().
Returns
a reference to the surface.

Implements BREP.

◆ getType()

virtual GeometryType getType ( ) const
virtual

the type of this primitive

Implements BREP.

◆ scale()

virtual void scale ( double  factor)
virtual

Scale the object.

Parameters
factor[in] the factor to scale with.

Implements BREP.

◆ setFace()

void setFace ( const rw::geometry::ImplicitSurface surface,
std::size_t  loop 
)

Attach an ImplicitSurface to a face of the BREP.

Parameters
surface[in] surface to add.
loop[in] the loop index for the loop to attach surface to.

◆ shellProxy()

rw::core::Ptr< const rw::geometry::ImplicitShell > shellProxy ( ) const

Get a Shell representation as a proxy to the BREP.

Returns
smart pointer to a Shell proxy object.

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