22 #ifndef ADVANCEDVISUALIZATIONFACTORY_H
23 #define ADVANCEDVISUALIZATIONFACTORY_H
27 #include <VirtualRobot/Robot.h>
29 #include <VirtualRobot/Visualization/VisualizationFactory.h>
33 #include <VirtualRobot/Visualization/VisualizationNode.h>
35 #include <VirtualRobot/Primitive.h>
37 #include "VirtualRobot/MathTools.h"
39 #include "VirtualRobot/Trajectory.h"
41 #include "VirtualRobot/Visualization/TriMeshModel.h"
43 #include "VirtualRobot/BoundingBox.h"
65 virtual void init(
int& argc,
char* argv[],
const std::string& appName)
override
69 virtual VirtualRobot::VisualizationNodePtr
getVisualizationFromPrimitives(
const std::vector<VirtualRobot::Primitive::PrimitivePtr>& primitives,
bool boundingBox =
false,
Color color = Color::Gray())
override
71 return component.getVisualizationFromPrimitives(primitives, boundingBox, color);
73 virtual VirtualRobot::VisualizationNodePtr
getVisualizationFromFile(
const std::string&
filename,
bool boundingBox =
false,
float scaleX = 1.0f,
float scaleY = 1.0f,
float scaleZ = 1.0f)
override
75 return component.getVisualizationFromFile(
filename, boundingBox, scaleX, scaleY, scaleZ);
77 virtual VirtualRobot::VisualizationNodePtr
getVisualizationFromFile(
const std::ifstream& ifs,
bool boundingBox =
false,
float scaleX = 1.0f,
float scaleY = 1.0f,
float scaleZ = 1.0f)
override
79 return component.getVisualizationFromFile(ifs, boundingBox, scaleX, scaleY, scaleZ);
82 virtual VirtualRobot::VisualizationNodePtr
createBox(
float width,
float height,
float depth,
float colorR = 0.5f,
float colorG = 0.5f,
float colorB = 0.5f)
override
84 return component.createBox(width, height, depth, colorR, colorG, colorB);
86 virtual VirtualRobot::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
88 return component.createLine(from, to, width, colorR, colorG, colorB);
92 return component.createLine(from, to, width, colorR, colorG, colorB);
94 virtual VirtualRobot::VisualizationNodePtr
createSphere(
float radius,
float colorR = 0.5f,
float colorG = 0.5f,
float colorB = 0.5f)
override
96 return component.createSphere(radius, colorR, colorG, colorB);
98 virtual VirtualRobot::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
100 return component.createCircle(radius, circleCompletion, width, colorR, colorG, colorB, numberOfCircleParts);
103 virtual VirtualRobot::VisualizationNodePtr
createTorus(
float radius,
float tubeRadius,
float completion = 1.0f,
float colorR = 0.5f,
float colorG = 0.5f,
float colorB = 0.5f,
float transparency = 0.0f,
int sides = 8,
int rings = 30)
override
105 return component.createTorus(radius, tubeRadius, completion, colorR, colorG, colorB, transparency, sides, rings);
108 virtual VirtualRobot::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
110 return component.createCircleArrow(radius, tubeRadius, completion, colorR, colorG, colorB, transparency, sides, rings);
113 virtual VirtualRobot::VisualizationNodePtr
createCylinder(
float radius,
float height,
float colorR = 0.5f,
float colorG = 0.5f,
float colorB = 0.5f)
override
115 return component.createCylinder(radius, height, colorR, colorG, colorB);
117 virtual VirtualRobot::VisualizationNodePtr
createCoordSystem(
float scaling = 1.0f, std::string* text = NULL,
float axisLength = 100.0f,
float axisSize = 3.0f,
int nrOfBlocks = 10)
override
119 return component.createCoordSystem(scaling, text, axisLength, axisSize, nrOfBlocks);
121 virtual VirtualRobot::VisualizationNodePtr
createBoundingBox(
const VirtualRobot::BoundingBox& bbox,
bool wireFrame =
false)
override
123 return component.createBoundingBox(bbox, wireFrame);
125 virtual VirtualRobot::VisualizationNodePtr
createVertexVisualization(
const Eigen::Vector3f& position,
float radius,
float transparency,
float colorR = 0.5f,
float colorG = 0.5f,
float colorB = 0.5f)
override
127 return component.createVertexVisualization(position, radius, transparency, colorR, colorG, colorB);
132 return component.createTriMeshModelVisualization(model, pose, scaleX, scaleY, scaleZ);
137 return component.createTriMeshModelVisualization(model, showNormals, pose, showLines);
139 virtual VirtualRobot::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
141 return component.createPlane(position, normal, extend, transparency, colorR, colorG, colorB);
143 virtual VirtualRobot::VisualizationNodePtr
createPlane(
const VirtualRobot::MathTools::Plane& plane,
float extend,
float transparency,
float colorR = 0.5f,
float colorG = 0.5f,
float colorB = 0.5f)
override
145 return component.createPlane(plane, extend, transparency, colorR, colorG, colorB);
147 virtual VirtualRobot::VisualizationNodePtr
createArrow(
const Eigen::Vector3f& n,
float length = 50.0f,
float width = 2.0f,
const Color& color = Color::Gray())
override
149 return component.createArrow(n, length, width, color);
153 return component.createTrajectory(t, colorNode, colorLine, nodeSize, lineSize);
155 virtual VirtualRobot::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
157 return component.createText(text, billboard, scaling,
c, offsetX, offsetY, offsetZ);
160 virtual VirtualRobot::VisualizationNodePtr
createEllipse(
float x,
float y,
float z,
bool showAxes =
true,
float axesHeight = 4.0f,
float axesWidth = 8.0f)
override
162 return component.createEllipse(x, y, z, showAxes, axesHeight, axesWidth);
171 virtual VirtualRobot::VisualizationNodePtr
createUnitedVisualization(
const std::vector<VirtualRobot::VisualizationNodePtr>& visualizations)
const override
173 return component.createUnitedVisualization(visualizations);
181 virtual VirtualRobot::VisualizationNodePtr
createCurve(
const std::vector<PoseBasePtr> transition,
bool highligt);