Graphite
Version 3
An experimental 3D geometry processing program
|
Controls a 3d transform by different means. More...
#include <OGF/scene_graph_gfx/transforms/transform3d.h>
Public Member Functions | |
Transform3d () | |
Transform3d constructor. | |
~Transform3d () override | |
Transform3d destructor. | |
void | set_look_at (const vec3 &value) |
Sets the origin. More... | |
const vec3 & | get_u () const |
Gets the u vector. More... | |
void | set_u (const vec3 &value) |
Sets the u vector. More... | |
const vec3 & | get_v () const |
Gets the v vector. More... | |
void | set_v (const vec3 &value) |
Sets the v vector. More... | |
const vec3 & | get_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 mat4 & | get_matrix () const |
Gets the current transform. More... | |
void | set_matrix (const mat4 &value) |
Sets the current transform. More... | |
const mat4 & | get_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 vec3 & | get_default_look_at () const |
Gets the default origin. More... | |
void | set_default_look_at (const vec3 &value) |
Sets the default origin. More... | |
const vec3 & | get_default_u () const |
Gets the default u vector. More... | |
void | set_default_u (const vec3 &value) |
Sets the default u vector. More... | |
const vec3 & | get_default_v () const |
Gets the default v vector. More... | |
void | set_default_v (const vec3 &value) |
Sets the default v vector. More... | |
const vec3 & | get_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 MetaClass * | meta_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 Connection * | connect_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... | |
MetaClass * | get_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 Object * | id_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... | |
Controls a 3d transform by different means.
Definition at line 58 of file transform3d.h.
|
inline |
Gets the default origin.
Definition at line 265 of file transform3d.h.
|
inline |
Gets the default u vector.
Definition at line 283 of file transform3d.h.
|
inline |
Gets the default v vector.
Definition at line 301 of file transform3d.h.
|
inline |
Gets the default w vector.
Definition at line 319 of file transform3d.h.
|
inline |
Gets the default zoom factor.
Definition at line 337 of file transform3d.h.
|
inline |
Gets the increment for angle changes.
Definition at line 175 of file transform3d.h.
|
inline |
Gets the increment for position changes.
Definition at line 153 of file transform3d.h.
|
inline |
Gets the increment for zooming.
Definition at line 212 of file transform3d.h.
|
inline |
Gets the current transform.
Definition at line 230 of file transform3d.h.
const mat4& OGF::Transform3d::get_rotation_matrix | ( | ) | const |
Gets the rotational part of the current transform.
|
inline |
Gets the u vector.
The u vector points to the right.
Definition at line 94 of file transform3d.h.
|
inline |
Gets the v vector.
The v vector points to the top.
Definition at line 113 of file transform3d.h.
|
inline |
Gets the w vector.
The w vector points to the front.
Definition at line 132 of file transform3d.h.
|
inline |
void OGF::Transform3d::move_backward | ( | double | value = 1.0 | ) |
translates to the back, along the w vector.
[in] | value | the length of the displacement, that will be multiplied by delta_location before being applied. |
void OGF::Transform3d::move_down | ( | double | value = 1.0 | ) |
translates to the bottom, along the v vector.
[in] | value | the length of the displacement, that will be multiplied by delta_location before being applied. |
void OGF::Transform3d::move_forward | ( | double | value = 1.0 | ) |
translates to the front, along the w vector.
[in] | value | the length of the displacement, that will be multiplied by delta_location before being applied. |
void OGF::Transform3d::move_left | ( | double | value = 1.0 | ) |
translates to the left, along the u vector.
[in] | value | the length of the displacement, that will be multiplied by delta_location before being applied. |
void OGF::Transform3d::move_right | ( | double | value = 1.0 | ) |
translates to the right, along the u vector.
[in] | value | the length of the displacement, that will be multiplied by delta_location before being applied. |
void OGF::Transform3d::move_up | ( | double | value = 1.0 | ) |
translates to the up, along the v vector.
[in] | value | the length of the displacement, that will be multiplied by delta_location before being applied. |
void OGF::Transform3d::rotate | ( | const mat4 & | value | ) |
Applies a rotation.
[in] | value | the rotational part of the transform is composed with the specified rotation |
void OGF::Transform3d::rotation_changed | ( | const mat4 & | value | ) |
A signal that is triggered each time the rotational component of the transform changes.
[in] | value | the rotation, as a 4x4 homogeneous- coordinates matrix, with zero translation. |
|
inline |
Sets the default origin.
[in] | value | the default origin |
Definition at line 274 of file transform3d.h.
|
inline |
Sets the default u vector.
[in] | value | the default u vector |
Definition at line 292 of file transform3d.h.
|
inline |
Sets the default v vector.
[in] | value | the default v vector |
Definition at line 310 of file transform3d.h.
|
inline |
Sets the default w vector.
[in] | value | the default w vector |
Definition at line 328 of file transform3d.h.
|
inline |
Sets the default zoom factor.
[in] | value | the default zoom factor |
Definition at line 346 of file transform3d.h.
|
inline |
Sets the increment for angle changes.
[in] | value | the increment for angle changes |
Definition at line 186 of file transform3d.h.
|
inline |
Sets the increment for position changes.
[in] | value | the increment for position changes |
Definition at line 164 of file transform3d.h.
|
inline |
Sets the increment for zooming.
[in] | value | the increment for zooming |
Definition at line 221 of file transform3d.h.
|
inline |
|
inline |
Sets the current transform.
[in] | value | the transform, as a 4x4 homogeneous- coordinates matrix \TODO compute u,v,w,lookat from matrix. |
Definition at line 240 of file transform3d.h.
void OGF::Transform3d::set_rotation_matrix | ( | const mat4 & | value | ) |
Sets the rotational part of the current transform.
[in] | value | the rotational part to be set in the current transform, as a 4x4 homogeneous-coordinates matrix (with zero translation) |
|
inline |
Sets the u vector.
The u vector points to the right.
[in] | value | the u vector |
Definition at line 103 of file transform3d.h.
|
inline |
Sets the v vector.
The v vector points to the top.
[in] | value | the v vector |
Definition at line 122 of file transform3d.h.
|
inline |
Sets the w vector.
The w vector points to the front.
[in] | value | the w vector |
Definition at line 141 of file transform3d.h.
|
inline |
Sets the zooming factor.
[in] | value | the zooming factor |
Definition at line 202 of file transform3d.h.
void OGF::Transform3d::tilt_down | ( | double | value = 1.0 | ) |
Tilt towards the bottom.
Like pushing the stick in a plane.
[in] | value | the rotation angle, multiplied by delta_angle before being applied \TODO not implemented yet! |
void OGF::Transform3d::tilt_left | ( | double | value = 1.0 | ) |
Tilt towards the left.
[in] | value | the rotation angle, multiplied by delta_angle before being applied \TODO not implemented yet! |
void OGF::Transform3d::tilt_right | ( | double | value = 1.0 | ) |
Tilt towards the right.
[in] | value | the rotation angle, multiplied by delta_angle before being applied \TODO not implemented yet! |
void OGF::Transform3d::tilt_up | ( | double | value = 1.0 | ) |
Tilt towards the up.
Like pulling the stick in a plane.
[in] | value | the rotation angle, multiplied by delta_angle before being applied \TODO not implemented yet! |
void OGF::Transform3d::translate | ( | const vec3 & | value | ) |
Applies a translation.
This function is used to implement panning in Graphite's 3D view.
[in] | value | the translation vector, only its X and Y components are used. They are multiplied by the zooming factor before beeing added to look_at. |
void OGF::Transform3d::turn_left | ( | double | value = 1.0 | ) |
Turn to the left.
[in] | value | the rotation angle, multiplied by delta_angle before being applied \TODO not implemented yet! |
void OGF::Transform3d::turn_right | ( | double | value = 1.0 | ) |
Turn to the right.
[in] | value | the rotation angle, multiplied by delta_angle before being applied \TODO not implemented yet! |
|
protected |
Updates the matrix representation of the transform.
[in] | send_signal | if true, value_changed() and rotation_changed() are triggered. |
void OGF::Transform3d::zoom_in | ( | double | value = 1.0 | ) |
Zooms in.
[in] | value | number of times zooming factor is multiplied by delta_zoom. |
void OGF::Transform3d::zoom_mult | ( | double | value = 1.0 | ) |
Applies a scaling to the current zoom.
[in] | value | scaling applied to the current zooming factor. |
void OGF::Transform3d::zoom_out | ( | double | value = 1.0 | ) |
Zooms out.
[in] | value | number of times zooming factor is divided by delta_zoom. |