Simox  2.3.74.0
VirtualRobot::CoinVisualizationFactory Class Reference
Inheritance diagram for VirtualRobot::CoinVisualizationFactory:
VirtualRobot::VisualizationFactory AbstractFactoryMethod< VisualizationFactory, void *>

Public Types

typedef std::map< std::pair< size_t, std::string >, void * > TextureCacheMap
 
- Public Types inherited from AbstractFactoryMethod< VisualizationFactory, void *>
typedef std::shared_ptr< VisualizationFactory >(* initialisationFunction) (void *)
 

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW CoinVisualizationFactory ()
 
 ~CoinVisualizationFactory () override
 
void init (int &argc, char *argv[], const std::string &appName) override
 
VisualizationNodePtr getVisualizationFromPrimitives (const std::vector< Primitive::PrimitivePtr > &primitives, bool boundingBox=false, Color color=Color::Gray()) override
 
VisualizationNodePtr getVisualizationFromFile (const std::string &filename, bool boundingBox=false, float scaleX=1.0f, float scaleY=1.0f, float scaleZ=1.0f) override
 
virtual VisualizationNodePtr getVisualizationFromFileWithAssimp (const std::string &filename, bool boundingBox=false, float scaleX=1.0f, float scaleY=1.0f, float scaleZ=1.0f)
 
virtual VisualizationNodePtr getVisualizationFromCoin3DFile (const std::string &filename, bool boundingBox=false)
 
VisualizationNodePtr getVisualizationFromFile (const std::ifstream &ifs, bool boundingBox=false, float scaleX=1.0f, float scaleY=1.0f, float scaleZ=1.0f) override
 
virtual VisualizationNodePtr getVisualizationFromString (const std::string &modelString, bool boundingBox=false)
 
virtual VisualizationPtr getVisualization (const std::vector< VisualizationNodePtr > &visus)
 
virtual VisualizationPtr getVisualization (VisualizationNodePtr visu)
 
VisualizationNodePtr createBox (float width, float height, float depth, float colorR=0.5f, float colorG=0.5f, float colorB=0.5f) override
 
VisualizationNodePtr createLine (const Eigen::Vector3f &from, const Eigen::Vector3f &to, float width=1.0f, float colorR=0.5f, float colorG=0.5f, float colorB=0.5f) override
 
VisualizationNodePtr createLine (const Eigen::Matrix4f &from, const Eigen::Matrix4f &to, float width=1.0f, float colorR=0.5f, float colorG=0.5f, float colorB=0.5f) override
 
VisualizationNodePtr createSphere (float radius, float colorR=0.5f, float colorG=0.5f, float colorB=0.5f) override
 
VisualizationNodePtr createCylinder (float radius, float height, float colorR=0.5f, float colorG=0.5f, float colorB=0.5f) override
 
VisualizationNodePtr createCircle (float radius, float circleCompletion, float width, float colorR=1.0f, float colorG=0.5f, float colorB=0.5f, size_t numberOfCircleParts=30) override
 
VisualizationNodePtr createCoordSystem (float scaling=1.0f, std::string *text=NULL, float axisLength=100.0f, float axisSize=3.0f, int nrOfBlocks=10) override
 
VisualizationNodePtr createBoundingBox (const BoundingBox &bbox, bool wireFrame=false) override
 
VisualizationNodePtr createVertexVisualization (const Eigen::Vector3f &position, float radius, float transparency, float colorR=0.5f, float colorG=0.5f, float colorB=0.5f) override
 
VisualizationNodePtr createTriMeshModelVisualization (const TriMeshModelPtr &model, const Eigen::Matrix4f &pose=Eigen::Matrix4f::Identity(), float scaleX=1.0f, float scaleY=1.0f, float scaleZ=1.0f) override
 
VisualizationNodePtr createTriMeshModelVisualization (const TriMeshModelPtr &model, bool showNormals, const Eigen::Matrix4f &pose, bool showLines=true) override
 
VisualizationNodePtr createPlane (const Eigen::Vector3f &position, const Eigen::Vector3f &normal, float extend, float transparency, float colorR=0.5f, float colorG=0.5f, float colorB=0.5f) override
 
VisualizationNodePtr createArrow (const Eigen::Vector3f &n, float length=50.0f, float width=2.0f, const Color &color=Color::Gray()) override
 
VisualizationNodePtr createCircleArrow (float radius, float tubeRadius, float completion=1, float colorR=0.5f, float colorG=0.5f, float colorB=0.5f, float transparency=0.0f, int sides=8, int rings=30) override
 
VisualizationNodePtr createTrajectory (TrajectoryPtr t, Color colorNode=Color::Blue(), Color colorLine=Color::Gray(), float nodeSize=15.0f, float lineSize=4.0f) override
 
VisualizationNodePtr createText (const std::string &text, bool billboard=false, float scaling=1.0f, Color c=Color::Black(), float offsetX=20.0f, float offsetY=20.0f, float offsetZ=0.0f) override
 
VisualizationNodePtr createTorus (float radius, float tubeRadius, float completion=1, float colorR=0.5f, float colorG=0.5f, float colorB=0.5f, float transparency=0.0f, int sides=8, int rings=30) override
 
VisualizationNodePtr createEllipse (float x, float y, float z, bool showAxes=true, float axesHeight=4.0f, float axesWidth=8.0f) override
 
void applyDisplacement (VisualizationNodePtr o, Eigen::Matrix4f &m) override
 
VisualizationNodePtr createVisualization () override
 
VisualizationNodePtr createUnitedVisualization (const std::vector< VisualizationNodePtr > &visualizations) const override
 
void cleanup () override
 
- Public Member Functions inherited from VirtualRobot::VisualizationFactory
 VisualizationFactory ()=default
 
virtual ~VisualizationFactory ()=default
 
virtual VisualizationNodePtr createPlane (const MathTools::Plane &plane, float extend, float transparency, float colorR=0.5f, float colorG=0.5f, float colorB=0.5f)
 
- Public Member Functions inherited from AbstractFactoryMethod< VisualizationFactory, void *>
void setDescription (const std::string &newDescription)
 
std::string getDescription () const
 

Static Public Member Functions

static SoSeparator * CreateConvexHull2DVisualization (const MathTools::ConvexHull2DPtr ch, MathTools::Plane &p, VisualizationFactory::Color colorInner=VisualizationFactory::Color::Blue(), VisualizationFactory::Color colorLine=VisualizationFactory::Color::Black(), float lineSize=5.0f, const Eigen::Vector3f &offset=Eigen::Vector3f::Zero())
 
static SoSeparator * CreatePolygonVisualization (const std::vector< Eigen::Vector3f > &points, VisualizationFactory::Color colorInner=VisualizationFactory::Color::Blue(), VisualizationFactory::Color colorLine=VisualizationFactory::Color::Black(), float lineSize=4.0f)
 
static SoSeparator * CreatePolygonVisualization (const std::vector< Eigen::Vector3f > &points, VisualizationFactory::PhongMaterial mat, VisualizationFactory::Color colorLine=VisualizationFactory::Color::Black(), float lineSize=4.0f)
 
static SoSeparator * CreatePlaneVisualization (const Eigen::Vector3f &position, const Eigen::Vector3f &normal, float extend, float transparency, bool grid=true, float colorR=0.5f, float colorG=0.5f, float colorB=0.5f, std::string textureFile=std::string())
 
static SoSeparator * CreateCoordSystemVisualization (float scaling=1.0f, std::string *text=NULL, float axisLength=100.0f, float axisSize=3.0f, int nrOfBlocks=10)
 
static SoSeparator * CreateBoundingBox (SoNode *ivModel, bool wireFrame=false)
 
static SoSeparator * CreateGrid (float width, float depth, float widthMosaic, float depthMosaic, bool InvertNormal, const char *pFileName, float Transparency)
 
static SoSeparator * CreateBBoxVisualization (const BoundingBox &bbox, bool wireFrame=false)
 
static SoSeparator * CreatePointVisualization (const MathTools::ContactPoint &point, bool showNormals=false)
 
static SoSeparator * CreatePointsVisualization (const std::vector< MathTools::ContactPoint > &points, bool showNormals=false)
 
static SoSeparator * CreateArrow (const Eigen::Vector3f &pt, const Eigen::Vector3f &n, float length=50.0f, float width=2.0f, const Color &color=Color::Gray())
 
static SoSeparator * CreateArrow (const Eigen::Vector3f &n, float length=50.0f, float width=2.0f, const Color &color=Color::Gray())
 
static SoSeparator * CreateVertexVisualization (const Eigen::Vector3f &position, float radius, float transparency, float colorR=0.5f, float colorG=0.5f, float colorB=0.5f)
 
static SoSeparator * CreateVerticesVisualization (const std::vector< Eigen::Vector3f > &positions, float radius, VisualizationFactory::Color color=VisualizationFactory::Color::Gray())
 
static void RemoveDuplicateTextures (SoNode *node, const std::string &currentPath)
 
static SoSeparator * CreateEllipse (float x, float y, float z, SoMaterial *matBody=NULL, bool showAxes=true, float axesHeight=4.0f, float axesWidth=8.0f, SoMaterial *matAxisX=NULL, SoMaterial *matAxisY=NULL, SoMaterial *matAxisZ=NULL)
 
static SoSeparator * CreateSphere (float radius, float colorR, float colorG, float colorB)
 
static SoSeparator * CreateSphere (const Eigen::Vector3f &p, float radius, float colorR, float colorG, float colorB)
 
static SoSeparator * CreateCylindroid (float axisLengthX, float axisLengthY, float height, SoMaterial *matBody=nullptr)
 
static SoSeparator * Create2DMap (const Eigen::MatrixXf &d, float extendCellX, float extendCellY, const VirtualRobot::ColorMap cm=VirtualRobot::ColorMap(VirtualRobot::ColorMap::eHot), bool drawZeroCells=false, bool drawLines=true)
 
static SoSeparator * Create2DHeightMap (const Eigen::MatrixXf &d, float extendCellX, float extendCellY, float heightZ, const VirtualRobot::ColorMap cm=VirtualRobot::ColorMap(VirtualRobot::ColorMap::eHot), bool drawZeroCells=false, bool drawLines=true)
 
static SoSeparator * CreateOOBBVisualization (const MathTools::OOBB &oobb, Color colorLine=Color::Gray(), float lineSize=4.0f)
 
static SoSeparator * CreateSegmentVisualization (const MathTools::Segment &s, Color colorLine=Color::Gray(), float lineSize=4.0f)
 
static SoSeparator * Colorize (SoNode *model, VisualizationFactory::Color c)
 
static SbMatrix getSbMatrix (const Eigen::Matrix4f &m)
 
static SbMatrix getSbMatrixVec (const Eigen::Vector3f &m)
 
static SoSeparator * CreateGraspSetVisualization (GraspSetPtr graspSet, EndEffectorPtr eef, const Eigen::Matrix4f &pose=Eigen::Matrix4f::Identity(), SceneObject::VisualizationType visu=SceneObject::Full)
 
static SoSeparator * CreateGraspVisualization (GraspPtr grasp, SoSeparator *eefVisu, const Eigen::Matrix4f &pose=Eigen::Matrix4f::Identity())
 
static SoSeparator * CreateGraspVisualization (GraspPtr grasp, EndEffectorPtr eef, const Eigen::Matrix4f &pose=Eigen::Matrix4f::Identity(), SceneObject::VisualizationType visu=SceneObject::Full)
 
static SoSeparator * CreateEndEffectorVisualization (EndEffectorPtr eef, SceneObject::VisualizationType=SceneObject::Full)
 
static SoNode * getColorNode (Color color)
 
static SoSeparator * CreateText (const std::string &s, float offsetX=20.0f, float offsetY=20.0f, float offsetZ=0.0f)
 
static SoSeparator * CreateBillboardText (const std::string &s, float offsetX=20.0f, float offsetY=20.0f, float offsetZ=0.0f)
 
static SoNode * getCoinVisualization (RobotPtr robot, SceneObject::VisualizationType visuType, bool selectable=true)
 
static SoNode * getCoinVisualization (SceneObjectPtr object, SceneObject::VisualizationType visuType)
 
static SoNode * getCoinVisualization (VirtualRobot::EndEffector::ContactInfoVector &contacts, float frictionConeHeight=30.0f, float frictionConeRadius=15.0f, bool scaleAccordingToApproachDir=true)
 
static SoNode * getCoinVisualization (EndEffector::ContactInfo &contact, float frictionConeHeight=30.0f, float frictionConeRadius=15.0f, bool scaleAccordingToApproachDir=true)
 
static SoNode * getCoinVisualization (VisualizationNodePtr visu)
 
static SoNode * getCoinVisualization (TriMeshModelPtr model)
 
static SoNode * getCoinVisualization (TriMeshModelPtr model, bool shownormals, VisualizationFactory::Color color=VisualizationFactory::Color::Gray(), bool showLines=true)
 
static SoNode * getCoinVisualization (TrajectoryPtr t, Color colorNode=Color::Blue(), Color colorLine=Color::Gray(), float nodeSize=15.0f, float lineSize=4.0f)
 
static SoNode * getCoinVisualization (WorkspaceRepresentationPtr reachSpace, const VirtualRobot::ColorMap cm, bool transformToGlobalPose=true, float maxZGlobal=1e10, float minAngle=-M_PI, float maxAngle=M_PI)
 
static SoNode * getCoinVisualization (WorkspaceRepresentationPtr reachSpace, VirtualRobot::ColorMap cm, const Eigen::Vector3f &axis, bool transformToGlobalPose=true, unsigned char minValue=0, float arrowSize=0, int nrRotations=1)
 
static SoNode * getCoinVisualization (WorkspaceRepresentationPtr reachSpace, const Eigen::Vector3f &fixedEEFOrientationGlobalRPY, VirtualRobot::ColorMap cm=VirtualRobot::ColorMap(VirtualRobot::ColorMap::eHot), bool transformToGlobalPose=true, const Eigen::Vector3f &axis=Eigen::Vector3f(0, 0, 1.0f), unsigned char minValue=0, float arrowSize=0)
 Helper method: Create reach space visualization of a fixed orientation. More...
 
static SoNode * getCoinVisualization (WorkspaceRepresentationPtr reachSpace, int a, int b, int c, int nrBestEntries, SoSeparator *arrow, const VirtualRobot::ColorMap &cm, bool transformToGlobalPose, unsigned char minValue)
 helper method: create nrBestEntries arrows in direction of maximum orientation for voxelPosition (a,b,c) More...
 
static SoNode * getCoinVisualization (TSRConstraintPtr constraint, const Color &color)
 
static SoNode * getCoinVisualization (BalanceConstraintPtr constraint, const Color &color)
 
static SoNode * getCoinVisualization (PoseConstraintPtr constraint, const Color &color)
 
static SoNode * getCoinVisualization (PositionConstraintPtr constraint, const Color &color)
 
static SoNode * getCoinVisualization (SupportPolygonPtr supportPolygon, const Color &color)
 
static SoMatrixTransform * getMatrixTransform (const Eigen::Matrix4f &m)
 
static SoMatrixTransform * getMatrixTransformScaleMM2M (const Eigen::Matrix4f &m)
 
static SoNode * createCoinLine (const Eigen::Matrix4f &from, const Eigen::Matrix4f &to, float width, float colorR, float colorG, float colorB)
 
static SoNode * createCoinPartCircle (float radius, float circleCompletion, float width, float colorR, float colorG, float colorB, size_t numberOfCircleParts, float offset=0)
 
static SoNode * getCoinVisualization (WorkspaceGridPtr reachGrid, VirtualRobot::ColorMap cm, bool transformToGlobalPose=true)
 
static SoNode * getCoinVisualization (VirtualRobot::WorkspaceRepresentation::WorkspaceCut2DPtr cutXY, VirtualRobot::ColorMap cm, const Eigen::Vector3f &normal=Eigen::Vector3f::UnitY(), float maxEntry=0.0f, float minAngle=-M_PI, float maxAngle=M_PI)
 
static SoOffscreenRenderer * createOffscreenRenderer (unsigned int width, unsigned int height)
 
static bool renderOffscreen (SoOffscreenRenderer *renderer, RobotNodePtr camNode, SoNode *scene, unsigned char **buffer, float zNear=10.f, float zFar=100000.f, float fov=M_PI/4)
 
static bool renderOffscreenRgbDepthPointcloud (RobotNodePtr camNode, SoNode *scene, short width, short height, bool renderRgbImage, std::vector< unsigned char > &rgbImage, bool renderDepthImgae, std::vector< float > &depthImage, bool renderPointcloud, std::vector< Eigen::Vector3f > &pointCloud, float zNear=10.f, float zFar=100000.f, float vertFov=M_PI/4, float nanValue=NAN)
 Renders the given scene from the given cam position and outputs (optionally) the rgb image, depth image and point cloud. More...
 
static bool renderOffscreenRgbDepthPointcloud (SoOffscreenRenderer *renderer, RobotNodePtr camNode, SoNode *scene, short width, short height, bool renderRgbImage, std::vector< unsigned char > &rgbImage, bool renderDepthImage, std::vector< float > &depthImage, bool renderPointcloud, std::vector< Eigen::Vector3f > &pointCloud, float zNear=10.f, float zFar=100000.f, float vertFov=M_PI/4, float nanValue=NAN)
 Renders the given scene from the given cam position and outputs (optionally) the rgb image, depth image and point cloud. This version is much faster if always the same SoOffscreenRenderer is passed in. More...
 
static bool renderOffscreenRgbDepthPointcloud (SoOffscreenRenderer *renderer, const Eigen::Matrix4f camPose, SoNode *scene, short width, short height, bool renderRgbImage, std::vector< unsigned char > &rgbImage, bool renderDepthImage, std::vector< float > &depthImage, bool renderPointcloud, std::vector< Eigen::Vector3f > &pointCloud, float zNear=10.f, float zFar=100000.f, float vertFov=M_PI/4, float nanValue=NAN)
 
static bool renderOffscreenRgbDepthPointcloud (RobotNodePtr camNode, SoNode *scene, short width, short height, std::vector< unsigned char > &rgbImage, std::vector< float > &depthImage, std::vector< Eigen::Vector3f > &pointCloud, float zNear=10.f, float zFar=100000.f, float vertFov=M_PI/4, float nanValue=NAN)
 Renders the given scene from the given cam position and outputs the rgb image, depth image and point cloud. More...
 
static bool renderOffscreen (SoOffscreenRenderer *renderer, SoPerspectiveCamera *cam, SoNode *scene, unsigned char **buffer)
 
static SoGroup * convertSoFileChildren (SoGroup *orig)
 
static SoNode * copyNode (SoNode *n)
 
static std::string getName ()
 
static std::shared_ptr< VisualizationFactorycreateInstance (void *)
 
- Static Public Member Functions inherited from AbstractFactoryMethod< VisualizationFactory, void *>
static std::shared_ptr< VisualizationFactory > fromName (const std::string &name, void * params)
 
static std::shared_ptr< VisualizationFactory > first (void * params)
 
static std::string getName ()
 
static std::shared_ptr< VisualizationFactory > createInstance (void *)
 
static void registerClass (const std::string &name, initialisationFunction init)
 
static std::vector< std::string > getSubclassList ()
 

Static Protected Member Functions

static SoNode * GetNodeFromPrimitive (Primitive::PrimitivePtr primitive, bool boundingBox, Color color)
 
static void GetVisualizationFromSoInput (SoInput &soInput, VisualizationNodePtr &visualizationNode, bool bbox=false, bool freeDuplicateTextures=true)
 
static char IVToolsHelper_ReplaceSpaceWithUnderscore (char input)
 

Detailed Description

A Coin3D based implementation of a VisualizationFactory.

Member Typedef Documentation

◆ TextureCacheMap

typedef std::map<std::pair<size_t, std::string>, void*> VirtualRobot::CoinVisualizationFactory::TextureCacheMap

Constructor & Destructor Documentation

◆ CoinVisualizationFactory()

VirtualRobot::CoinVisualizationFactory::CoinVisualizationFactory ( )
default

◆ ~CoinVisualizationFactory()

VirtualRobot::CoinVisualizationFactory::~CoinVisualizationFactory ( )
overridedefault

Member Function Documentation

◆ applyDisplacement()

void VirtualRobot::CoinVisualizationFactory::applyDisplacement ( VisualizationNodePtr  o,
Eigen::Matrix4f &  m 
)
overridevirtual

Move local visualization by homogeneous matrix m. MM is used.

Reimplemented from VirtualRobot::VisualizationFactory.

◆ cleanup()

void VirtualRobot::CoinVisualizationFactory::cleanup ( )
overridevirtual

Here, a manual cleanup can be called, no Coin3D access possible after this. Usually no need to call cleanup explicitly, since cleanup is performed automatically at application exit.

Reimplemented from VirtualRobot::VisualizationFactory.

◆ Colorize()

SoSeparator * VirtualRobot::CoinVisualizationFactory::Colorize ( SoNode *  model,
VisualizationFactory::Color  c 
)
static

Creates a colored model, by creating a new SoSeparator and adding a basecolor with overide flags followed by the model.

◆ convertSoFileChildren()

SoGroup * VirtualRobot::CoinVisualizationFactory::convertSoFileChildren ( SoGroup *  orig)
static

When SoFiles are used, Coin3D just stores references to files instead of the real contents. This may cause problems when saving an inventor file. With this method, a group node can be converted in order to ensure that all potential files are loaded and added to the group.

◆ copyNode()

SoNode * VirtualRobot::CoinVisualizationFactory::copyNode ( SoNode *  n)
static

◆ Create2DHeightMap()

SoSeparator * VirtualRobot::CoinVisualizationFactory::Create2DHeightMap ( const Eigen::MatrixXf &  d,
float  extendCellX,
float  extendCellY,
float  heightZ,
const VirtualRobot::ColorMap  cm = VirtualRobot::ColorMap(VirtualRobot::ColorMap::eHot),
bool  drawZeroCells = false,
bool  drawLines = true 
)
static

◆ Create2DMap()

SoSeparator * VirtualRobot::CoinVisualizationFactory::Create2DMap ( const Eigen::MatrixXf &  d,
float  extendCellX,
float  extendCellY,
const VirtualRobot::ColorMap  cm = VirtualRobot::ColorMap(VirtualRobot::ColorMap::eHot),
bool  drawZeroCells = false,
bool  drawLines = true 
)
static

◆ createArrow()

VirtualRobot::VisualizationNodePtr VirtualRobot::CoinVisualizationFactory::createArrow ( const Eigen::Vector3f &  n,
float  length = 50.0f,
float  width = 2.0f,
const Color color = Color::Gray() 
)
overridevirtual

◆ CreateArrow() [1/2]

SoSeparator * VirtualRobot::CoinVisualizationFactory::CreateArrow ( const Eigen::Vector3f &  pt,
const Eigen::Vector3f &  n,
float  length = 50.0f,
float  width = 2.0f,
const Color color = Color::Gray() 
)
static

◆ CreateArrow() [2/2]

SoSeparator * VirtualRobot::CoinVisualizationFactory::CreateArrow ( const Eigen::Vector3f &  n,
float  length = 50.0f,
float  width = 2.0f,
const Color color = Color::Gray() 
)
static

◆ CreateBBoxVisualization()

SoSeparator * VirtualRobot::CoinVisualizationFactory::CreateBBoxVisualization ( const BoundingBox bbox,
bool  wireFrame = false 
)
static

◆ CreateBillboardText()

SoSeparator * VirtualRobot::CoinVisualizationFactory::CreateBillboardText ( const std::string &  s,
float  offsetX = 20.0f,
float  offsetY = 20.0f,
float  offsetZ = 0.0f 
)
static

Billboard Text visu. Offsets in mm.

◆ createBoundingBox()

VirtualRobot::VisualizationNodePtr VirtualRobot::CoinVisualizationFactory::createBoundingBox ( const BoundingBox bbox,
bool  wireFrame = false 
)
overridevirtual

◆ CreateBoundingBox()

SoSeparator * VirtualRobot::CoinVisualizationFactory::CreateBoundingBox ( SoNode *  ivModel,
bool  wireFrame = false 
)
static

◆ createBox()

VirtualRobot::VisualizationNodePtr VirtualRobot::CoinVisualizationFactory::createBox ( float  ,
float  ,
float  ,
float  = 0.5f,
float  = 0.5f,
float  = 0.5f 
)
overridevirtual

A box, dimensions are given in mm.

Reimplemented from VirtualRobot::VisualizationFactory.

◆ createCircle()

VisualizationNodePtr VirtualRobot::CoinVisualizationFactory::createCircle ( float  radius,
float  circleCompletion,
float  width,
float  colorR = 1.0f,
float  colorG = 0.5f,
float  colorB = 0.5f,
size_t  numberOfCircleParts = 30 
)
overridevirtual

◆ createCircleArrow()

VisualizationNodePtr VirtualRobot::CoinVisualizationFactory::createCircleArrow ( float  radius,
float  tubeRadius,
float  completion = 1,
float  colorR = 0.5f,
float  colorG = 0.5f,
float  colorB = 0.5f,
float  transparency = 0.0f,
int  sides = 8,
int  rings = 30 
)
overridevirtual

◆ createCoinLine()

SoNode * VirtualRobot::CoinVisualizationFactory::createCoinLine ( const Eigen::Matrix4f &  from,
const Eigen::Matrix4f &  to,
float  width,
float  colorR,
float  colorG,
float  colorB 
)
static

◆ createCoinPartCircle()

SoNode * VirtualRobot::CoinVisualizationFactory::createCoinPartCircle ( float  radius,
float  circleCompletion,
float  width,
float  colorR,
float  colorG,
float  colorB,
size_t  numberOfCircleParts,
float  offset = 0 
)
static

◆ CreateConvexHull2DVisualization()

SoSeparator * VirtualRobot::CoinVisualizationFactory::CreateConvexHull2DVisualization ( const MathTools::ConvexHull2DPtr  ch,
MathTools::Plane p,
VisualizationFactory::Color  colorInner = VisualizationFactory::Color::Blue(),
VisualizationFactory::Color  colorLine = VisualizationFactory::Color::Black(),
float  lineSize = 5.0f,
const Eigen::Vector3f &  offset = Eigen::Vector3f::Zero() 
)
static

◆ createCoordSystem()

VisualizationNodePtr VirtualRobot::CoinVisualizationFactory::createCoordSystem ( float  scaling = 1.0f,
std::string *  text = NULL,
float  axisLength = 100.0f,
float  axisSize = 3.0f,
int  nrOfBlocks = 10 
)
overridevirtual

◆ CreateCoordSystemVisualization()

SoSeparator * VirtualRobot::CoinVisualizationFactory::CreateCoordSystemVisualization ( float  scaling = 1.0f,
std::string *  text = NULL,
float  axisLength = 100.0f,
float  axisSize = 3.0f,
int  nrOfBlocks = 10 
)
static

◆ createCylinder()

VisualizationNodePtr VirtualRobot::CoinVisualizationFactory::createCylinder ( float  radius,
float  height,
float  colorR = 0.5f,
float  colorG = 0.5f,
float  colorB = 0.5f 
)
overridevirtual

◆ CreateCylindroid()

SoSeparator * VirtualRobot::CoinVisualizationFactory::CreateCylindroid ( float  axisLengthX,
float  axisLengthY,
float  height,
SoMaterial *  matBody = nullptr 
)
static

◆ createEllipse()

VisualizationNodePtr VirtualRobot::CoinVisualizationFactory::createEllipse ( float  x,
float  y,
float  z,
bool  showAxes = true,
float  axesHeight = 4.0f,
float  axesWidth = 8.0f 
)
overridevirtual

Creates an coordinate axis aligned ellipse

Parameters
xThe extend in x direction must be >= 1e-6
yThe extend in y direction must be >= 1e-6
zThe extend in z direction must be >= 1e-6
showAxesIf true, the axes are visualized
axesHeightThe height of the axes (measured from the body surface)
axesWidthThe width of the axes.
Returns
A VisualizationNode containing the visualization.

Reimplemented from VirtualRobot::VisualizationFactory.

◆ CreateEllipse()

SoSeparator * VirtualRobot::CoinVisualizationFactory::CreateEllipse ( float  x,
float  y,
float  z,
SoMaterial *  matBody = NULL,
bool  showAxes = true,
float  axesHeight = 4.0f,
float  axesWidth = 8.0f,
SoMaterial *  matAxisX = NULL,
SoMaterial *  matAxisY = NULL,
SoMaterial *  matAxisZ = NULL 
)
static

Creates an coordinate axis aligned ellipse

Parameters
xThe extend in x direction must be >= 1e-6
yThe extend in y direction must be >= 1e-6
zThe extend in z direction must be >= 1e-6
matBodyIf not given a standard material is used for the ellipse body
showAxesIf true, the axes are visualized
axesHeightThe height of the axes (measured from the body surface)
axesWidthThe width of the axes.
matAxisXIf not given a standard material is used for axis X
matAxisYIf not given a standard material is used for axis Y
matAxisZIf not given a standard material is used for axis Z
Returns
A separator containing the visualization.

◆ CreateEndEffectorVisualization()

SoSeparator * VirtualRobot::CoinVisualizationFactory::CreateEndEffectorVisualization ( EndEffectorPtr  eef,
SceneObject::VisualizationType  visu = SceneObject::Full 
)
static

Create a visualization of the end effector. The visualization is moved, so that the origin is identical with the coordinate system of the TCP.

◆ CreateGraspSetVisualization()

SoSeparator * VirtualRobot::CoinVisualizationFactory::CreateGraspSetVisualization ( GraspSetPtr  graspSet,
EndEffectorPtr  eef,
const Eigen::Matrix4f &  pose = Eigen::Matrix4f::Identity(),
SceneObject::VisualizationType  visu = SceneObject::Full 
)
static

Create a visualization of a set of grasps.

Parameters
graspSetThe grasps to visualize
eefThe visualization of this eef is used to visualize the grasps
poseThe grasp set is visualized relatively to this pose (e.g. use the object position here)
visuThe visualization type of the EEFs.

◆ CreateGraspVisualization() [1/2]

SoSeparator * VirtualRobot::CoinVisualizationFactory::CreateGraspVisualization ( GraspPtr  grasp,
SoSeparator *  eefVisu,
const Eigen::Matrix4f &  pose = Eigen::Matrix4f::Identity() 
)
static

◆ CreateGraspVisualization() [2/2]

SoSeparator * VirtualRobot::CoinVisualizationFactory::CreateGraspVisualization ( GraspPtr  grasp,
EndEffectorPtr  eef,
const Eigen::Matrix4f &  pose = Eigen::Matrix4f::Identity(),
SceneObject::VisualizationType  visu = SceneObject::Full 
)
static

◆ CreateGrid()

SoSeparator * VirtualRobot::CoinVisualizationFactory::CreateGrid ( float  width,
float  depth,
float  widthMosaic,
float  depthMosaic,
bool  InvertNormal,
const char *  pFileName,
float  Transparency 
)
static

◆ createInstance()

std::shared_ptr< VisualizationFactory > VirtualRobot::CoinVisualizationFactory::createInstance ( void *  )
static
Returns
new instance of CoinVisualizationFactory and call SoDB::init() if it has not already been called.

◆ createLine() [1/2]

VirtualRobot::VisualizationNodePtr VirtualRobot::CoinVisualizationFactory::createLine ( const Eigen::Vector3f &  from,
const Eigen::Vector3f &  to,
float  width = 1.0f,
float  colorR = 0.5f,
float  colorG = 0.5f,
float  colorB = 0.5f 
)
overridevirtual

◆ createLine() [2/2]

VisualizationNodePtr VirtualRobot::CoinVisualizationFactory::createLine ( const Eigen::Matrix4f &  from,
const Eigen::Matrix4f &  to,
float  width = 1.0f,
float  colorR = 0.5f,
float  colorG = 0.5f,
float  colorB = 0.5f 
)
overridevirtual

◆ createOffscreenRenderer()

SoOffscreenRenderer * VirtualRobot::CoinVisualizationFactory::createOffscreenRenderer ( unsigned int  width,
unsigned int  height 
)
static

Create an offscreen renderer object with the given width and height.

See also
renderOffscreen

◆ CreateOOBBVisualization()

SoSeparator * VirtualRobot::CoinVisualizationFactory::CreateOOBBVisualization ( const MathTools::OOBB oobb,
Color  colorLine = Color::Gray(),
float  lineSize = 4.0f 
)
static

◆ createPlane()

VirtualRobot::VisualizationNodePtr VirtualRobot::CoinVisualizationFactory::createPlane ( const Eigen::Vector3f &  position,
const Eigen::Vector3f &  normal,
float  extend,
float  transparency,
float  colorR = 0.5f,
float  colorG = 0.5f,
float  colorB = 0.5f 
)
overridevirtual

◆ CreatePlaneVisualization()

SoSeparator * VirtualRobot::CoinVisualizationFactory::CreatePlaneVisualization ( const Eigen::Vector3f &  position,
const Eigen::Vector3f &  normal,
float  extend,
float  transparency,
bool  grid = true,
float  colorR = 0.5f,
float  colorG = 0.5f,
float  colorB = 0.5f,
std::string  textureFile = std::string() 
)
static

◆ CreatePointsVisualization()

SoSeparator * VirtualRobot::CoinVisualizationFactory::CreatePointsVisualization ( const std::vector< MathTools::ContactPoint > &  points,
bool  showNormals = false 
)
static

◆ CreatePointVisualization()

SoSeparator * VirtualRobot::CoinVisualizationFactory::CreatePointVisualization ( const MathTools::ContactPoint point,
bool  showNormals = false 
)
static

◆ CreatePolygonVisualization() [1/2]

SoSeparator * VirtualRobot::CoinVisualizationFactory::CreatePolygonVisualization ( const std::vector< Eigen::Vector3f > &  points,
VisualizationFactory::Color  colorInner = VisualizationFactory::Color::Blue(),
VisualizationFactory::Color  colorLine = VisualizationFactory::Color::Black(),
float  lineSize = 4.0f 
)
static

◆ CreatePolygonVisualization() [2/2]

SoSeparator * VirtualRobot::CoinVisualizationFactory::CreatePolygonVisualization ( const std::vector< Eigen::Vector3f > &  points,
VisualizationFactory::PhongMaterial  mat,
VisualizationFactory::Color  colorLine = VisualizationFactory::Color::Black(),
float  lineSize = 4.0f 
)
static

◆ CreateSegmentVisualization()

SoSeparator * VirtualRobot::CoinVisualizationFactory::CreateSegmentVisualization ( const MathTools::Segment s,
Color  colorLine = Color::Gray(),
float  lineSize = 4.0f 
)
static

◆ createSphere()

VisualizationNodePtr VirtualRobot::CoinVisualizationFactory::createSphere ( float  radius,
float  colorR = 0.5f,
float  colorG = 0.5f,
float  colorB = 0.5f 
)
overridevirtual

◆ CreateSphere() [1/2]

SoSeparator * VirtualRobot::CoinVisualizationFactory::CreateSphere ( float  radius,
float  colorR,
float  colorG,
float  colorB 
)
static

◆ CreateSphere() [2/2]

SoSeparator * VirtualRobot::CoinVisualizationFactory::CreateSphere ( const Eigen::Vector3f &  p,
float  radius,
float  colorR,
float  colorG,
float  colorB 
)
static

◆ createText()

VisualizationNodePtr VirtualRobot::CoinVisualizationFactory::createText ( const std::string &  text,
bool  billboard = false,
float  scaling = 1.0f,
Color  c = Color::Black(),
float  offsetX = 20.0f,
float  offsetY = 20.0f,
float  offsetZ = 0.0f 
)
overridevirtual

◆ CreateText()

SoSeparator * VirtualRobot::CoinVisualizationFactory::CreateText ( const std::string &  s,
float  offsetX = 20.0f,
float  offsetY = 20.0f,
float  offsetZ = 0.0f 
)
static

Text visu. Offsets in mm.

◆ createTorus()

VisualizationNodePtr VirtualRobot::CoinVisualizationFactory::createTorus ( float  radius,
float  tubeRadius,
float  completion = 1,
float  colorR = 0.5f,
float  colorG = 0.5f,
float  colorB = 0.5f,
float  transparency = 0.0f,
int  sides = 8,
int  rings = 30 
)
overridevirtual

◆ createTrajectory()

VirtualRobot::VisualizationNodePtr VirtualRobot::CoinVisualizationFactory::createTrajectory ( TrajectoryPtr  t,
Color  colorNode = Color::Blue(),
Color  colorLine = Color::Gray(),
float  nodeSize = 15.0f,
float  lineSize = 4.0f 
)
overridevirtual

◆ createTriMeshModelVisualization() [1/2]

VirtualRobot::VisualizationNodePtr VirtualRobot::CoinVisualizationFactory::createTriMeshModelVisualization ( const TriMeshModelPtr model,
const Eigen::Matrix4f &  pose = Eigen::Matrix4f::Identity(),
float  scaleX = 1.0f,
float  scaleY = 1.0f,
float  scaleZ = 1.0f 
)
overridevirtual

◆ createTriMeshModelVisualization() [2/2]

VirtualRobot::VisualizationNodePtr VirtualRobot::CoinVisualizationFactory::createTriMeshModelVisualization ( const TriMeshModelPtr model,
bool  showNormals,
const Eigen::Matrix4f &  pose,
bool  showLines = true 
)
overridevirtual

◆ createUnitedVisualization()

VirtualRobot::VisualizationNodePtr VirtualRobot::CoinVisualizationFactory::createUnitedVisualization ( const std::vector< VisualizationNodePtr > &  visualizations) const
overridevirtual

Create a united visualization. Internally all visualizations are copied and added to one SoSeparator. All visualizations have to be of type CoinVisualizationNode.

Reimplemented from VirtualRobot::VisualizationFactory.

◆ createVertexVisualization()

VirtualRobot::VisualizationNodePtr VirtualRobot::CoinVisualizationFactory::createVertexVisualization ( const Eigen::Vector3f &  position,
float  radius,
float  transparency,
float  colorR = 0.5f,
float  colorG = 0.5f,
float  colorB = 0.5f 
)
overridevirtual

◆ CreateVertexVisualization()

SoSeparator * VirtualRobot::CoinVisualizationFactory::CreateVertexVisualization ( const Eigen::Vector3f &  position,
float  radius,
float  transparency,
float  colorR = 0.5f,
float  colorG = 0.5f,
float  colorB = 0.5f 
)
static

◆ CreateVerticesVisualization()

SoSeparator * VirtualRobot::CoinVisualizationFactory::CreateVerticesVisualization ( const std::vector< Eigen::Vector3f > &  positions,
float  radius,
VisualizationFactory::Color  color = VisualizationFactory::Color::Gray() 
)
static

◆ createVisualization()

VisualizationNodePtr VirtualRobot::CoinVisualizationFactory::createVisualization ( )
overridevirtual

Create an empty VisualizationNode.

Reimplemented from VirtualRobot::VisualizationFactory.

◆ getCoinVisualization() [1/19]

SoNode * VirtualRobot::CoinVisualizationFactory::getCoinVisualization ( RobotPtr  robot,
SceneObject::VisualizationType  visuType,
bool  selectable = true 
)
static

Convenient method to retrieve a coin visualization for a robot

◆ getCoinVisualization() [2/19]

SoNode * VirtualRobot::CoinVisualizationFactory::getCoinVisualization ( SceneObjectPtr  object,
SceneObject::VisualizationType  visuType 
)
static

Convenient method to retrieve a coin visualization for a SceneObject/Obstacle/ManipulationObject

◆ getCoinVisualization() [3/19]

SoNode * VirtualRobot::CoinVisualizationFactory::getCoinVisualization ( VirtualRobot::EndEffector::ContactInfoVector contacts,
float  frictionConeHeight = 30.0f,
float  frictionConeRadius = 15.0f,
bool  scaleAccordingToApproachDir = true 
)
static

Convenient method to retrieve a coin visualization for a set of contacts.

Parameters
contactsThe contacts to be visualized
frictionConeHeightThe height of the friction cone [mm].
frictionConeRadiusThe radius of the cone [mm].
scaleAccordingToApproachDirIf true, the parallel component of the contact normal is computed according to the approahcDirection of the contact.

◆ getCoinVisualization() [4/19]

SoNode * VirtualRobot::CoinVisualizationFactory::getCoinVisualization ( EndEffector::ContactInfo contact,
float  frictionConeHeight = 30.0f,
float  frictionConeRadius = 15.0f,
bool  scaleAccordingToApproachDir = true 
)
static

Convenient method to retrieve a coin visualization for a contact.

Parameters
contactThe contact to be visualized
frictionConeHeightThe height of the friction cone [mm].
frictionConeRadiusThe radius of the cone [mm].
scaleAccordingToApproachDirIf true, the parallel component of the contact normal is computed according to the approahcDirection of the contact.

◆ getCoinVisualization() [5/19]

SoNode * VirtualRobot::CoinVisualizationFactory::getCoinVisualization ( VisualizationNodePtr  visu)
static

◆ getCoinVisualization() [6/19]

SoNode * VirtualRobot::CoinVisualizationFactory::getCoinVisualization ( TriMeshModelPtr  model)
static

◆ getCoinVisualization() [7/19]

SoNode * VirtualRobot::CoinVisualizationFactory::getCoinVisualization ( TriMeshModelPtr  model,
bool  shownormals,
VisualizationFactory::Color  color = VisualizationFactory::Color::Gray(),
bool  showLines = true 
)
static

◆ getCoinVisualization() [8/19]

SoNode * VirtualRobot::CoinVisualizationFactory::getCoinVisualization ( TrajectoryPtr  t,
Color  colorNode = Color::Blue(),
Color  colorLine = Color::Gray(),
float  nodeSize = 15.0f,
float  lineSize = 4.0f 
)
static

◆ getCoinVisualization() [9/19]

SoNode * VirtualRobot::CoinVisualizationFactory::getCoinVisualization ( WorkspaceRepresentationPtr  reachSpace,
const VirtualRobot::ColorMap  cm,
bool  transformToGlobalPose = true,
float  maxZGlobal = 1e10,
float  minAngle = -M_PI,
float  maxAngle = M_PI 
)
static

Create a visualization of the reachability data.

◆ getCoinVisualization() [10/19]

SoNode * VirtualRobot::CoinVisualizationFactory::getCoinVisualization ( WorkspaceRepresentationPtr  reachSpace,
VirtualRobot::ColorMap  cm,
const Eigen::Vector3f &  axis,
bool  transformToGlobalPose = true,
unsigned char  minValue = 0,
float  arrowSize = 0,
int  nrRotations = 1 
)
static

Creates a visualization of the reachability data. For each 3D point, the orientation with maximum entry is determined and visualized as an arrow. The direction of this arrow is aligned to the param axis.

◆ getCoinVisualization() [11/19]

SoNode * VirtualRobot::CoinVisualizationFactory::getCoinVisualization ( WorkspaceRepresentationPtr  reachSpace,
const Eigen::Vector3f &  fixedEEFOrientationGlobalRPY,
VirtualRobot::ColorMap  cm = VirtualRobot::ColorMap(VirtualRobot::ColorMap::eHot),
bool  transformToGlobalPose = true,
const Eigen::Vector3f &  axis = Eigen::Vector3f(0, 0, 1.0f),
unsigned char  minValue = 0,
float  arrowSize = 0 
)
static

Helper method: Create reach space visualization of a fixed orientation.

◆ getCoinVisualization() [12/19]

SoNode * VirtualRobot::CoinVisualizationFactory::getCoinVisualization ( WorkspaceRepresentationPtr  reachSpace,
int  a,
int  b,
int  c,
int  nrBestEntries,
SoSeparator *  arrow,
const VirtualRobot::ColorMap cm,
bool  transformToGlobalPose,
unsigned char  minValue 
)
static

helper method: create nrBestEntries arrows in direction of maximum orientation for voxelPosition (a,b,c)

◆ getCoinVisualization() [13/19]

SoNode * VirtualRobot::CoinVisualizationFactory::getCoinVisualization ( TSRConstraintPtr  constraint,
const Color color 
)
static

◆ getCoinVisualization() [14/19]

SoNode * VirtualRobot::CoinVisualizationFactory::getCoinVisualization ( BalanceConstraintPtr  constraint,
const Color color 
)
static

◆ getCoinVisualization() [15/19]

SoNode * VirtualRobot::CoinVisualizationFactory::getCoinVisualization ( PoseConstraintPtr  constraint,
const Color color 
)
static

◆ getCoinVisualization() [16/19]

SoNode * VirtualRobot::CoinVisualizationFactory::getCoinVisualization ( PositionConstraintPtr  constraint,
const Color color 
)
static

◆ getCoinVisualization() [17/19]

SoNode * VirtualRobot::CoinVisualizationFactory::getCoinVisualization ( SupportPolygonPtr  supportPolygon,
const Color color 
)
static

◆ getCoinVisualization() [18/19]

SoNode * VirtualRobot::CoinVisualizationFactory::getCoinVisualization ( WorkspaceGridPtr  reachGrid,
VirtualRobot::ColorMap  cm,
bool  transformToGlobalPose = true 
)
static

Creates a visualization of the reachability grid.

◆ getCoinVisualization() [19/19]

SoNode * VirtualRobot::CoinVisualizationFactory::getCoinVisualization ( VirtualRobot::WorkspaceRepresentation::WorkspaceCut2DPtr  cutXY,
VirtualRobot::ColorMap  cm,
const Eigen::Vector3f &  normal = Eigen::Vector3f::UnitY(),
float  maxEntry = 0.0f,
float  minAngle = -M_PI,
float  maxAngle = M_PI 
)
static

Create quads according to cutXY plane. Normal can be UnitX, UnitY or UnitZ.

Parameters
maxEntryIf 0 the maximal entry of the cut plane is used as refernce.

◆ getColorNode()

SoNode * VirtualRobot::CoinVisualizationFactory::getColorNode ( Color  color)
static

Creates a material node.

◆ getMatrixTransform()

SoMatrixTransform * VirtualRobot::CoinVisualizationFactory::getMatrixTransform ( const Eigen::Matrix4f &  m)
static

Create a SoMatrixTransform from the given pose

Parameters
mThe pose with translation given in meter.

◆ getMatrixTransformScaleMM2M()

SoMatrixTransform * VirtualRobot::CoinVisualizationFactory::getMatrixTransformScaleMM2M ( const Eigen::Matrix4f &  m)
static

Create a SoMatrixTransform from the given pose Converts the pose from MM to M (scales by 0.001)

Parameters
mThe pose with translation given in millimeter.

◆ getName()

std::string VirtualRobot::CoinVisualizationFactory::getName ( )
static
Returns
"inventor"

◆ GetNodeFromPrimitive()

SoNode * VirtualRobot::CoinVisualizationFactory::GetNodeFromPrimitive ( Primitive::PrimitivePtr  primitive,
bool  boundingBox,
Color  color 
)
staticprotected

◆ getSbMatrix()

SbMatrix VirtualRobot::CoinVisualizationFactory::getSbMatrix ( const Eigen::Matrix4f &  m)
static

◆ getSbMatrixVec()

SbMatrix VirtualRobot::CoinVisualizationFactory::getSbMatrixVec ( const Eigen::Vector3f &  m)
static

◆ getVisualization() [1/2]

VisualizationPtr VirtualRobot::CoinVisualizationFactory::getVisualization ( const std::vector< VisualizationNodePtr > &  visus)
virtual

◆ getVisualization() [2/2]

VisualizationPtr VirtualRobot::CoinVisualizationFactory::getVisualization ( VisualizationNodePtr  visu)
virtual

◆ getVisualizationFromCoin3DFile()

VisualizationNodePtr VirtualRobot::CoinVisualizationFactory::getVisualizationFromCoin3DFile ( const std::string &  filename,
bool  boundingBox = false 
)
virtual

◆ getVisualizationFromFile() [1/2]

VisualizationNodePtr VirtualRobot::CoinVisualizationFactory::getVisualizationFromFile ( const std::string &  filename,
bool  boundingBox = false,
float  scaleX = 1.0f,
float  scaleY = 1.0f,
float  scaleZ = 1.0f 
)
overridevirtual

This method creates a VirtualRobot::CoinVisualizationNode from a given filename. An instance of VirtualRobot::VisualizationNode is returned in case of an occured error.

Parameters
filenamefile to load the Coin3D visualization from.
boundingBoxUse bounding box instead of full model.
Returns
instance of VirtualRobot::CoinVisualizationNode upon success and VirtualRobot::VisualizationNode on error.

Reimplemented from VirtualRobot::VisualizationFactory.

◆ getVisualizationFromFile() [2/2]

VisualizationNodePtr VirtualRobot::CoinVisualizationFactory::getVisualizationFromFile ( const std::ifstream &  ifs,
bool  boundingBox = false,
float  scaleX = 1.0f,
float  scaleY = 1.0f,
float  scaleZ = 1.0f 
)
overridevirtual

◆ getVisualizationFromFileWithAssimp()

VisualizationNodePtr VirtualRobot::CoinVisualizationFactory::getVisualizationFromFileWithAssimp ( const std::string &  filename,
bool  boundingBox = false,
float  scaleX = 1.0f,
float  scaleY = 1.0f,
float  scaleZ = 1.0f 
)
virtual

◆ getVisualizationFromPrimitives()

VisualizationNodePtr VirtualRobot::CoinVisualizationFactory::getVisualizationFromPrimitives ( const std::vector< Primitive::PrimitivePtr > &  primitives,
bool  boundingBox = false,
Color  color = Color::Gray() 
)
overridevirtual

This method creates a VirtualRobot::CoinVisualizationNode from a given vector of primitives. An instance of VirtualRobot::VisualizationNode is returned in case of an occured error.

Parameters
primitivesvector of primitives to create the visualization from.
boundingBoxUse bounding box instead of full model.
Returns
instance of VirtualRobot::CoinVisualizationNode upon success and VirtualRobot::VisualizationNode on error.

Reimplemented from VirtualRobot::VisualizationFactory.

◆ GetVisualizationFromSoInput()

void VirtualRobot::CoinVisualizationFactory::GetVisualizationFromSoInput ( SoInput &  soInput,
VisualizationNodePtr visualizationNode,
bool  boundingBox = false,
bool  freeDuplicateTextures = true 
)
staticprotected

This method reads the data from the given soInput and creates a new CoinVisualizationNode with the read Coin model if no error occurred during reading the model. The newly created CoinVisualizationNode is then stored in visualisationNode.

Parameters
soInputSoInput instance from which the model is read.
visualizationNodeVisualizationNodePtr instance in which the created CoinVisualizationNode is stored.
boundingBoxUse bounding box instead of full model.

◆ getVisualizationFromString()

VisualizationNodePtr VirtualRobot::CoinVisualizationFactory::getVisualizationFromString ( const std::string &  modelString,
bool  boundingBox = false 
)
virtual

This method creates a VirtualRobot::CoinVisualizationNode from a given modelString. An instance of VirtualRobot::VisualizationNode is returned in case of an occured error.

Parameters
modelStringstring to load the Coin3D visualization from.
boundingBoxUse bounding box instead of full model.
Returns
instance of VirtualRobot::CoinVisualizationNode upon succes and VirtualRobot::VisualizationNode on error.

◆ init()

void VirtualRobot::CoinVisualizationFactory::init ( int &  argc,
char *  argv[],
const std::string &  appName 
)
overridevirtual

Initialises SoDB and SoQt. Sets the COIN_SEPARATE_DIFFUSE_TRANSPARENCY_OVERRIDE environment variable to enable a Coin3D transparency extension.

Reimplemented from VirtualRobot::VisualizationFactory.

◆ IVToolsHelper_ReplaceSpaceWithUnderscore()

static char VirtualRobot::CoinVisualizationFactory::IVToolsHelper_ReplaceSpaceWithUnderscore ( char  input)
inlinestaticprotected

◆ RemoveDuplicateTextures()

void VirtualRobot::CoinVisualizationFactory::RemoveDuplicateTextures ( SoNode *  node,
const std::string &  currentPath 
)
static

◆ renderOffscreen() [1/2]

bool VirtualRobot::CoinVisualizationFactory::renderOffscreen ( SoOffscreenRenderer *  renderer,
RobotNodePtr  camNode,
SoNode *  scene,
unsigned char **  buffer,
float  zNear = 10.f,
float  zFar = 100000.f,
float  fov = M_PI / 4 
)
static

The cam node has to be oriented as follows: The camera is pointing along the positive z axis and the positive x axis is pointing upwards.

Parameters
rendererThe renderer should have been created with the createOffscreenRenderer method
camNodeThe node of the robot that defines the position of the camera. Any node of the robot can host a camera.
sceneThe scene that should be rendered.
bufferThe result is stored here. The origin of the 2D image is at the left bottom! The resulting buffer has the size width*height*3, with the extends as defined in the createOffscreenRenderer method.
zNearThe near plane's distance.
zFarThe far plane's distance
fovThe fov in rad. (vertical)
Returns
true on success
See also
createOffscreenRenderer

◆ renderOffscreen() [2/2]

bool VirtualRobot::CoinVisualizationFactory::renderOffscreen ( SoOffscreenRenderer *  renderer,
SoPerspectiveCamera *  cam,
SoNode *  scene,
unsigned char **  buffer 
)
static

Use a custom camera for rendering

Parameters
rendererThe renderer should have been created with the createOffscreenRenderer method
camThe camera.
sceneThe scene that should be rendered.
bufferThe result is stored here. The origin of the 2D image is at the left bottom! The resulting buffer has the size width*height*3, with the extends as defined in the createOffscreenRenderer method.
Returns
true on success
See also
createOffscreenRenderer

◆ renderOffscreenRgbDepthPointcloud() [1/4]

bool VirtualRobot::CoinVisualizationFactory::renderOffscreenRgbDepthPointcloud ( RobotNodePtr  camNode,
SoNode *  scene,
short  width,
short  height,
bool  renderRgbImage,
std::vector< unsigned char > &  rgbImage,
bool  renderDepthImgae,
std::vector< float > &  depthImage,
bool  renderPointcloud,
std::vector< Eigen::Vector3f > &  pointCloud,
float  zNear = 10.f,
float  zFar = 100000.f,
float  vertFov = M_PI / 4,
float  nanValue = NAN 
)
static

Renders the given scene from the given cam position and outputs (optionally) the rgb image, depth image and point cloud.

Parameters
camNodeThe node of the robot that defines the position of the camera. Any node of the robot can host a camera.
sceneThe scene that should be rendered.
widthThe used image width. (>0)
heightThe used image height. (>0)
renderRgbImageWhether to output the rgb image.
rgbImageThe rgb image's output parameter.
renderDepthImgaeWhether to output the depth image.
depthImageThe depth image's output parameter.
renderPointcloudWhether to output the point cloud.
pointCloudThe pointcloud's output parameter.
zNearThe near plane's distance.
zFarThe far plane's distance
vertFovThe fov in rad. (vertical)
nanValueAll values above the zFar value will be mapped on this value (usually nan or 0)
Returns
true on success

◆ renderOffscreenRgbDepthPointcloud() [2/4]

bool VirtualRobot::CoinVisualizationFactory::renderOffscreenRgbDepthPointcloud ( SoOffscreenRenderer *  renderer,
RobotNodePtr  camNode,
SoNode *  scene,
short  width,
short  height,
bool  renderRgbImage,
std::vector< unsigned char > &  rgbImage,
bool  renderDepthImage,
std::vector< float > &  depthImage,
bool  renderPointcloud,
std::vector< Eigen::Vector3f > &  pointCloud,
float  zNear = 10.f,
float  zFar = 100000.f,
float  vertFov = M_PI / 4,
float  nanValue = NAN 
)
static

Renders the given scene from the given cam position and outputs (optionally) the rgb image, depth image and point cloud. This version is much faster if always the same SoOffscreenRenderer is passed in.

Parameters
camNodeThe node of the robot that defines the position of the camera. Any node of the robot can host a camera.
sceneThe scene that should be rendered.
widthThe used image width. (>0)
heightThe used image height. (>0)
renderRgbImageWhether to output the rgb image.
rgbImageThe rgb image's output parameter.
renderDepthImgaeWhether to output the depth image.
depthImageThe depth image's output parameter.
renderPointcloudWhether to output the point cloud.
pointCloudThe pointcloud's output parameter.
zNearThe near plane's distance.
zFarThe far plane's distance
vertFovThe fov in rad. (vertical)
nanValueAll values above the zFar value will be mapped on this value (usually nan or 0)
Returns
true on success

◆ renderOffscreenRgbDepthPointcloud() [3/4]

bool VirtualRobot::CoinVisualizationFactory::renderOffscreenRgbDepthPointcloud ( SoOffscreenRenderer *  renderer,
const Eigen::Matrix4f  camPose,
SoNode *  scene,
short  width,
short  height,
bool  renderRgbImage,
std::vector< unsigned char > &  rgbImage,
bool  renderDepthImage,
std::vector< float > &  depthImage,
bool  renderPointcloud,
std::vector< Eigen::Vector3f > &  pointCloud,
float  zNear = 10.f,
float  zFar = 100000.f,
float  vertFov = M_PI / 4,
float  nanValue = NAN 
)
static

TODO find way to only render rgb once

◆ renderOffscreenRgbDepthPointcloud() [4/4]

static bool VirtualRobot::CoinVisualizationFactory::renderOffscreenRgbDepthPointcloud ( RobotNodePtr  camNode,
SoNode *  scene,
short  width,
short  height,
std::vector< unsigned char > &  rgbImage,
std::vector< float > &  depthImage,
std::vector< Eigen::Vector3f > &  pointCloud,
float  zNear = 10.f,
float  zFar = 100000.f,
float  vertFov = M_PI / 4,
float  nanValue = NAN 
)
inlinestatic

Renders the given scene from the given cam position and outputs the rgb image, depth image and point cloud.

Parameters
camNodeThe node of the robot that defines the position of the camera. Any node of the robot can host a camera.
sceneThe scene that should be rendered.
widthThe used image width. (>0)
heightThe used image height. (>0)
renderRgbImageWhether to output the rgb image.
rgbImageThe rgb image's output parameter.
renderDepthImgaeWhether to output the depth image.
depthImageThe depth image's output parameter.
renderPointcloudWhether to output the point cloud.
pointCloudThe pointcloud's output parameter.
zNearThe near plane's distance.
zFarThe far plane's distance
vertFovThe fov in rad. (vertical)
nanValueAll values above the zFar value will be mapped on this value (usually nan or 0)
Returns
true on success