MRPT  2.0.2
Classes | Enumerations | Functions
CPolyhedron.cpp File Reference
#include "opengl-precomp.h"
#include <mrpt/math/CMatrixDynamic.h>
#include <mrpt/math/CMatrixF.h>
#include <mrpt/math/TLine3D.h>
#include <mrpt/math/TObject3D.h>
#include <mrpt/math/geometry.h>
#include <mrpt/math/ops_containers.h>
#include <mrpt/opengl/CPolyhedron.h>
#include <mrpt/poses/CPose3D.h>
#include <mrpt/random.h>
#include <mrpt/serialization/CArchive.h>
#include <mrpt/serialization/stl_serialization.h>
Include dependency graph for CPolyhedron.cpp:

Go to the source code of this file.

Classes

class  FCreatePolygonFromFace< T >
 
struct  SegmentVector
 

Enumerations

enum  JohnsonBodyPart {
  INF_NO_BODY = -2, SUP_NO_BODY = -1, UPWARDS_PYRAMID = 0, DOWNWARDS_PYRAMID = 1,
  UPWARDS_CUPOLA = 2, DOWNWARDS_CUPOLA = 3, ROTATED_UPWARDS_CUPOLA = 4, ROTATED_DOWNWARDS_CUPOLA = 5,
  PRISM = 6, ANTIPRISM = 7, UPWARDS_ROTUNDA = 8, DOWNWARDS_ROTUNDA = 9,
  ROTATED_UPWARDS_ROTUNDA = 10, ROTATED_DOWNWARDS_ROTUNDA = 11
}
 

Functions

bool getVerticesAndFaces (const vector< math::TPolygon3D > &polys, vector< TPoint3D > &vertices, vector< CPolyhedron::TPolyhedronFace > &faces)
 
bool analyzeJohnsonPartsString (const std::string &components, uint32_t numBaseEdges, vector< JohnsonBodyPart > &parts)
 
size_t additionalVertices (JohnsonBodyPart j, uint32_t numBaseEdges)
 
void insertCupola (size_t numBaseEdges, double angleShift, double baseRadius, double edgeLength, bool isRotated, bool isUpwards, size_t base, vector< TPoint3D > &verts, vector< CPolyhedron::TPolyhedronFace > &faces)
 
void insertRotunda (double angleShift, double baseRadius, bool isRotated, bool isUpwards, size_t base, vector< TPoint3D > &verts, vector< CPolyhedron::TPolyhedronFace > &faces)
 
size_t additionalFaces (JohnsonBodyPart j, uint32_t numBaseEdges)
 
bool faceContainsEdge (const CPolyhedron::TPolyhedronFace &f, const CPolyhedron::TPolyhedronEdge &e)
 
bool getPlanesIntersection (const vector< const TPlane *> &planes, TPoint3D &pnt)
 
bool searchForFace (const vector< CPolyhedron::TPolyhedronFace > &fs, uint32_t v1, uint32_t v2, uint32_t v3)
 
bool searchForEdge (const vector< CPolyhedron::TPolyhedronEdge > &es, uint32_t v1, uint32_t v2, size_t &where)
 
bool searchForEdge (const vector< CPolyhedron::TPolyhedronFace >::const_iterator &begin, const vector< CPolyhedron::TPolyhedronFace >::const_iterator &end, uint32_t v1, uint32_t v2)
 
double getHeight (const TPolygon3D &p, const TPoint3D &c)
 

Enumeration Type Documentation

◆ JohnsonBodyPart

Enumerator
INF_NO_BODY 
SUP_NO_BODY 
UPWARDS_PYRAMID 
DOWNWARDS_PYRAMID 
UPWARDS_CUPOLA 
DOWNWARDS_CUPOLA 
ROTATED_UPWARDS_CUPOLA 
ROTATED_DOWNWARDS_CUPOLA 
PRISM 
ANTIPRISM 
UPWARDS_ROTUNDA 
DOWNWARDS_ROTUNDA 
ROTATED_UPWARDS_ROTUNDA 
ROTATED_DOWNWARDS_ROTUNDA 

Definition at line 78 of file CPolyhedron.cpp.

Function Documentation

◆ additionalFaces()

size_t additionalFaces ( JohnsonBodyPart  j,
uint32_t  numBaseEdges 
)
inline

Definition at line 325 of file CPolyhedron.cpp.

References ANTIPRISM, INF_NO_BODY, PRISM, SUP_NO_BODY, and UPWARDS_CUPOLA.

Referenced by mrpt::opengl::CPolyhedron::CreateJohnsonSolidWithConstantBase().

Here is the caller graph for this function:

◆ additionalVertices()

size_t additionalVertices ( JohnsonBodyPart  j,
uint32_t  numBaseEdges 
)
inline

Definition at line 209 of file CPolyhedron.cpp.

References INF_NO_BODY, PRISM, SUP_NO_BODY, UPWARDS_CUPOLA, and UPWARDS_ROTUNDA.

Referenced by mrpt::opengl::CPolyhedron::CreateJohnsonSolidWithConstantBase().

Here is the caller graph for this function:

◆ analyzeJohnsonPartsString()

bool analyzeJohnsonPartsString ( const std::string &  components,
uint32_t  numBaseEdges,
vector< JohnsonBodyPart > &  parts 
)

Definition at line 95 of file CPolyhedron.cpp.

References ANTIPRISM, DOWNWARDS_CUPOLA, DOWNWARDS_PYRAMID, DOWNWARDS_ROTUNDA, INF_NO_BODY, PRISM, ROTATED_DOWNWARDS_CUPOLA, ROTATED_DOWNWARDS_ROTUNDA, ROTATED_UPWARDS_CUPOLA, ROTATED_UPWARDS_ROTUNDA, SUP_NO_BODY, UPWARDS_CUPOLA, UPWARDS_PYRAMID, and UPWARDS_ROTUNDA.

Referenced by mrpt::opengl::CPolyhedron::CreateJohnsonSolidWithConstantBase().

Here is the caller graph for this function:

◆ faceContainsEdge()

bool faceContainsEdge ( const CPolyhedron::TPolyhedronFace f,
const CPolyhedron::TPolyhedronEdge e 
)
inline

Definition at line 341 of file CPolyhedron.cpp.

References mrpt::opengl::CPolyhedron::TPolyhedronEdge::v1, mrpt::opengl::CPolyhedron::TPolyhedronEdge::v2, and mrpt::opengl::CPolyhedron::TPolyhedronFace::vertices.

Referenced by mrpt::opengl::CPolyhedron::getDual().

Here is the caller graph for this function:

◆ getHeight()

double getHeight ( const TPolygon3D p,
const TPoint3D c 
)

Definition at line 443 of file CPolyhedron.cpp.

References mrpt::math::distance(), mrpt::math::getEpsilon(), and mrpt::square().

Referenced by mrpt::opengl::CMesh::adjustGridToImageAR(), mrpt::opengl::CPolyhedron::augment(), mrpt::img::CCanvas::filledRectangle(), and mrpt::img::CCanvas::line().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPlanesIntersection()

bool getPlanesIntersection ( const vector< const TPlane *> &  planes,
TPoint3D pnt 
)

Definition at line 351 of file CPolyhedron.cpp.

References mrpt::math::TObject3D::getLine(), mrpt::math::TObject3D::getPlane(), mrpt::math::TObject3D::getPoint(), and mrpt::math::intersect().

Referenced by mrpt::opengl::CPolyhedron::getDual().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getVerticesAndFaces()

bool getVerticesAndFaces ( const vector< math::TPolygon3D > &  polys,
vector< TPoint3D > &  vertices,
vector< CPolyhedron::TPolyhedronFace > &  faces 
)

Definition at line 50 of file CPolyhedron.cpp.

References mrpt::containers::find(), and mrpt::opengl::CPolyhedron::TPolyhedronFace::vertices.

Referenced by mrpt::opengl::CPolyhedron::CPolyhedron(), and mrpt::opengl::CPolyhedron::makeConvexPolygons().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ insertCupola()

void insertCupola ( size_t  numBaseEdges,
double  angleShift,
double  baseRadius,
double  edgeLength,
bool  isRotated,
bool  isUpwards,
size_t  base,
vector< TPoint3D > &  verts,
vector< CPolyhedron::TPolyhedronFace > &  faces 
)

Definition at line 222 of file CPolyhedron.cpp.

References M_PI, mrpt::square(), and mrpt::opengl::CPolyhedron::TPolyhedronFace::vertices.

Referenced by mrpt::opengl::CPolyhedron::CreateJohnsonSolidWithConstantBase().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ insertRotunda()

void insertRotunda ( double  angleShift,
double  baseRadius,
bool  isRotated,
bool  isUpwards,
size_t  base,
vector< TPoint3D > &  verts,
vector< CPolyhedron::TPolyhedronFace > &  faces 
)

Definition at line 273 of file CPolyhedron.cpp.

References M_PI, mrpt::opengl::CPolyhedron::TPolyhedronFace::vertices, mrpt::math::TPoint3D_data< T >::x, mrpt::math::TPoint3D_data< T >::y, and mrpt::math::TPoint3D_data< T >::z.

Referenced by mrpt::opengl::CPolyhedron::CreateJohnsonSolidWithConstantBase().

Here is the caller graph for this function:

◆ searchForEdge() [1/2]

bool searchForEdge ( const vector< CPolyhedron::TPolyhedronEdge > &  es,
uint32_t  v1,
uint32_t  v2,
size_t &  where 
)

Definition at line 410 of file CPolyhedron.cpp.

References mrpt::opengl::CPolyhedron::TPolyhedronEdge::v1, and mrpt::opengl::CPolyhedron::TPolyhedronEdge::v2.

Referenced by mrpt::opengl::CPolyhedron::cantellate(), and mrpt::opengl::CPolyhedron::truncate().

Here is the caller graph for this function:

◆ searchForEdge() [2/2]

bool searchForEdge ( const vector< CPolyhedron::TPolyhedronFace >::const_iterator &  begin,
const vector< CPolyhedron::TPolyhedronFace >::const_iterator &  end,
uint32_t  v1,
uint32_t  v2 
)

Definition at line 424 of file CPolyhedron.cpp.

References mrpt::containers::begin(), and mrpt::containers::end().

Here is the call graph for this function:

◆ searchForFace()

bool searchForFace ( const vector< CPolyhedron::TPolyhedronFace > &  fs,
uint32_t  v1,
uint32_t  v2,
uint32_t  v3 
)

Definition at line 389 of file CPolyhedron.cpp.

Referenced by mrpt::opengl::CPolyhedron::truncate().

Here is the caller graph for this function:



Page generated by Doxygen 1.8.14 for MRPT 2.0.2 Git: 9b4fd2465 Mon May 4 16:59:08 2020 +0200 at lun may 4 17:26:07 CEST 2020