scg3  0.6
scg::Transformation Class Reference

A transformation node to be used to appy a transformation to the sub-tree (composite node). More...

#include "Transformation.h"

Inheritance diagram for scg::Transformation:
[legend]
Collaboration diagram for scg::Transformation:
[legend]

Public Member Functions

 Transformation ()
 
virtual ~Transformation ()
 
const glm::mat4 & getMatrix () const
 
virtual TransformationsetMatrix (const glm::mat4 &matrix)
 
virtual Transformationtranslate (glm::vec3 translation)
 
virtual TransformationrotateRad (GLfloat angleRad, glm::vec3 axis)
 
virtual Transformationrotate (GLfloat angleDeg, glm::vec3 axis)
 
virtual Transformationscale (glm::vec3 scaling)
 
virtual void accept (Traverser *traverser)
 
virtual void acceptPost (Traverser *traverser)
 
virtual void render (RenderState *renderState)
 
virtual void renderPost (RenderState *renderState)
 
- Public Member Functions inherited from scg::Composite
 Composite ()
 
virtual ~Composite ()=0
 
virtual void destroy ()
 
CompositeaddChild (NodeSP child)
 
CompositeremoveChild (Node *node, bool &result)
 
CompositeremoveChild (Node *node)
 
virtual void traverse (Traverser *traverser)
 
- Public Member Functions inherited from scg::Node
 Node ()
 
virtual ~Node ()=0
 
virtual void clear ()
 
int getNCores () const
 
const std::string & getMetaInfo (const std::string &key) const
 
void setMetaInfo (const std::string &key, const std::string &value)
 
bool isVisible () const
 
void setVisible (bool isVisible=true)
 

Static Public Member Functions

static TransformationSP create ()
 

Protected Attributes

glm::mat4 matrix_
 
- Protected Attributes inherited from scg::Composite
NodeSP leftChild_
 
- Protected Attributes inherited from scg::Node
NodeSP rightSibling_
 
Compositeparent_
 
std::vector< CoreSPcores_
 
bool isVisible_
 
std::unordered_map< std::string, std::string > metaInfo_
 

Additional Inherited Members

- Protected Member Functions inherited from scg::Node
void addSibling_ (NodeSP sibling)
 
void removeSibling_ (Node *node, bool &result)
 
void processCores_ (RenderState *renderState)
 
void postProcessCores_ (RenderState *renderState)
 

Detailed Description

A transformation node to be used to appy a transformation to the sub-tree (composite node).

Examples
scg3_table_scene_example.cpp.

Definition at line 42 of file Transformation.h.

Constructor & Destructor Documentation

◆ Transformation()

scg::Transformation::Transformation ( )

Constructor.

◆ ~Transformation()

virtual scg::Transformation::~Transformation ( )
virtual

Destructor.

Member Function Documentation

◆ accept()

virtual void scg::Transformation::accept ( Traverser traverser)
virtual

Accept traverser (visitor pattern).

Reimplemented from scg::Node.

Reimplemented in scg::Camera.

◆ acceptPost()

virtual void scg::Transformation::acceptPost ( Traverser traverser)
virtual

Accept traverser after traversing sub-tree (visitor pattern).

Reimplemented from scg::Composite.

Reimplemented in scg::Camera.

◆ create()

static TransformationSP scg::Transformation::create ( )
static

Create shared pointer.

Examples
scg3_table_scene_example.cpp.

◆ getMatrix()

const glm::mat4& scg::Transformation::getMatrix ( ) const

Get transformation matrix.

◆ render()

virtual void scg::Transformation::render ( RenderState renderState)
virtual

Render transformation, i.e., post-multiply current model-view matrix by local matrix.

Reimplemented from scg::Node.

Reimplemented in scg::Camera, and scg::StereoCamera.

◆ renderPost()

virtual void scg::Transformation::renderPost ( RenderState renderState)
virtual

Render transformaton after traversing sub-tree, i.e., restore model-view matrix.

Reimplemented from scg::Composite.

Reimplemented in scg::Camera.

◆ rotate()

virtual Transformation* scg::Transformation::rotate ( GLfloat  angleDeg,
glm::vec3  axis 
)
inlinevirtual

Rotate subsequent geometry.

Parameters
angleDegrotation angle (degrees)
axisrotaton axis
Returns
this pointer for method chaining

Reimplemented in scg::Camera.

Definition at line 93 of file Transformation.h.

◆ rotateRad()

virtual Transformation* scg::Transformation::rotateRad ( GLfloat  angleRad,
glm::vec3  axis 
)
virtual

Rotate subsequent geometry.

Parameters
angleDegrotation angle (radians)
axisrotaton axis
Returns
this pointer for method chaining

Reimplemented in scg::Camera.

◆ scale()

virtual Transformation* scg::Transformation::scale ( glm::vec3  scaling)
virtual

Scale subsequent geometry.

Parameters
scalingscale factors in xyz directions
Returns
this pointer for method chaining

Reimplemented in scg::Camera.

◆ setMatrix()

virtual Transformation* scg::Transformation::setMatrix ( const glm::mat4 &  matrix)
virtual

Set transformation matrix.

Returns
this pointer for method chaining

Reimplemented in scg::Camera.

◆ translate()

virtual Transformation* scg::Transformation::translate ( glm::vec3  translation)
virtual

Translate subsequent geometry.

Parameters
translationtranlation vector
Returns
this pointer for method chaining

Reimplemented in scg::Camera.

Examples
scg3_table_scene_example.cpp.

Member Data Documentation

◆ matrix_

glm::mat4 scg::Transformation::matrix_
protected

Definition at line 127 of file Transformation.h.


The documentation for this class was generated from the following file: