BALL 1.5.0
Loading...
Searching...
No Matches
BALL::VIEW::XML3DRenderer Class Reference

#include <BALL/VIEW/RENDERING/RENDERERS/XML3DRenderer.h>

Inheritance diagram for BALL::VIEW::XML3DRenderer:
BALL::VIEW::Renderer

Classes

struct  XML3DRendererClippingPlane
 

Public Member Functions

Constructors and Destructors.
 XML3DRenderer ()
 Default constructor.
 
 XML3DRenderer (const String &name)
 
 XML3DRenderer (std::ostream &name)
 
 XML3DRenderer (const XML3DRenderer &renderer)
 
virtual ~XML3DRenderer ()
 Destructor.
 
virtual void clear ()
 Clear method.
 
Accessors
virtual void setSize (float width, float height)
 Set the size of the display.
 
void setFileName (const String &name)
 
void setOstream (std::ostream &out_stream)
 Set a stream as output device.
 
void setHumanReadable (bool state)
 
bool isHumanReadable () const
 
String XML3DColorRGBA (const ColorRGBA &input, const String &name)
 
String XML3DFinish (const String &object, const ColorRGBA &input)
 
String XML3DRaytracingMaterial (const Stage::Material &)
 
String XML3DVector3 (Vector3 input)
 
String XML3DString (const String &input)
 
virtual bool renderOneRepresentation (const Representation &representation)
 
- Public Member Functions inherited from BALL::VIEW::Renderer
 Renderer ()
 
 Renderer (const Renderer &renderer)
 
virtual ~Renderer ()
 
virtual void setLights (bool reset_all=false)
 Set the light sources according to the stage.
 
virtual void updateCamera (const Camera *camera=0)
 
virtual void updateMaterialForRepresentation (Representation const *)
 
virtual void updateBackgroundColor ()
 Update the background color from the stage.
 
virtual void setupEnvironmentMap (const QImage &image)
 Setup an environment map.
 
virtual void setupStereo (float eye_separation, float focal_length)
 
virtual void useContinuousLoop (bool use_loop)
 
bool isContinuous ()
 
virtual bool hasFPScounter ()
 
virtual double getFPS ()
 
virtual Vector3 mapViewportTo3D (Position x, Position y)
 
virtual Vector2 map3DToViewport (const Vector3 &vec)
 
virtual void pickObjects (Position x1, Position y1, Position x2, Position y2, std::list< GeometricObject * > &objects)
 
virtual void getFrustum (float &near_f, float &far_f, float &left_f, float &right_f, float &top_f, float &bottom_f)
 
virtual void bufferRepresentation (const Representation &)
 
virtual void removeRepresentation (const Representation &)
 
virtual const StagegetStage () const
 
virtual void setStage (const Stage &stage)
 
bool hasStage () const
 Test if a Stage was assigned to the Renderer.
 
virtual float getWidth () const
 
virtual float getHeight () const
 
virtual void setPreviewMode (bool show_preview)
 
virtual void showLightSources (bool show_light_sources)
 
virtual void renderRuler ()
 
virtual void setStereoMode (StereoMode state)
 
virtual StereoMode getStereoMode () const
 
virtual void setStereoFrustumConversion (int width_factor, int height_factor)
 
bool operator== (const Renderer &) const
 
virtual void render_ (const GeometricObject *object)
 Wrapper for the renderering of special GeometricObjects.
 

Processor specific methods

typedef HashMap< String, SizeColorMap
 
std::ostream * outfile_
 
Vector3 origin_
 
Matrix4x4 rotation_
 
vector< ClippingPlane * > clipping_planes_
 
bool human_readable_
 
ColorMap color_map_
 
vector< const Representation * > representations_
 
HashSet< const Mesh * > wireframes_
 
HashSet< Stringcolor_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_
 
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)
 Render a sphere.
 
void renderDisc_ (const Disc &)
 Render a disc.
 
void renderTube_ (const Tube &)
 Render a tube.
 
void renderTwoColoredTube_ (const TwoColoredTube &tube)
 Render a tube with two colors.
 
void renderMesh_ (const Mesh &mesh)
 Render a surface mesh.
 
void renderTwoColoredLine_ (const TwoColoredLine &)
 Render a line with two colors.
 
void renderLine_ (const Line &)
 Render a line.
 
void renderPoint_ (const Point &)
 Render a single point.
 
void renderLabel_ (const Label &)
 
virtual void renderMultiLine_ (const MultiLine &line)
 Render an illuminated line.
 
const ColorRGBAgetColor_ (const GeometricObject &object)
 
String trimFloatValue_ (float value)
 
void storeColor_ (const GeometricObject &object)
 
String getColorIndex_ (const ColorRGBA &color)
 
void createTubeTransform_ (const TwoColoredTube &tube)
 
void createSphereTemplate_ ()
 

Additional Inherited Members

- Public Types inherited from BALL::VIEW::Renderer
enum  StereoMode {
  NO_STEREO = 0 , ACTIVE_STEREO , DUAL_VIEW_STEREO , DUAL_VIEW_DIFFERENT_DISPLAY_STEREO ,
  TOP_BOTTOM_STEREO , INTERLACED_STEREO
}
 
- Protected Member Functions inherited from BALL::VIEW::Renderer
virtual void renderClippingPlane_ (const ClippingPlane &)
 
virtual void renderBox_ (const Box &)
 Render a box.
 
virtual void renderSimpleBox_ (const SimpleBox &)
 Render a simple box (parallel to the axes)
 
virtual void renderGridVisualisation_ (const GridVisualisation &)
 Render a grid.
 
virtual void renderQuadMesh_ (const QuadMesh &)
 Render a quad mesh.
 
- Protected Attributes inherited from BALL::VIEW::Renderer
Scenescene_
 
const Stagestage_
 
float width_
 
float height_
 
bool show_preview_
 
float volume_width_
 
bool show_light_sources_
 
Camera camera_
 
Vector3 camera_offset_
 
bool use_continuous_loop_
 
Size stereo_frustum_conversion_width_
 
Size stereo_frustum_conversion_height_
 
StereoMode stereo_
 

Detailed Description

XML3DRenderer class. This class walks over all the geometric primitives in a Scene and exports them into a data file in the XML3DRay 1.5 format, which can be used to render the same scene externally.

Deprecated
Incompatible with recent XML3D versions

Definition at line 43 of file XML3DRenderer.h.

Member Typedef Documentation

◆ ColorMap

Definition at line 193 of file XML3DRenderer.h.

Constructor & Destructor Documentation

◆ XML3DRenderer() [1/4]

BALL::VIEW::XML3DRenderer::XML3DRenderer ( )

Default constructor.

◆ XML3DRenderer() [2/4]

BALL::VIEW::XML3DRenderer::XML3DRenderer ( const String & name)

Detailed constructor.

Parameters
nameThe name of the file we will create
Exceptions
BALL::Exception::FileNotFound

◆ XML3DRenderer() [3/4]

BALL::VIEW::XML3DRenderer::XML3DRenderer ( std::ostream & name)

◆ XML3DRenderer() [4/4]

BALL::VIEW::XML3DRenderer::XML3DRenderer ( const XML3DRenderer & renderer)

◆ ~XML3DRenderer()

virtual BALL::VIEW::XML3DRenderer::~XML3DRenderer ( )
virtual

Destructor.

Member Function Documentation

◆ clear()

virtual void BALL::VIEW::XML3DRenderer::clear ( )
virtual

Clear method.

Reimplemented from BALL::VIEW::Renderer.

◆ createSphereTemplate_()

void BALL::VIEW::XML3DRenderer::createSphereTemplate_ ( )
protected

◆ createTubeTransform_()

void BALL::VIEW::XML3DRenderer::createTubeTransform_ ( const TwoColoredTube & tube)
protected

◆ createXHTMLFooter()

void BALL::VIEW::XML3DRenderer::createXHTMLFooter ( )

◆ createXHTMLHeader()

void BALL::VIEW::XML3DRenderer::createXHTMLHeader ( )

◆ finish()

virtual bool BALL::VIEW::XML3DRenderer::finish ( )
virtual

Finish method. This method writes the ending of the file and closes it.

Reimplemented from BALL::VIEW::Renderer.

◆ getColor_()

const ColorRGBA & BALL::VIEW::XML3DRenderer::getColor_ ( const GeometricObject & object)
protected

◆ getColorIndex_()

String BALL::VIEW::XML3DRenderer::getColorIndex_ ( const ColorRGBA & color)
protected

◆ init() [1/2]

virtual bool BALL::VIEW::XML3DRenderer::init ( const Stage & stage,
float width,
float height )
virtual

Start method. This method creates the file and writes the header.

Reimplemented from BALL::VIEW::Renderer.

◆ init() [2/2]

virtual bool BALL::VIEW::XML3DRenderer::init ( Scene & scene)
virtual

Initialization routine.

Reimplemented from BALL::VIEW::Renderer.

◆ isHumanReadable()

bool BALL::VIEW::XML3DRenderer::isHumanReadable ( ) const
inline

Definition at line 103 of file XML3DRenderer.h.

◆ renderDisc_()

void BALL::VIEW::XML3DRenderer::renderDisc_ ( const Disc & )
virtual

Render a disc.

Reimplemented from BALL::VIEW::Renderer.

◆ renderLabel_()

void BALL::VIEW::XML3DRenderer::renderLabel_ ( const Label & )
virtual

Reimplemented from BALL::VIEW::Renderer.

◆ renderLine_()

void BALL::VIEW::XML3DRenderer::renderLine_ ( const Line & )
virtual

Render a line.

Reimplemented from BALL::VIEW::Renderer.

◆ renderMesh_()

void BALL::VIEW::XML3DRenderer::renderMesh_ ( const Mesh & )
virtual

Render a surface mesh.

Reimplemented from BALL::VIEW::Renderer.

◆ renderMultiLine_()

virtual void BALL::VIEW::XML3DRenderer::renderMultiLine_ ( const MultiLine & line)
virtual

Render an illuminated line.

Reimplemented from BALL::VIEW::Renderer.

◆ renderOneRepresentation()

virtual bool BALL::VIEW::XML3DRenderer::renderOneRepresentation ( const Representation & representation)
virtual

Render a Representation.

Reimplemented from BALL::VIEW::Renderer.

◆ renderPoint_()

void BALL::VIEW::XML3DRenderer::renderPoint_ ( const Point & )
virtual

Render a single point.

Reimplemented from BALL::VIEW::Renderer.

◆ renderSphere_()

void BALL::VIEW::XML3DRenderer::renderSphere_ ( const Sphere & )
virtual

Render a sphere.

Reimplemented from BALL::VIEW::Renderer.

◆ renderTube_()

void BALL::VIEW::XML3DRenderer::renderTube_ ( const Tube & )
virtual

Render a tube.

Reimplemented from BALL::VIEW::Renderer.

◆ renderTwoColoredLine_()

void BALL::VIEW::XML3DRenderer::renderTwoColoredLine_ ( const TwoColoredLine & )
virtual

Render a line with two colors.

Reimplemented from BALL::VIEW::Renderer.

◆ renderTwoColoredTube_()

void BALL::VIEW::XML3DRenderer::renderTwoColoredTube_ ( const TwoColoredTube & )
virtual

Render a tube with two colors.

Reimplemented from BALL::VIEW::Renderer.

◆ setFileName()

void BALL::VIEW::XML3DRenderer::setFileName ( const String & name)

Sets the name of the file we will create.

Parameters
nameThe file name
Exceptions
BALL::Exception::FileNotFound

◆ setHumanReadable()

void BALL::VIEW::XML3DRenderer::setHumanReadable ( bool state)
inline

Definition at line 99 of file XML3DRenderer.h.

◆ setOstream()

void BALL::VIEW::XML3DRenderer::setOstream ( std::ostream & out_stream)

Set a stream as output device.

◆ setSize()

virtual void BALL::VIEW::XML3DRenderer::setSize ( float width,
float height )
virtual

Set the size of the display.

Reimplemented from BALL::VIEW::Renderer.

◆ storeColor_()

void BALL::VIEW::XML3DRenderer::storeColor_ ( const GeometricObject & object)
protected

◆ trimFloatValue_()

String BALL::VIEW::XML3DRenderer::trimFloatValue_ ( float value)
protected

◆ XML3DColorRGBA()

String BALL::VIEW::XML3DRenderer::XML3DColorRGBA ( const ColorRGBA & input,
const String & name )

Converts a ColorRGBA into a String in XML3D format.

◆ XML3DFinish()

String BALL::VIEW::XML3DRenderer::XML3DFinish ( const String & object,
const ColorRGBA & input )

Returns the corresponding BALLFinish declaration

◆ XML3DRaytracingMaterial()

String BALL::VIEW::XML3DRenderer::XML3DRaytracingMaterial ( const Stage::Material & )

Converts an Material into the corresponding shader properties.

◆ XML3DString()

String BALL::VIEW::XML3DRenderer::XML3DString ( const String & input)

Prepare Strings for XML3D

◆ XML3DVector3()

String BALL::VIEW::XML3DRenderer::XML3DVector3 ( Vector3 input)

Converts a Vector3 into a String in XML3DRay format.

Member Data Documentation

◆ clipping_planes_

vector<ClippingPlane*> BALL::VIEW::XML3DRenderer::clipping_planes_
protected

Definition at line 190 of file XML3DRenderer.h.

◆ color_index_

Position BALL::VIEW::XML3DRenderer::color_index_
protected

Definition at line 199 of file XML3DRenderer.h.

◆ color_map_

ColorMap BALL::VIEW::XML3DRenderer::color_map_
protected

Definition at line 194 of file XML3DRenderer.h.

◆ color_strings_

HashSet<String> BALL::VIEW::XML3DRenderer::color_strings_
protected

Definition at line 197 of file XML3DRenderer.h.

◆ create_XHTML_

bool BALL::VIEW::XML3DRenderer::create_XHTML_
protected

Definition at line 200 of file XML3DRenderer.h.

◆ current_sphere_number_

Index BALL::VIEW::XML3DRenderer::current_sphere_number_
protected

Definition at line 207 of file XML3DRenderer.h.

◆ current_tube_number_

Index BALL::VIEW::XML3DRenderer::current_tube_number_
protected

Definition at line 208 of file XML3DRenderer.h.

◆ fov_x_

float BALL::VIEW::XML3DRenderer::fov_x_
protected

Definition at line 210 of file XML3DRenderer.h.

◆ fov_y_

float BALL::VIEW::XML3DRenderer::fov_y_
protected

Definition at line 211 of file XML3DRenderer.h.

◆ human_readable_

bool BALL::VIEW::XML3DRenderer::human_readable_
protected

Definition at line 191 of file XML3DRenderer.h.

◆ m_

double BALL::VIEW::XML3DRenderer::m_[12]
protected

Definition at line 198 of file XML3DRenderer.h.

◆ origin_

Vector3 BALL::VIEW::XML3DRenderer::origin_
protected

Definition at line 188 of file XML3DRenderer.h.

◆ outfile_

std::ostream* BALL::VIEW::XML3DRenderer::outfile_
protected

Definition at line 180 of file XML3DRenderer.h.

◆ representations_

vector<const Representation*> BALL::VIEW::XML3DRenderer::representations_
protected

Definition at line 195 of file XML3DRenderer.h.

◆ rotation_

Matrix4x4 BALL::VIEW::XML3DRenderer::rotation_
protected

Definition at line 189 of file XML3DRenderer.h.

◆ rt_material_

Stage::Material BALL::VIEW::XML3DRenderer::rt_material_
protected

Definition at line 205 of file XML3DRenderer.h.

◆ sphere_template_

Surface BALL::VIEW::XML3DRenderer::sphere_template_
protected

Definition at line 202 of file XML3DRenderer.h.

◆ tube_template_

Surface BALL::VIEW::XML3DRenderer::tube_template_
protected

Definition at line 203 of file XML3DRenderer.h.

◆ wireframes_

HashSet<const Mesh*> BALL::VIEW::XML3DRenderer::wireframes_
protected

Definition at line 196 of file XML3DRenderer.h.