Base class for all client object proxies. More...

Public Member Functions | |
| ObjectProxyBase (const ObjectProxyBase &p) | |
| bool | operator== (const ObjectProxyBase &p) const |
| Equality comparison operation. | |
| bool | operator!= (const ObjectProxyBase &p) const |
| Inequality comparison operator. | |
| DelayedDispatch | set_transformation (float x1, float y1, float z1, float p1, float x2, float y2, float z2, float p2, float x3, float y3, float z3, float p3, CoordinateSystem coord_sys=PARENT_COORDINATES) |
| Set the object's transformation matrix. | |
| DelayedDispatch | set_transformation (const float *m, bool row_major=true, CoordinateSystem coord_sys=PARENT_COORDINATES) |
| Set the object's transformation matrix. | |
| DelayedDispatch | set_position (float x, float y, float z, CoordinateSystem coord_sys=PARENT_COORDINATES) |
| Set the object's position. | |
| DelayedDispatch | translate (float x, float y, float z, CoordinateSystem coord_sys=LOCAL_COORDINATES) |
| Move the object. | |
| DelayedDispatch | set_orientation (float vx, float vy, float vz, CoordinateSystem coord_sys=PARENT_COORDINATES) |
| Set the object's orientation. | |
| DelayedDispatch | set_rotation (float yaw, float pitch=0, float roll=0, CoordinateSystem coord_sys=PARENT_COORDINATES) |
| Set the object's rotation from Euler angles. | |
| DelayedDispatch | rotate (float rad, float axis_x, float axis_y, float axis_z, float pivot_x=0, float pivot_y=0, float pivot_z=0, CoordinateSystem axis_coord_sys=LOCAL_COORDINATES, CoordinateSystem pivot_coord_sys=LOCAL_COORDINATES) |
| Rotate the object around the given rotational axis and pivot. | |
| DelayedDispatch | set_pose (float x, float y, float z, float yaw, float pitch=0, float roll=0, CoordinateSystem coord_sys=PARENT_COORDINATES) |
| Set the object's pose. | |
| DelayedDispatch | set_opacity (float opacity, bool absolute=false) |
| Set the object's opacity. | |
| DelayedDispatch | set_visibility (bool visible) |
| Hide/show the object and all it's children. | |
| DelayedDispatch | hide () |
| Hide the object. | |
| DelayedDispatch | show () |
| Show (unhide) the object. | |
| DelayedDispatch | set_layer (unsigned int layer, bool recursive=false) |
| Move the object, and optionally, all its children, to the given layer. | |
| DelayedDispatch | set_color (float r, float g, float b, bool recursive=false) |
| Set the object's color. | |
| DelayedDispatch | set_name (const std::string &name) |
| Set the object's name. | |
| DelayedDispatch | remove () |
| Remove the object, and all of its children, from the scene. | |
| DelayedDispatch | clear () |
| Remove all child objects. | |
| DelayedDispatch | rearrange (const ObjectProxyBase &new_parent, bool retain_world_pose=false, NameConflictPolicy conflict_policy=AUTO_ENUMERATE_ON_CONFLICT) const |
| Relocate the object to a new parent. | |
| DelayedDispatch | load_scene (const std::string &filename, NameConflictPolicy conflict_policy=FAIL_ON_CONFLICT) |
| Load a scene file. | |
| Result< Transformation > | get_transformation (CoordinateSystem coord_sys=PARENT_COORDINATES) const |
| Get the transformation of the object. | |
| Result< Vector3 > | get_position (CoordinateSystem coord_sys=PARENT_COORDINATES) const |
| Get the position of the object. | |
| Result< Vector3 > | get_orientation (CoordinateSystem coord_sys=PARENT_COORDINATES) const |
| Get the orientation of the object. | |
| Result< std::vector < std::string > > | get_children () const |
| Get the names of all the object's children. | |
Protected Member Functions | |
| PEEKABOT_HIDDEN ObjectID | get_object_id () const |
| Returns the pseudonym ID of the object associated with the proxy. | |
| PEEKABOT_HIDDEN void | unchecked_assign (boost::shared_ptr< ClientImpl > client, boost::shared_ptr< ObjectID > id) |
| Low level assign - set the pseudonym ID and client of the proxy. No type checking is done. | |
| PEEKABOT_HIDDEN void | unchecked_assign (const ObjectProxyBase &other) |
| Low level assign - set the pseudonym ID and client of the proxy to that of other. No type checking is done. | |
|
PEEKABOT_HIDDEN boost::shared_ptr< ObjectID > | get_pseudonym () const |
|
PEEKABOT_HIDDEN boost::shared_ptr< ObjectID > | allocate_pseudonym () |
Static Protected Member Functions | |
| static ObjectID | get_object_id (const ObjectProxyBase &p) |
| Returns the pseudonym ID of the object associated with the given proxy p. | |
|
static boost::shared_ptr < ObjectID > | get_pseudonym (const ObjectProxyBase &p) |
Base class for all client object proxies.
Provides functionality needed by all proxies referring to objects - handling of pseudonyms, and all basic operations pertaining to objects.
| Result< std::vector< std::string > > get_children | ( | ) | const |
Get the names of all the object's children.
The order of the returned names is undefined.
| ObjectID get_object_id | ( | ) | const [protected] |
Returns the pseudonym ID of the object associated with the proxy.
| std::logic_error | Thrown if the proxy is unassigned, i.e. not yet associated with an object. |
| ObjectID get_object_id | ( | const ObjectProxyBase & | p | ) | [static, protected] |
Returns the pseudonym ID of the object associated with the given proxy p.
| Result< Vector3 > get_orientation | ( | CoordinateSystem | coord_sys = PARENT_COORDINATES |
) | const |
Get the orientation of the object.
The result will be returned in the given coordinate system, either relative the parent object or in world coordinates.
| coord_sys | The coordinate system the result should be described in. Must be PARENT_COORDINATES or WORLD_COORDINATES. |
| Result< Vector3 > get_position | ( | CoordinateSystem | coord_sys = PARENT_COORDINATES |
) | const |
Get the position of the object.
The result will be returned in the given coordinate system, either relative the parent object or in world coordinates.
| coord_sys | The coordinate system the result should be described in. Must be PARENT_COORDINATES or WORLD_COORDINATES. |
| Result< Transformation > get_transformation | ( | CoordinateSystem | coord_sys = PARENT_COORDINATES |
) | const |
Get the transformation of the object.
The result will be returned in the given coordinate system, either relative the parent object or in world coordinates.
| coord_sys | The coordinate system the result should be described in. Must be PARENT_COORDINATES or WORLD_COORDINATES. |
| DelayedDispatch hide | ( | ) | [inline] |
Hide the object.
| DelayedDispatch load_scene | ( | const std::string & | filename, | |
| NameConflictPolicy | conflict_policy = FAIL_ON_CONFLICT | |||
| ) |
Load a scene file.
The contents of the scene file will be attached underneath this object.
| filename | The filename (path) of the server-side scene file to load. |
| bool operator!= | ( | const ObjectProxyBase & | p | ) | const |
Inequality comparison operator.
| bool operator== | ( | const ObjectProxyBase & | p | ) | const |
Equality comparison operation.
Returns true if the two operands refer to the same object. More specifically, it returns true if they're tied to the same client and are assigned to the same object in the scene.
Two proxies with different clients but assigned to the same object are not considered to be equal.
| DelayedDispatch rearrange | ( | const ObjectProxyBase & | new_parent, | |
| bool | retain_world_pose = false, |
|||
| NameConflictPolicy | conflict_policy = AUTO_ENUMERATE_ON_CONFLICT | |||
| ) | const |
Relocate the object to a new parent.
| retain_world_pose | If true, the object's absolute pose will remain unchanged, otherwise the aboslute pose might change but the pose relative the parent object will be left unchanged. |
| DelayedDispatch rotate | ( | float | rad, | |
| float | axis_x, | |||
| float | axis_y, | |||
| float | axis_z, | |||
| float | pivot_x = 0, |
|||
| float | pivot_y = 0, |
|||
| float | pivot_z = 0, |
|||
| CoordinateSystem | axis_coord_sys = LOCAL_COORDINATES, |
|||
| CoordinateSystem | pivot_coord_sys = LOCAL_COORDINATES | |||
| ) |
Rotate the object around the given rotational axis and pivot.
| axis_coord_sys | The coordinate system in which the rotational axis is specified. | |
| pivot_coord_sys | The coordinate system in which the rotational pivot is specified. |
| std::logic_error | Thrown if the specified axis forms a zero vector. |
| DelayedDispatch set_color | ( | float | r, | |
| float | g, | |||
| float | b, | |||
| bool | recursive = false | |||
| ) |
Set the object's color.
| recursive | If true, the layer setting is propagated to all of the object's children. |
| DelayedDispatch set_layer | ( | unsigned int | layer, | |
| bool | recursive = false | |||
| ) |
Move the object, and optionally, all its children, to the given layer.
| layer | The layer which to move the object/subtree to. | |
| recursive | If true, the layer setting is propagated to all of the object's children. |
| std::range_error | Thrown when layer is outside the allowed range. |
| DelayedDispatch set_name | ( | const std::string & | name | ) |
Set the object's name.
| name | The object's new name. |
| DelayedDispatch set_opacity | ( | float | opacity, | |
| bool | absolute = false | |||
| ) |
Set the object's opacity.
| opacity | The (absolute or relative) alpha value of the object. | |
| absolute | If set to false, the actual opacity of the object will be computed relative to the parent object. |
| DelayedDispatch set_orientation | ( | float | vx, | |
| float | vy, | |||
| float | vz, | |||
| CoordinateSystem | coord_sys = PARENT_COORDINATES | |||
| ) |
Set the object's orientation.
Sets the object's X-axis (in the coordinate system given by coord_sys) to
.
Note that when the requested orientation equals the negated current orientation (e.g. current is
and requested is
) the change in orientation is ambiguous: we can achieve the desired orientation by rotating 180 degrees around either object's Z or Y axis. In this case, this operation always chooses to rotate around the Z axis.
| DelayedDispatch set_pose | ( | float | x, | |
| float | y, | |||
| float | z, | |||
| float | yaw, | |||
| float | pitch = 0, |
|||
| float | roll = 0, |
|||
| CoordinateSystem | coord_sys = PARENT_COORDINATES | |||
| ) |
Set the object's pose.
The yaw rotation is applied first, then pitch and roll last.
| yaw | Rotation about the Z-axis. | |
| roll | Rotation about the Y-axis. | |
| pitch | Rotation about the X-axis. |
| DelayedDispatch set_position | ( | float | x, | |
| float | y, | |||
| float | z, | |||
| CoordinateSystem | coord_sys = PARENT_COORDINATES | |||
| ) |
Set the object's position.
| DelayedDispatch set_rotation | ( | float | yaw, | |
| float | pitch = 0, |
|||
| float | roll = 0, |
|||
| CoordinateSystem | coord_sys = PARENT_COORDINATES | |||
| ) |
Set the object's rotation from Euler angles.
The yaw rotation is applied first, then pitch and roll last.
| yaw | Rotation about the Z-axis. | |
| pitch | Rotation about the Y-axis. | |
| roll | Rotation about the X-axis. |
| DelayedDispatch set_transformation | ( | const float * | m, | |
| bool | row_major = true, |
|||
| CoordinateSystem | coord_sys = PARENT_COORDINATES | |||
| ) |
Set the object's transformation matrix.
Set the object's transformation from a 4x4 array with either row or column major storage.
| row_major | Storage layout of the input m. | |
| coord_sys | The coordinate system the transformation matrix is specified in. |
| DelayedDispatch set_transformation | ( | float | x1, | |
| float | y1, | |||
| float | z1, | |||
| float | p1, | |||
| float | x2, | |||
| float | y2, | |||
| float | z2, | |||
| float | p2, | |||
| float | x3, | |||
| float | y3, | |||
| float | z3, | |||
| float | p3, | |||
| CoordinateSystem | coord_sys = PARENT_COORDINATES | |||
| ) |
Set the object's transformation matrix.
| coord_sys | The coordinate system the transformation matrix is specified in. |
| DelayedDispatch set_visibility | ( | bool | visible | ) |
Hide/show the object and all it's children.
| visible | Set to false and true to show and hide the object respectively. |
| DelayedDispatch show | ( | ) | [inline] |
Show (unhide) the object.
| DelayedDispatch translate | ( | float | x, | |
| float | y, | |||
| float | z, | |||
| CoordinateSystem | coord_sys = LOCAL_COORDINATES | |||
| ) |
Move the object.
Translate the object the specified distances along the given coordinate systems axes.
1.7.1