GLOW API version 1.0 reference

Back to
Table of contents


class GlowViewTransform

General information

type: class
inherits: GlowComponent
module: glowViewTransform

GlowViewTransform is a component that causes its children to be drawn with a 3D transform applied. The transform itself is specified by a GlowTransformData object. This component is similar to a VRML transform node, and can be used to create a scene graph using GLOW components. Another use for this component is for implementing a slave to a GlowViewManipulator. By pointing a GlowViewTransform to the manipulator's transform data, you can cause the transform to match the manipulator's motion.

GLOW programs that render 3D scenes may find GlowViewTransform useful for managing 3D transforms.

Methods

Constructors and destructor

GlowViewTransform(GlowComponent* parent, const GlowViewTransformParams& params)

Creates a new GlowViewTransform using the given params, and locates it underneath parent in the component hierarchy.

GlowViewTransform(void)

Creates a new GlowViewTransform but does not initialize it. A component created in this way may not be used until its Init() method is called.

void Init(GlowComponent* parent, const GlowViewTransformParams& params)

Initializes a new GlowViewTransform using the given params, and locates it underneath parent in the component hierarchy.

virtual ~GlowViewTransform(void)

The destructor for GlowViewTransform also recursively deletes the components's children in the hierarchy.

Transform data methods
These methods essentially just call the corresponding methods on the current transform data object. They are duplicated in GlowViewTransform for convenience.

void Set(const Vec3f& trans, const Quatf& rot, GLfloat scale)

Sets the current transform.

void SetTranslation(const Vec3f& trans)

Sets the current translation vector on the transform data.

void SetRotation(const Quatf& rot)

Sets the current rotation quaternion on the transform data.

void SetScale(GLfloat scale)

Sets the current scale factor on the transform data.

void SetIdentity(void)

Sets the transform data to the identity transform.

void AddTranslation(const Vec3f& trans)

Adds the given translation vector to the transform data.

void AddRotation(const Quatf& rot)

Adds the given rotation quaternion to the transform data.

void AddScale(GLfloat scale)

Adds the given scale factor to the transform data.

const Vec3f& GetTranslation(void) const

Returns the current translation vector of the transform data.

const Quatf& GetRotation(void) const

Returns the current rotation quaternion of the transform data.

GLfloat GetScale(void) const

Returns the current scale factor of the transform data.

Vec3f Apply(const Vec3f& vec) const

Returns the result of applying the current transform to the given vector.

Vec3f ApplyInverse(const Vec3f& vec) const

Returns the result of applying the inverse of the current transform to the given vector.

void ApplyToGLMatrix(void) const

Multiplies the current OpenGL matrix by the current transform.

void ApplyInverseToGLMatrix(void) const

Multiplies the current OpenGL matrix by the inverse of the current transform.

void GetGLMatrixf(GLfloat* matrix) const

Sets matrix[0] through matrix[15] to the matrix representing the current transform, in OpenGL (column-major) order.

void GetMatrix(Mat4f& matrix) const

Sets matrix to the matrix representing the current transform.

bool IsSpinning(void) const

Returns true if the transform data is currently spinning.

void StartSpinning(const Quatf& spin)

Starts the transform spinning, using the given quaternion as the delta rotation.

void StopSpinning(void)

Stops spinning.

void StepSpin(void)

Advances the spin one step. Normally this is called automatically during idle time when spinning is on, so you do not need to call it manually.

Transform data object management

GlowTransformData* TransformData(void) const

Returns the transform data object currently used by this transform component.

void ConnectTo(GlowTransformData* transform)

Uses the given transform data instead of the current one.

void ConnectTo(GlowViewTransform* transform)

Uses the transform data associatedd with the given view transform.

void Disconnect(void)

Disconnects from the current transform data, and creates a new one.

void RefreshAllConnected(void)

Refreshes all GlowViewTransforms that are connected to this transform's data.

Inherited methods
These methods are inherited from GlowComponent.

void Close(void)

GlowComponent* Parent(void) const

GlowSubwindow* WhichWindow(void)

GlowSubwindow* ParentWindow(void) const

GlowWindow* ToplevelWindow(void)

bool IsToplevel(void) const

GlowComponent* Next(void) const

GlowComponent* Prev(void) const

int NumChildren(void) const

GlowComponent* FirstChild(void) const

GlowComponent* LastChild(void) const

void ReorderChild(GlowComponent* child, GlowComponent* pos)

void KillChildren(void)

void Activate(void)

void Deactivate(void)

bool IsActive(void)

bool IsInactive(void)

bool IsActiveStandby(void)

void Paint(void)

Overrideable methods

Inherited methods
These methods are inherited from GlowComponent.

virtual void OnActivate(void)

virtual void OnDeactivate(void)

virtual void OnBeginPaint(void)

This method is overridden by GlowViewTransform to perform the OpenGL transformations. You should not normally override it again.

virtual void OnEndPaint(void)

This method is overridden by GlowViewTransform to perform the OpenGL transformations. You should not normally override it again.

Back to
Table of contents


The GLOW Toolkit