Loading...
Searching...
No Matches
XML3DRenderer.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_VIEW_RENDERING_RENDERERS_XML3DRENDERER_H
#define BALL_VIEW_RENDERING_RENDERERS_XML3DRENDERER_H
#ifndef BALL_VIEW_RENDERING_RENDERERS_RENDERER_H
# include <BALL/VIEW/RENDERING/RENDERERS/renderer.h>
#endif
#ifndef BALL_SYSTEM_FILE_H
# include <BALL/SYSTEM/file.h>
#endif
#ifndef BALL_MATHS_VECTOR3_H
# include <BALL/MATHS/vector3.h>
#endif
#ifndef BALL_MATHS_MATRIX44_H
# include <BALL/MATHS/matrix44.h>
#endif
#ifndef BALL_MATHS_SURFACE_H
# include <BALL/MATHS/surface.h>
#endif
namespace BALL
{
namespace VIEW
{
class ColorRGBA;
class ClippingPlane;
class BALL_DEPRECATED BALL_VIEW_EXPORT XML3DRenderer : public Renderer
{
public:
BALL_CREATE(XML3DRenderer)
struct XML3DRendererClippingPlane
{
public:
Vector3 normal;
float translation;
// Vector3 translation;
};
XML3DRenderer();
XML3DRenderer(const String& name);
XML3DRenderer(std::ostream& name);
// Only for Python
XML3DRenderer(const XML3DRenderer& renderer);
virtual ~XML3DRenderer();
virtual void clear();
virtual void setSize(float width, float height);
void setFileName(const String& name);
void setOstream(std::ostream& out_stream);
void setHumanReadable(bool state)
{ human_readable_ = state;}
bool isHumanReadable() const
{ return human_readable_;}
String XML3DColorRGBA(const ColorRGBA& input, const String& name);
String XML3DFinish(const String& object, const ColorRGBA& input);
String XML3DRaytracingMaterial(const Stage::Material& /* input */);
String XML3DVector3(Vector3 input);
String XML3DString(const String& input);
virtual bool renderOneRepresentation(const Representation& representation);
virtual bool init(Scene& scene);
virtual bool init(const Stage& stage, float width, float height);
virtual bool finish();
void createXHTMLHeader();
void createXHTMLFooter();
void renderSphere_(const Sphere& sphere);
void renderDisc_(const Disc& /* disc */);
void renderTube_(const Tube& /* tube */);
void renderTwoColoredTube_(const TwoColoredTube& tube);
void renderMesh_(const Mesh& mesh);
void renderTwoColoredLine_(const TwoColoredLine& /* line */);
void renderLine_(const Line& /* line */);
void renderPoint_(const Point& /* point */);
// do nothing
void renderLabel_(const Label&);
virtual void renderMultiLine_(const MultiLine& line);
protected:
const ColorRGBA& getColor_(const GeometricObject& object);
std::ostream* outfile_;
String trimFloatValue_(float value);
void storeColor_(const GeometricObject& object);
String getColorIndex_(const ColorRGBA& color);
void createTubeTransform_(const TwoColoredTube& tube);
void createSphereTemplate_();
Vector3 origin_;
Matrix4x4 rotation_;
vector<ClippingPlane*> clipping_planes_;
bool human_readable_;
typedef HashMap<String, Size> ColorMap;
ColorMap color_map_;
vector<const Representation*> representations_;
HashSet<const Mesh*> wireframes_;
HashSet<String> color_strings_;
double m_[12];
Position color_index_;
bool create_XHTML_;
Surface sphere_template_;
Surface tube_template_;
Stage::Material rt_material_;
Index current_sphere_number_;
Index current_tube_number_;
float fov_x_;
float fov_y_;
};
} // namespace BALL
} // namespace VIEW
#endif // BALL_VIEW_RENDERING_XML3DRENDERER_H
BALL_DEPRECATED
#define BALL_DEPRECATED
Definition COMMON/global.h:64
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition COMMON/global.h:52
BALL::HashMap
HashMap class based on the STL map (containing serveral convenience functions).
Definition hashMap.h:74
BALL::HashSet
Definition hashSet.h:46
BALL::String
Definition string.h:57
BALL::VIEW::ClippingPlane
Definition clippingPlane.h:26
BALL::VIEW::ColorRGBA
Definition colorRGBA.h:32
BALL::VIEW::Disc
Definition disc.h:32
BALL::VIEW::GeometricObject
Definition geometricObject.h:37
BALL::VIEW::Label
Definition label.h:48
BALL::VIEW::Line
Definition line.h:38
BALL::VIEW::Mesh
Definition mesh.h:42
BALL::VIEW::MultiLine
Definition multiLine.h:33
BALL::VIEW::Point
Definition point.h:37
BALL::VIEW::Renderer::Renderer
Renderer()
BALL::VIEW::Representation
Definition representation.h:59
BALL::VIEW::Scene
Definition scene.h:141
BALL::VIEW::Sphere
Definition sphere.h:33
BALL::VIEW::Stage::Material
Definition stage.h:246
BALL::VIEW::Stage
Definition stage.h:239
BALL::VIEW::Tube
Definition tube.h:40
BALL::VIEW::TwoColoredLine
Definition twoColoredLine.h:49
BALL::VIEW::TwoColoredTube
Definition twoColoredTube.h:49
BALL::VIEW::XML3DRenderer::createSphereTemplate_
void createSphereTemplate_()
BALL::VIEW::XML3DRenderer::XML3DRenderer
XML3DRenderer()
Default constructor.
BALL::VIEW::XML3DRenderer::color_index_
Position color_index_
Definition XML3DRenderer.h:199
BALL::VIEW::XML3DRenderer::renderLine_
void renderLine_(const Line &)
Render a line.
BALL::VIEW::XML3DRenderer::origin_
Vector3 origin_
Definition XML3DRenderer.h:188
BALL::VIEW::XML3DRenderer::create_XHTML_
bool create_XHTML_
Definition XML3DRenderer.h:200
BALL::VIEW::XML3DRenderer::getColorIndex_
String getColorIndex_(const ColorRGBA &color)
BALL::VIEW::XML3DRenderer::renderLabel_
void renderLabel_(const Label &)
BALL::VIEW::XML3DRenderer::XML3DRenderer
XML3DRenderer(const String &name)
BALL::VIEW::XML3DRenderer::human_readable_
bool human_readable_
Definition XML3DRenderer.h:191
BALL::VIEW::XML3DRenderer::renderTwoColoredTube_
void renderTwoColoredTube_(const TwoColoredTube &tube)
Render a tube with two colors.
BALL::VIEW::XML3DRenderer::renderSphere_
void renderSphere_(const Sphere &sphere)
Render a sphere.
BALL::VIEW::XML3DRenderer::color_map_
ColorMap color_map_
Definition XML3DRenderer.h:194
BALL::VIEW::XML3DRenderer::tube_template_
Surface tube_template_
Definition XML3DRenderer.h:203
BALL::VIEW::XML3DRenderer::XML3DRaytracingMaterial
String XML3DRaytracingMaterial(const Stage::Material &)
BALL::VIEW::XML3DRenderer::current_sphere_number_
Index current_sphere_number_
Definition XML3DRenderer.h:207
BALL::VIEW::XML3DRenderer::XML3DFinish
String XML3DFinish(const String &object, const ColorRGBA &input)
BALL::VIEW::XML3DRenderer::isHumanReadable
bool isHumanReadable() const
Definition XML3DRenderer.h:103
BALL::VIEW::XML3DRenderer::m_
double m_[12]
Definition XML3DRenderer.h:198
BALL::VIEW::XML3DRenderer::XML3DVector3
String XML3DVector3(Vector3 input)
BALL::VIEW::XML3DRenderer::fov_x_
float fov_x_
Definition XML3DRenderer.h:210
BALL::VIEW::XML3DRenderer::clipping_planes_
vector< ClippingPlane * > clipping_planes_
Definition XML3DRenderer.h:190
BALL::VIEW::XML3DRenderer::storeColor_
void storeColor_(const GeometricObject &object)
BALL::VIEW::XML3DRenderer::createTubeTransform_
void createTubeTransform_(const TwoColoredTube &tube)
BALL::VIEW::XML3DRenderer::clear
virtual void clear()
Clear method.
BALL::VIEW::XML3DRenderer::setOstream
void setOstream(std::ostream &out_stream)
Set a stream as output device.
BALL::VIEW::XML3DRenderer::XML3DRenderer
XML3DRenderer(const XML3DRenderer &renderer)
BALL::VIEW::XML3DRenderer::color_strings_
HashSet< String > color_strings_
Definition XML3DRenderer.h:197
BALL::VIEW::XML3DRenderer::renderPoint_
void renderPoint_(const Point &)
Render a single point.
BALL::VIEW::XML3DRenderer::renderOneRepresentation
virtual bool renderOneRepresentation(const Representation &representation)
BALL::VIEW::XML3DRenderer::XML3DColorRGBA
String XML3DColorRGBA(const ColorRGBA &input, const String &name)
BALL::VIEW::XML3DRenderer::fov_y_
float fov_y_
Definition XML3DRenderer.h:211
BALL::VIEW::XML3DRenderer::finish
virtual bool finish()
BALL::VIEW::XML3DRenderer::setFileName
void setFileName(const String &name)
BALL::VIEW::XML3DRenderer::createXHTMLFooter
void createXHTMLFooter()
BALL::VIEW::XML3DRenderer::getColor_
const ColorRGBA & getColor_(const GeometricObject &object)
BALL::VIEW::XML3DRenderer::renderDisc_
void renderDisc_(const Disc &)
Render a disc.
BALL::VIEW::XML3DRenderer::init
virtual bool init(Scene &scene)
BALL::VIEW::XML3DRenderer::XML3DRenderer
XML3DRenderer(std::ostream &name)
BALL::VIEW::XML3DRenderer::renderTube_
void renderTube_(const Tube &)
Render a tube.
BALL::VIEW::XML3DRenderer::renderMultiLine_
virtual void renderMultiLine_(const MultiLine &line)
Render an illuminated line.
BALL::VIEW::XML3DRenderer::ColorMap
HashMap< String, Size > ColorMap
Definition XML3DRenderer.h:193
BALL::VIEW::XML3DRenderer::wireframes_
HashSet< const Mesh * > wireframes_
Definition XML3DRenderer.h:196
BALL::VIEW::XML3DRenderer::rt_material_
Stage::Material rt_material_
Definition XML3DRenderer.h:205
BALL::VIEW::XML3DRenderer::trimFloatValue_
String trimFloatValue_(float value)
BALL::VIEW::XML3DRenderer::representations_
vector< const Representation * > representations_
Definition XML3DRenderer.h:195
BALL::VIEW::XML3DRenderer::current_tube_number_
Index current_tube_number_
Definition XML3DRenderer.h:208
BALL::VIEW::XML3DRenderer::renderTwoColoredLine_
void renderTwoColoredLine_(const TwoColoredLine &)
Render a line with two colors.
BALL::VIEW::XML3DRenderer::createXHTMLHeader
void createXHTMLHeader()
BALL::VIEW::XML3DRenderer::setSize
virtual void setSize(float width, float height)
Set the size of the display.
BALL::VIEW::XML3DRenderer::~XML3DRenderer
virtual ~XML3DRenderer()
Destructor.
BALL::VIEW::XML3DRenderer::sphere_template_
Surface sphere_template_
Definition XML3DRenderer.h:202
BALL::VIEW::XML3DRenderer::XML3DString
String XML3DString(const String &input)
BALL::VIEW::XML3DRenderer::init
virtual bool init(const Stage &stage, float width, float height)
BALL::VIEW::XML3DRenderer::outfile_
std::ostream * outfile_
Definition XML3DRenderer.h:180
BALL::VIEW::XML3DRenderer::rotation_
Matrix4x4 rotation_
Definition XML3DRenderer.h:189
BALL::VIEW::XML3DRenderer::renderMesh_
void renderMesh_(const Mesh &mesh)
Render a surface mesh.
BALL::VIEW::XML3DRenderer::setHumanReadable
void setHumanReadable(bool state)
Definition XML3DRenderer.h:99
BALL_CREATE
#define BALL_CREATE(name)
Definition create.h:62
file.h
BALL::Matrix4x4
TMatrix4x4< float > Matrix4x4
Definition matrix44.h:2184
BALL::Surface
TSurface< float > Surface
Definition surface.h:488
matrix44.h
BALL::VIEW
Definition constraints.h:35
BALL
Definition constants.h:13
BALL::Position
BALL_SIZE_TYPE Position
Definition COMMON/global.h:140
BALL::Vector3
TVector3< float > Vector3
Definition vector3.h:1084
BALL::Index
BALL_INDEX_TYPE Index
Definition COMMON/global.h:105
renderer.h
BALL::VIEW::XML3DRenderer::XML3DRendererClippingPlane
Definition XML3DRenderer.h:50
BALL::VIEW::XML3DRenderer::XML3DRendererClippingPlane::normal
Vector3 normal
Definition XML3DRenderer.h:52
BALL::VIEW::XML3DRenderer::XML3DRendererClippingPlane::translation
float translation
Definition XML3DRenderer.h:53
surface.h
vector3.h