sch::STP_BV Class Reference

#include <sch/STP-BV/STP_BV.h>

Inheritance diagram for sch::STP_BV:
Collaboration diagram for sch::STP_BV:

Public Member Functions

SCH_API STP_BV (void)
 
SCH_API STP_BV (const STP_BV &)
 
virtual SCH_API ~STP_BV (void)
 
virtual SCH_API STP_BVoperator= (const STP_BV &)
 
virtual SCH_API STP_BVclone () const
 Returns a copy of this S_Object. More...
 
virtual SCH_API Point3 l_Support (const Vector3 &v, int &lastFeature) const
 gives the support point for a given vector in local cordinates and a given last feature. MUST BE OVERLOADED. More...
 
virtual SCH_API S_ObjectType getType () const
 must be overloaded to return the type More...
 
virtual SCH_API void constructFromFile (const std::string &filename)
 Constructs the object from a file describing its STP_BV decomposition. More...
 
virtual SCH_API void constructFromFileWithGL (const std::string &filename)
 
virtual SCH_API void loadFromBinary (const std::string &filename)
 Load the object from a binary archive. More...
 
virtual SCH_API void saveToBinary (const std::string &filename)
 Save the object to a binary archive. More...
 
SCH_API void saveTreeInFile (const std::string &treefilename, ArchiveType type=TEXT_ARCHIVE)
 
SCH_API void addPatch (STP_Feature *patch)
 Adds a bouding volume to the object. More...
 
SCH_API void printSupportTree (std::string filename) const
 Print the support tree in a file. More...
 
virtual SCH_API Scalar supportH (const Vector3 &v) const
 
virtual SCH_API Point3 supportNaive (const Vector3 &v) const
 
virtual SCH_API Point3 supportFarthestNeighbour (const Vector3 &v, int &lastFeature) const
 
virtual SCH_API Point3 supportFarthestNeighbourPrime (const Vector3 &v, int &lastFeature) const
 
virtual SCH_API Point3 supportHybrid (const Vector3 &v, int &lastFeature) const
 
virtual SCH_API Point3 supportFirstNeighbour (const Vector3 &v, int &lastFeature) const
 
virtual SCH_API Point3 supportFirstNeighbourPrime (const Vector3 &v, int &lastFeature) const
 gives the support for a vector using the First neighbour method. More...
 
virtual SCH_API bool ray_cast (const Point3 &source, const Point3 &target, Scalar &param, Vector3 &normal) const
 I don't know. More...
 
SCH_API int getFeaturesNumber () const
 returns the vertex number in the STP-BV More...
 
const std::vector< sch::Geometry > & getGeometries () const
 
template<class Archive >
void load (Archive &ar, const unsigned int)
 
template<class Archive >
void save (Archive &ar, const unsigned int) const
 
Scalar getBigRadius () const
 
Scalar getSmallRadius () const
 
- Public Member Functions inherited from sch::S_ObjectNormalized
SCH_API S_ObjectNormalized (void)
 
virtual SCH_API ~S_ObjectNormalized (void)
 
virtual SCH_API Point3 support (const Vector3 &v) const
 put the vector NORMALIZED it in objects coordinates, then calls l_support. DO NOT OVERLOAD IT UNLESS YOU KNOW WHAT YOU ARE DOING (if you want to define the support function, overload l_support) More...
 
virtual SCH_API Point3 support (const Vector3 &v, int &LastFeature) const
 version of support with last feature optimization More...
 
template<class Archive >
void serialize (Archive &ar, const unsigned int)
 
- Public Member Functions inherited from sch::S_Object
SCH_API S_Object (void)
 
virtual SCH_API ~S_Object (void)
 
SCH_API void setOrientation (const Matrix3x3 &Rotation)
 
SCH_API void setOrientation (const Scalar &r00, const Scalar &r01, const Scalar &r02, const Scalar &r10, const Scalar &r11, const Scalar &r12, const Scalar &r20, const Scalar &r21, const Scalar &r22)
 
SCH_API void setOrientation (const Quaternion quaternion)
 
SCH_API void setOrientation (const Scalar &q0, const Scalar &q1, const Scalar &q2, const Scalar &q3)
 
SCH_API void setOrientation (const Scalar &yaw, const Scalar &pitch, const Scalar &roll)
 
SCH_API void setOrientation (const Scalar *const p)
 
SCH_API void setOrientation (const Scalar &angle, const Vector3 &axe)
 
SCH_API void setPosition (const Vector3 &v)
 Sets the position. More...
 
SCH_API void setPosition (const Scalar &x, const Scalar &y, const Scalar &z)
 
SCH_API void setPosition (const Scalar *const v)
 
SCH_API void setTransformation (const Matrix4x4 &transformation)
 Sets the transformation matrix. More...
 
SCH_API void addRotation (const Matrix3x3 &Rotation)
 composes the current orientation with a Rotation More...
 
SCH_API void addRotation (const Scalar &r00, const Scalar &r01, const Scalar &r02, const Scalar &r10, const Scalar &r11, const Scalar &r12, const Scalar &r20, const Scalar &r21, const Scalar &r22)
 
SCH_API void addRotation (const Quaternion quaternion)
 
SCH_API void addRotation (const Scalar &q0, const Scalar &q1, const Scalar &q2, const Scalar &q3)
 
SCH_API void addRotation (const Scalar &angle, const Vector3 &axe)
 
SCH_API void addRotation (const Scalar &yaw, const Scalar &pitch, const Scalar &roll)
 
SCH_API void addRotation (const Scalar *const p)
 
SCH_API void addScale (const Scalar &x, const Scalar &y, const Scalar &z)
 composes the current transfornation with a scale More...
 
SCH_API void addTransformation (const Matrix4x4 &transformation)
 composes the current transfornation with transformation matrix one More...
 
SCH_API void resetTransformation ()
 loads Identity More...
 
const SCH_API Vector3getPosition () const
 returns the position More...
 
const SCH_API Matrix3x3getOrientation () const
 returns the orientation as a rotation matrix More...
 
SCH_API void getTransformationMatrix (Scalar *S) const
 puts the transfomation matrix in a sclar array More...
 
int getSlices () const
 
int getStacks () const
 
const S_ObjectTimeStampcheckStamp () const
 returns the current time stamp More...
 
template<class Archive >
void serialize (Archive &ar, const unsigned int)
 
SCH_API void addTranslation (const Vector3 &v)
 
SCH_API void addTranslation (const Scalar *const v)
 
SCH_API void addTranslation (const Scalar &x, const Scalar &y, const Scalar &z)
 

Protected Member Functions

SCH_API void loadTreeFromFile (const std::string &treefilename, ArchiveType type=TEXT_ARCHIVE)
 Load the tree structure of the object from a file. More...
 
SCH_API void computeArcPointsBetween (const Point3 &p1, const Point3 &p2, const Point3 &center, int step, std::vector< Point3 > &res) const
 Computes the points of an arc. More...
 
SCH_API void computeConePointsBetween (const Point3 &p1, const Point3 &p2, Vector3 axis, int step, std::vector< Point3 > &res, Matrix3x3 &homo)
 Computes the points of. More...
 
SCH_API Point3 computeLinesCommonPoint (const Point3 &l1p1, const Point3 &l1p2, const Point3 &l2p1, const Point3 &l2p2) const
 Computes the intersection of two segments. More...
 
SCH_API Point3 computeCenter (const std::vector< Point3 > &points)
 Computes the center of a surface defined by a list of points. More...
 
SCH_API void updateFastPatches ()
 Updates the dynamical array fastPatches. Must be called after each patches modification. More...
 

Protected Attributes

std::vector< STP_Feature * > m_patches
 
STP_Feature ** m_fastPatches
 
STP_Feature ** m_lastPatches
 
int m_patchesSize
 
Scalar _r
 
Scalar _R
 
std::vector< Geometrygeometries_
 
- Protected Attributes inherited from sch::S_Object
S_ObjectTimeStamp stamp_
 
int stacks_
 
int slices_
 
Matrix3x3 mRot_
 
Vector3 trans_
 

Additional Inherited Members

- Public Types inherited from sch::S_Object
enum  S_ObjectType {
  TS_Object, TPolyhedron, TSTP_BV, TSphere,
  TBox, TSuperellipsoid, TSTP_BV_WithPolyhedron, TPoint,
  TCapsule, TCone, TCylinder
}
 type of a solid object. Don't use it to cast ! More...
 

Detailed Description

Examples
example2.cpp.

Constructor & Destructor Documentation

◆ STP_BV() [1/2]

SCH_API sch::STP_BV::STP_BV ( void  )

◆ STP_BV() [2/2]

SCH_API sch::STP_BV::STP_BV ( const STP_BV )

◆ ~STP_BV()

virtual SCH_API sch::STP_BV::~STP_BV ( void  )
virtual

Member Function Documentation

◆ addPatch()

SCH_API void sch::STP_BV::addPatch ( STP_Feature patch)

Adds a bouding volume to the object.

Parameters
patchbounding volume to add to the object

◆ clone()

virtual SCH_API STP_BV* sch::STP_BV::clone ( ) const
virtual

Returns a copy of this S_Object.

Implements sch::S_Object.

Reimplemented in sch::STP_BV_P.

◆ computeArcPointsBetween()

SCH_API void sch::STP_BV::computeArcPointsBetween ( const Point3 p1,
const Point3 p2,
const Point3 center,
int  step,
std::vector< Point3 > &  res 
) const
protected

Computes the points of an arc.

Parameters
p1first point of the arc
p2last point of the arc
centercenter around which the arc revolves
stepnumber of subdivisions
resvector to store the resulting points (including first and last points)

◆ computeCenter()

SCH_API Point3 sch::STP_BV::computeCenter ( const std::vector< Point3 > &  points)
protected

Computes the center of a surface defined by a list of points.

Parameters
pointsvector containing all the points
Returns
the center

◆ computeConePointsBetween()

SCH_API void sch::STP_BV::computeConePointsBetween ( const Point3 p1,
const Point3 p2,
Vector3  axis,
int  step,
std::vector< Point3 > &  res,
Matrix3x3 homo 
)
protected

Computes the points of.

Parameters
p1first point
p2last point
cosangleno use
axisaxis of the cone
stepnumber of subdivision
resvector to store the resulting points (including first and last points)

◆ computeLinesCommonPoint()

SCH_API Point3 sch::STP_BV::computeLinesCommonPoint ( const Point3 l1p1,
const Point3 l1p2,
const Point3 l2p1,
const Point3 l2p2 
) const
protected

Computes the intersection of two segments.

Parameters
l1p1first point of the first line
l1p2last point of the first line
l2p1first point of the second line
l2p2last point of the second line
Returns
the result

◆ constructFromFile()

virtual SCH_API void sch::STP_BV::constructFromFile ( const std::string &  filename)
virtual

Constructs the object from a file describing its STP_BV decomposition.

Parameters
filenamepath to the file describing the STP_BV decomposition of the object

Reimplemented from sch::S_Object.

Reimplemented in sch::STP_BV_P.

Examples
example2.cpp.

◆ constructFromFileWithGL()

virtual SCH_API void sch::STP_BV::constructFromFileWithGL ( const std::string &  filename)
inlinevirtual

◆ getBigRadius()

Scalar sch::STP_BV::getBigRadius ( ) const
inline

◆ getFeaturesNumber()

SCH_API int sch::STP_BV::getFeaturesNumber ( ) const

returns the vertex number in the STP-BV

◆ getGeometries()

const std::vector<sch::Geometry>& sch::STP_BV::getGeometries ( ) const

◆ getSmallRadius()

Scalar sch::STP_BV::getSmallRadius ( ) const
inline

◆ getType()

virtual SCH_API S_ObjectType sch::STP_BV::getType ( ) const
virtual

must be overloaded to return the type

Reimplemented from sch::S_Object.

Reimplemented in sch::STP_BV_P.

◆ l_Support()

virtual SCH_API Point3 sch::STP_BV::l_Support ( const Vector3 v,
int &  lastFeature 
) const
virtual

gives the support point for a given vector in local cordinates and a given last feature. MUST BE OVERLOADED.

Parameters
vdirection vector (normalized)
lastFeaturetells in which feature we were in last query, amd returns the new one. very important in spatio-temporal coherence
Returns
returns the support point.

Implements sch::S_Object.

Reimplemented in sch::STP_BV_P.

◆ load()

template<class Archive >
void sch::STP_BV::load ( Archive &  ar,
const unsigned int   
)
inline

◆ loadFromBinary()

virtual SCH_API void sch::STP_BV::loadFromBinary ( const std::string &  filename)
virtual

Load the object from a binary archive.

Parameters
filenamepath to the binary archive

◆ loadTreeFromFile()

SCH_API void sch::STP_BV::loadTreeFromFile ( const std::string &  treefilename,
ArchiveType  type = TEXT_ARCHIVE 
)
protected

Load the tree structure of the object from a file.

Parameters
treefilenamepath to the binary file containing the tree of the object

This uses Boost serialization library.

◆ operator=()

virtual SCH_API STP_BV& sch::STP_BV::operator= ( const STP_BV )
virtual

◆ printSupportTree()

SCH_API void sch::STP_BV::printSupportTree ( std::string  filename) const

Print the support tree in a file.

Parameters
filenamename of the file

◆ ray_cast()

virtual SCH_API bool sch::STP_BV::ray_cast ( const Point3 source,
const Point3 target,
Scalar param,
Vector3 normal 
) const
virtual

I don't know.

Parameters
source
target
param
normal

◆ save()

template<class Archive >
void sch::STP_BV::save ( Archive &  ar,
const unsigned int   
) const
inline

◆ saveToBinary()

virtual SCH_API void sch::STP_BV::saveToBinary ( const std::string &  filename)
virtual

Save the object to a binary archive.

Parameters
filenamepath to the binary archive

◆ saveTreeInFile()

SCH_API void sch::STP_BV::saveTreeInFile ( const std::string &  treefilename,
ArchiveType  type = TEXT_ARCHIVE 
)
Parameters
treefilenamepath to the binary file to contain the tree of the object
typekind of Boost archive to use. Currently either BINARY_ARCHIVE or TEXT_ARCHIVE (this is default value)
Warning
Binary archives are platform dependent.

◆ supportFarthestNeighbour()

virtual SCH_API Point3 sch::STP_BV::supportFarthestNeighbour ( const Vector3 v,
int &  lastFeature 
) const
virtual
Parameters
vdirection

◆ supportFarthestNeighbourPrime()

virtual SCH_API Point3 sch::STP_BV::supportFarthestNeighbourPrime ( const Vector3 v,
int &  lastFeature 
) const
virtual
Parameters
vdirection

◆ supportFirstNeighbour()

virtual SCH_API Point3 sch::STP_BV::supportFirstNeighbour ( const Vector3 v,
int &  lastFeature 
) const
virtual
Parameters
vdirection

◆ supportFirstNeighbourPrime()

virtual SCH_API Point3 sch::STP_BV::supportFirstNeighbourPrime ( const Vector3 v,
int &  lastFeature 
) const
virtual

gives the support for a vector using the First neighbour method.

Parameters
vdirection

◆ supportH()

virtual SCH_API Scalar sch::STP_BV::supportH ( const Vector3 v) const
virtual
Parameters
vdirection

◆ supportHybrid()

virtual SCH_API Point3 sch::STP_BV::supportHybrid ( const Vector3 v,
int &  lastFeature 
) const
virtual
Parameters
vdirection

◆ supportNaive()

virtual SCH_API Point3 sch::STP_BV::supportNaive ( const Vector3 v) const
virtual
Parameters
vdirection

◆ updateFastPatches()

SCH_API void sch::STP_BV::updateFastPatches ( )
protected

Updates the dynamical array fastPatches. Must be called after each patches modification.

Member Data Documentation

◆ _r

Scalar sch::STP_BV::_r
protected

◆ _R

Scalar sch::STP_BV::_R
protected

◆ geometries_

std::vector<Geometry> sch::STP_BV::geometries_
protected

◆ m_fastPatches

STP_Feature** sch::STP_BV::m_fastPatches
protected

◆ m_lastPatches

STP_Feature** sch::STP_BV::m_lastPatches
protected

◆ m_patches

std::vector<STP_Feature *> sch::STP_BV::m_patches
protected

◆ m_patchesSize

int sch::STP_BV::m_patchesSize
protected

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