User manual

old releases - latest release - trunk

CoordinateTrigger Class Reference

Collaboration diagram for CoordinateTrigger:

List of all members.


Detailed Description

Trigger for updating the coordinate fields in aMoveRotateGroup.

This trigger is registered when a MoveRotateGroup is created in a PropertyFrame. It will contain pointers to the coordinate fields that it is registered for.

It is registered for the ON_TRANSFORMATION_SET and ON_MTOW_CHANGED stimuli.

It keeps a list of objects for which any stimuli has been registered to cause triggers, and assumes both stimuli have been registered for each object.

When triggered it generates update events and posts them on the GUI update queue via UserInterface::post_event().

Public Member Functions

 CoordinateTrigger (Fl_Value_Input *x_field, Fl_Value_Input *y_field, Fl_Value_Input *z_field)
 This constructor simply sets the pointers to the X- Y- and Z-coordinate fields.
void set_coordinate_system (transformation_target::CoordinateSystem system)
 Specifies which system the coordinates are to be specified in.
void on_transformation (SceneObject *object)
 Method for handling transformation events.
void attach_to (SceneObject *object)
void detach_from (SceneObject *object)

Private Member Functions

Vector3ru calculate_mean ()
 Calculates the mean coordinate values for a set of objects.

Private Attributes

Fl_Value_Input * m_x_field
 Pointers to the coordinate fields that the trigger is registered for.
Fl_Value_Input * m_y_field
Fl_Value_Input * m_z_field
transformation_target::CoordinateSystem m_system
 Stores which coordinate system the coordinate fields are using.
std::set< SceneObject * > m_objects
 A set storing all objects the trigger is registered with.


Member Function Documentation

void on_transformation ( SceneObject object  ) 

Method for handling transformation events.

Calls the calculate_mean() method to get the averaged positional vector for all objects it is registered for, and then generates UpdateAction objects for the corresponding object data and property fields and post it on the GUI update queue.

peekabot::Vector3ru calculate_mean (  )  [private]

Calculates the mean coordinate values for a set of objects.

This method will first determine whether the trigger was registered for any other scene objects, indicating a multiple selection. In that case, it will fetch the coordinate values of those other objects and calculate the mean value.

This method uses the ObjectTrigger::get_activator_set() method to Gain access to the other objects that the trigger is registered for, and then proceeds to calculate the mean positional vector.


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