Graphite  Version 3
An experimental 3D geometry processing program
OGF::Transform3d Class Reference

Controls a 3d transform by different means. More...

#include <OGF/scene_graph_gfx/transforms/transform3d.h>

Inheritance diagram for OGF::Transform3d:
OGF::Object GEO::Counted

Public Member Functions

 Transform3d ()
 Transform3d constructor.
 
 ~Transform3d () override
 Transform3d destructor.
 
void set_look_at (const vec3 &value)
 Sets the origin. More...
 
const vec3get_u () const
 Gets the u vector. More...
 
void set_u (const vec3 &value)
 Sets the u vector. More...
 
const vec3get_v () const
 Gets the v vector. More...
 
void set_v (const vec3 &value)
 Sets the v vector. More...
 
const vec3get_w () const
 Gets the w vector. More...
 
void set_w (const vec3 &value)
 Sets the w vector. More...
 
double get_delta_location () const
 Gets the increment for position changes. More...
 
void set_delta_location (double value)
 Sets the increment for position changes. More...
 
double get_delta_angle () const
 Gets the increment for angle changes. More...
 
void set_delta_angle (double value)
 Sets the increment for angle changes. More...
 
double get_zoom () const
 Gets the zooming factor. More...
 
void set_zoom (double value)
 Sets the zooming factor. More...
 
double get_delta_zoom () const
 Gets the increment for zooming. More...
 
void set_delta_zoom (double value)
 Sets the increment for zooming. More...
 
const mat4get_matrix () const
 Gets the current transform. More...
 
void set_matrix (const mat4 &value)
 Sets the current transform. More...
 
const mat4get_rotation_matrix () const
 Gets the rotational part of the current transform. More...
 
void set_rotation_matrix (const mat4 &value)
 Sets the rotational part of the current transform. More...
 
const vec3get_default_look_at () const
 Gets the default origin. More...
 
void set_default_look_at (const vec3 &value)
 Sets the default origin. More...
 
const vec3get_default_u () const
 Gets the default u vector. More...
 
void set_default_u (const vec3 &value)
 Sets the default u vector. More...
 
const vec3get_default_v () const
 Gets the default v vector. More...
 
void set_default_v (const vec3 &value)
 Sets the default v vector. More...
 
const vec3get_default_w () const
 Gets the default w vector. More...
 
void set_default_w (const vec3 &value)
 Sets the default w vector. More...
 
double get_default_zoom () const
 Gets the default zoom factor. More...
 
void set_default_zoom (double value)
 Sets the default zoom factor. More...
 
void move_left (double value=1.0)
 translates to the left, along the u vector. More...
 
void move_right (double value=1.0)
 translates to the right, along the u vector. More...
 
void move_up (double value=1.0)
 translates to the up, along the v vector. More...
 
void move_down (double value=1.0)
 translates to the bottom, along the v vector. More...
 
void move_forward (double value=1.0)
 translates to the front, along the w vector. More...
 
void move_backward (double value=1.0)
 translates to the back, along the w vector. More...
 
void turn_left (double value=1.0)
 Turn to the left. More...
 
void turn_right (double value=1.0)
 Turn to the right. More...
 
void tilt_up (double value=1.0)
 Tilt towards the up. More...
 
void tilt_down (double value=1.0)
 Tilt towards the bottom. More...
 
void tilt_left (double value=1.0)
 Tilt towards the left. More...
 
void tilt_right (double value=1.0)
 Tilt towards the right. More...
 
void translate (const vec3 &value)
 Applies a translation. More...
 
void rotate (const mat4 &value)
 Applies a rotation. More...
 
void zoom_in (double value=1.0)
 Zooms in. More...
 
void zoom_out (double value=1.0)
 Zooms out. More...
 
void zoom_mult (double value=1.0)
 Applies a scaling to the current zoom. More...
 
void rotation_changed (const mat4 &value)
 A signal that is triggered each time the rotational component of the transform changes. More...
 
- Public Member Functions inherited from OGF::Object
 Object (bool transient=false)
 Object constructor. More...
 
virtual ~Object ()
 Object destructor.
 
virtual MetaClassmeta_class () const
 Gets the meta class. More...
 
virtual void set_meta_class (MetaClass *mclass)
 Sets the meta class. More...
 
unsigned int id () const
 Gets the identifier of this object. More...
 
std::string string_id () const
 Gets the unique string identifier. More...
 
bool has_method (const std::string &method_name) const
 Tests whether a method is defined. More...
 
virtual bool invoke_method (const std::string &method_name, const ArgList &args, Any &ret_val)
 Invokes a method by method name and argument list, and gets the return value. More...
 
bool invoke_method (const std::string &method_name, const ArgList &args)
 Invokes a method by method name and argument list. More...
 
bool invoke_method (const std::string &method_name)
 Invokes a method by method name. More...
 
bool has_property (const std::string &prop_name) const
 Tests whether a property is defined. More...
 
virtual bool get_property (const std::string &prop_name, std::string &prop_value) const
 Gets a property. More...
 
virtual Connectionconnect_signal_to_slot (const std::string &signal_name, Object *to, const std::string &slot_name)
 Connects a signal with a slot of another object. More...
 
virtual void add_connection (Connection *connection)
 Adds a connection to this object. More...
 
virtual void remove_connection (Connection *connection)
 Removes a connection to this object. More...
 
virtual void get_element (index_t i, Any &value) const
 Gets an element by index. More...
 
virtual void set_element (index_t i, const Any &value)
 Sets an element by index. More...
 
virtual void search (const std::string &needle, const std::string &path="")
 Displays the names of all objects that contain a substring. More...
 
bool get_signals_enabled () const
 Tests wheter signals are enabled. More...
 
void set_signals_enabled (bool value)
 Enables or disables signals. More...
 
bool get_slots_enabled () const
 Tests wheter slots are enabled. More...
 
void set_slots_enabled (bool value)
 Enables or disables slots. More...
 
MetaClassget_meta_class () const
 Gets the meta class. More...
 
std::string get_string_id () const
 Gets the unique string identifier. More...
 
virtual std::string get_doc () const
 Gets the documentation. More...
 
virtual Sign compare (const Object *other) const
 Compares this object with another one. More...
 
virtual bool is_a (const MetaType *type) const
 Tests whether this object inherits a given type. More...
 
void disconnect ()
 Removes all connections from signals of this objects. More...
 
void enable_signals ()
 Enables signals.
 
void disable_signals ()
 Disables signals.
 
void enable_slots ()
 Enables slots.
 
void disable_slots ()
 Disables slots.
 
void set_properties (const ArgList &args)
 Sets several properties in a single call. More...
 
virtual bool set_property (const std::string &name, const std::string &value)
 Sets an individual property. More...
 
void help () const
 Displays some help about this object. More...
 
virtual bool set_property (const std::string &name, const Any &value)
 Sets an individual property. More...
 
virtual bool get_property (const std::string &prop_name, Any &prop_value) const
 Gets a property. More...
 
- Public Member Functions inherited from GEO::Counted
void ref () const
 Increments the reference count. More...
 
void unref () const
 Decrements the reference count. More...
 
bool is_shared () const
 Check if the object is shared. More...
 
int nb_refs () const
 Gets the number of references that point to this object. More...
 

Public Attributes

 __pad0__: const vec3& get_look_at() const { return look_at_
 
 __pad1__: void reset()
 
gom_signals __pad2__: void value_changed(const mat4& value)
 
- Public Attributes inherited from OGF::Object
 __pad0__: virtual index_t get_nb_elements() const
 
 __pad1__: bool equals(const Object* other) const
 

Protected Member Functions

void update_matrix (bool send_signal=true)
 Updates the matrix representation of the transform. More...
 
- Protected Member Functions inherited from OGF::Object
virtual bool emit_signal (const std::string &signal_name, const ArgList &args, bool called_from_slot=false)
 Emits a signal and calls the slots it is connected to. More...
 
- Protected Member Functions inherited from GEO::Counted
 Counted ()
 Creates a reference counted object. More...
 
virtual ~Counted ()
 Destroys a reference counted object. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from OGF::Object
static Objectid_to_object (unsigned int id)
 Gets an object from a unique object id. More...
 
- Static Public Member Functions inherited from GEO::Counted
static void ref (const Counted *counted)
 Increments the reference count. More...
 
static void unref (const Counted *counted)
 Decrements the reference count. More...
 

Detailed Description

Controls a 3d transform by different means.

Definition at line 58 of file transform3d.h.

Member Function Documentation

◆ get_default_look_at()

const vec3& OGF::Transform3d::get_default_look_at ( ) const
inline

Gets the default origin.

Returns
the default origin
See also
reset()

Definition at line 265 of file transform3d.h.

◆ get_default_u()

const vec3& OGF::Transform3d::get_default_u ( ) const
inline

Gets the default u vector.

Returns
the default u vector.
See also
reset()

Definition at line 283 of file transform3d.h.

◆ get_default_v()

const vec3& OGF::Transform3d::get_default_v ( ) const
inline

Gets the default v vector.

Returns
the default v vector.
See also
reset()

Definition at line 301 of file transform3d.h.

◆ get_default_w()

const vec3& OGF::Transform3d::get_default_w ( ) const
inline

Gets the default w vector.

Returns
the default w vector.
See also
reset()

Definition at line 319 of file transform3d.h.

◆ get_default_zoom()

double OGF::Transform3d::get_default_zoom ( ) const
inline

Gets the default zoom factor.

Returns
the default zoom factor
See also
reset()

Definition at line 337 of file transform3d.h.

◆ get_delta_angle()

double OGF::Transform3d::get_delta_angle ( ) const
inline

Gets the increment for angle changes.

Returns
the increment for angle changes
See also
turn_left(), turn_right(), tilt_left(), tilt_right(), tilt_up(), tilt_down()

Definition at line 175 of file transform3d.h.

◆ get_delta_location()

double OGF::Transform3d::get_delta_location ( ) const
inline

Gets the increment for position changes.

Returns
the increment for position changes
See also
move_up(), move_down(), move_right(), move_left(), move_forward(), move_backward()

Definition at line 153 of file transform3d.h.

◆ get_delta_zoom()

double OGF::Transform3d::get_delta_zoom ( ) const
inline

Gets the increment for zooming.

Returns
the increment for zooming
See also
zoom_in(), zoom_out()

Definition at line 212 of file transform3d.h.

◆ get_matrix()

const mat4& OGF::Transform3d::get_matrix ( ) const
inline

Gets the current transform.

Returns
the current transform, as a 4x4 homogeneous- coordinates matrix

Definition at line 230 of file transform3d.h.

◆ get_rotation_matrix()

const mat4& OGF::Transform3d::get_rotation_matrix ( ) const

Gets the rotational part of the current transform.

Returns
the rotational part of the current transform, as a 4x4 homogeneous-coordinates matrix (with zero translation)

◆ get_u()

const vec3& OGF::Transform3d::get_u ( ) const
inline

Gets the u vector.

The u vector points to the right.

Returns
the u vector

Definition at line 94 of file transform3d.h.

◆ get_v()

const vec3& OGF::Transform3d::get_v ( ) const
inline

Gets the v vector.

The v vector points to the top.

Returns
the v vector

Definition at line 113 of file transform3d.h.

◆ get_w()

const vec3& OGF::Transform3d::get_w ( ) const
inline

Gets the w vector.

The w vector points to the front.

Returns
the w vector

Definition at line 132 of file transform3d.h.

◆ get_zoom()

double OGF::Transform3d::get_zoom ( ) const
inline

Gets the zooming factor.

Returns
the zooming factor

Definition at line 194 of file transform3d.h.

◆ move_backward()

void OGF::Transform3d::move_backward ( double  value = 1.0)

translates to the back, along the w vector.

Parameters
[in]valuethe length of the displacement, that will be multiplied by delta_location before being applied.

◆ move_down()

void OGF::Transform3d::move_down ( double  value = 1.0)

translates to the bottom, along the v vector.

Parameters
[in]valuethe length of the displacement, that will be multiplied by delta_location before being applied.

◆ move_forward()

void OGF::Transform3d::move_forward ( double  value = 1.0)

translates to the front, along the w vector.

Parameters
[in]valuethe length of the displacement, that will be multiplied by delta_location before being applied.

◆ move_left()

void OGF::Transform3d::move_left ( double  value = 1.0)

translates to the left, along the u vector.

Parameters
[in]valuethe length of the displacement, that will be multiplied by delta_location before being applied.

◆ move_right()

void OGF::Transform3d::move_right ( double  value = 1.0)

translates to the right, along the u vector.

Parameters
[in]valuethe length of the displacement, that will be multiplied by delta_location before being applied.

◆ move_up()

void OGF::Transform3d::move_up ( double  value = 1.0)

translates to the up, along the v vector.

Parameters
[in]valuethe length of the displacement, that will be multiplied by delta_location before being applied.

◆ rotate()

void OGF::Transform3d::rotate ( const mat4 value)

Applies a rotation.

Parameters
[in]valuethe rotational part of the transform is composed with the specified rotation

◆ rotation_changed()

void OGF::Transform3d::rotation_changed ( const mat4 value)

A signal that is triggered each time the rotational component of the transform changes.

Parameters
[in]valuethe rotation, as a 4x4 homogeneous- coordinates matrix, with zero translation.

◆ set_default_look_at()

void OGF::Transform3d::set_default_look_at ( const vec3 value)
inline

Sets the default origin.

Parameters
[in]valuethe default origin
See also
reset()

Definition at line 274 of file transform3d.h.

◆ set_default_u()

void OGF::Transform3d::set_default_u ( const vec3 value)
inline

Sets the default u vector.

Parameters
[in]valuethe default u vector
See also
reset()

Definition at line 292 of file transform3d.h.

◆ set_default_v()

void OGF::Transform3d::set_default_v ( const vec3 value)
inline

Sets the default v vector.

Parameters
[in]valuethe default v vector
See also
reset()

Definition at line 310 of file transform3d.h.

◆ set_default_w()

void OGF::Transform3d::set_default_w ( const vec3 value)
inline

Sets the default w vector.

Parameters
[in]valuethe default w vector
See also
reset()

Definition at line 328 of file transform3d.h.

◆ set_default_zoom()

void OGF::Transform3d::set_default_zoom ( double  value)
inline

Sets the default zoom factor.

Parameters
[in]valuethe default zoom factor
See also
reset()

Definition at line 346 of file transform3d.h.

◆ set_delta_angle()

void OGF::Transform3d::set_delta_angle ( double  value)
inline

Sets the increment for angle changes.

Parameters
[in]valuethe increment for angle changes
See also
turn_left(), turn_right(), tilt_left(), tilt_right(), tilt_up(), tilt_down()

Definition at line 186 of file transform3d.h.

◆ set_delta_location()

void OGF::Transform3d::set_delta_location ( double  value)
inline

Sets the increment for position changes.

Parameters
[in]valuethe increment for position changes
See also
move_up(), move_down(), move_right(), move_left(), move_forward(), move_backward()

Definition at line 164 of file transform3d.h.

◆ set_delta_zoom()

void OGF::Transform3d::set_delta_zoom ( double  value)
inline

Sets the increment for zooming.

Parameters
[in]valuethe increment for zooming
See also
zoom_in(), zoom_out()

Definition at line 221 of file transform3d.h.

◆ set_look_at()

void OGF::Transform3d::set_look_at ( const vec3 value)
inline

Sets the origin.

Parameters
[in]valuethe origin

Definition at line 84 of file transform3d.h.

◆ set_matrix()

void OGF::Transform3d::set_matrix ( const mat4 value)
inline

Sets the current transform.

Parameters
[in]valuethe transform, as a 4x4 homogeneous- coordinates matrix \TODO compute u,v,w,lookat from matrix.

Definition at line 240 of file transform3d.h.

◆ set_rotation_matrix()

void OGF::Transform3d::set_rotation_matrix ( const mat4 value)

Sets the rotational part of the current transform.

Parameters
[in]valuethe rotational part to be set in the current transform, as a 4x4 homogeneous-coordinates matrix (with zero translation)

◆ set_u()

void OGF::Transform3d::set_u ( const vec3 value)
inline

Sets the u vector.

The u vector points to the right.

Parameters
[in]valuethe u vector

Definition at line 103 of file transform3d.h.

◆ set_v()

void OGF::Transform3d::set_v ( const vec3 value)
inline

Sets the v vector.

The v vector points to the top.

Parameters
[in]valuethe v vector

Definition at line 122 of file transform3d.h.

◆ set_w()

void OGF::Transform3d::set_w ( const vec3 value)
inline

Sets the w vector.

The w vector points to the front.

Parameters
[in]valuethe w vector

Definition at line 141 of file transform3d.h.

◆ set_zoom()

void OGF::Transform3d::set_zoom ( double  value)
inline

Sets the zooming factor.

Parameters
[in]valuethe zooming factor

Definition at line 202 of file transform3d.h.

◆ tilt_down()

void OGF::Transform3d::tilt_down ( double  value = 1.0)

Tilt towards the bottom.

Like pushing the stick in a plane.

Parameters
[in]valuethe rotation angle, multiplied by delta_angle before being applied \TODO not implemented yet!

◆ tilt_left()

void OGF::Transform3d::tilt_left ( double  value = 1.0)

Tilt towards the left.

Parameters
[in]valuethe rotation angle, multiplied by delta_angle before being applied \TODO not implemented yet!

◆ tilt_right()

void OGF::Transform3d::tilt_right ( double  value = 1.0)

Tilt towards the right.

Parameters
[in]valuethe rotation angle, multiplied by delta_angle before being applied \TODO not implemented yet!

◆ tilt_up()

void OGF::Transform3d::tilt_up ( double  value = 1.0)

Tilt towards the up.

Like pulling the stick in a plane.

Parameters
[in]valuethe rotation angle, multiplied by delta_angle before being applied \TODO not implemented yet!

◆ translate()

void OGF::Transform3d::translate ( const vec3 value)

Applies a translation.

This function is used to implement panning in Graphite's 3D view.

Parameters
[in]valuethe translation vector, only its X and Y components are used. They are multiplied by the zooming factor before beeing added to look_at.

◆ turn_left()

void OGF::Transform3d::turn_left ( double  value = 1.0)

Turn to the left.

Parameters
[in]valuethe rotation angle, multiplied by delta_angle before being applied \TODO not implemented yet!

◆ turn_right()

void OGF::Transform3d::turn_right ( double  value = 1.0)

Turn to the right.

Parameters
[in]valuethe rotation angle, multiplied by delta_angle before being applied \TODO not implemented yet!

◆ update_matrix()

void OGF::Transform3d::update_matrix ( bool  send_signal = true)
protected

Updates the matrix representation of the transform.

Parameters
[in]send_signalif true, value_changed() and rotation_changed() are triggered.

◆ zoom_in()

void OGF::Transform3d::zoom_in ( double  value = 1.0)

Zooms in.

Parameters
[in]valuenumber of times zooming factor is multiplied by delta_zoom.

◆ zoom_mult()

void OGF::Transform3d::zoom_mult ( double  value = 1.0)

Applies a scaling to the current zoom.

Parameters
[in]valuescaling applied to the current zooming factor.

◆ zoom_out()

void OGF::Transform3d::zoom_out ( double  value = 1.0)

Zooms out.

Parameters
[in]valuenumber of times zooming factor is divided by delta_zoom.

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