OpenCMISS-Zinc C++ API Documentation
Public Member Functions | Protected Attributes | List of all members
OpenCMISS::Zinc::Scenepicker Class Reference

Utility object for picking graphics and model objects. More...

#include <scenepicker.hpp>

Public Member Functions

 Scenepicker (cmzn_scenepicker_id in_scenepicker_id)
 
 Scenepicker (const Scenepicker &scenepicker)
 
Scenepickeroperator= (const Scenepicker &scenepicker)
 
bool isValid () const
 
cmzn_scenepicker_id getId () const
 
int setSceneviewerRectangle (const Sceneviewer &sceneviewer, Scenecoordinatesystem scenecoordinatesystem, double x1, double y1, double x2, double y2)
 
Element getNearestElement ()
 
Node getNearestNode ()
 
Graphics getNearestElementGraphics ()
 
Graphics getNearestNodeGraphics ()
 
Graphics getNearestGraphics ()
 
int addPickedElementsToFieldGroup (const FieldGroup &fieldGroup)
 
int addPickedNodesToFieldGroup (const FieldGroup &fieldGroup)
 
Scene getScene ()
 
int setScene (const Scene &scene)
 
Scenefilter getScenefilter ()
 
int setScenefilter (const Scenefilter &filter)
 
int getPickingVolumeCentre (double *coordinateValuesOut3)
 

Protected Attributes

cmzn_scenepicker_id id
 

Detailed Description

Utility object for picking graphics and model objects.

Utility object for picking graphics and model objects (nodes/elements) from the 3-D graphics in a scene tree.

Member Function Documentation

int OpenCMISS::Zinc::Scenepicker::addPickedElementsToFieldGroup ( const FieldGroup fieldGroup)
inline

Picked elements belong to group field's owning region tree will be added to group. Additional subregion fields will be created when required.

Parameters
fieldGroupelements will be added to this group field
Returns
Status OpenCMISS::Zinc::OK on success, any other value on failure.
int OpenCMISS::Zinc::Scenepicker::addPickedNodesToFieldGroup ( const FieldGroup fieldGroup)
inline

Picked nodes belong to group field's owning region tree will be added to group. Additional subregion fields will be created when required.

Parameters
fieldGroupnodes will be added to this group field
Returns
Status OpenCMISS::Zinc::OK on success, any other value on failure.
cmzn_scenepicker_id OpenCMISS::Zinc::Scenepicker::getId ( ) const
inline

Return the C handle of the Scenepicker object.

Returns
C handle of Scenepicker if this objects is valid, 0 otherwise.
Element OpenCMISS::Zinc::Scenepicker::getNearestElement ( )
inline

Get the nearest element in the defined bounding box on scene.

Returns
Handle to nearest element, or NULL/invalid handle if none or failed.
Graphics OpenCMISS::Zinc::Scenepicker::getNearestElementGraphics ( )
inline

Get the nearest element graphics in the defined bounding box on scene.

Returns
Handle to graphics showing nearest element, or NULL/invalid handle if none or failed.
Graphics OpenCMISS::Zinc::Scenepicker::getNearestGraphics ( )
inline

Get the nearest graphics in the defined bounding box on scene.

Returns
Handle to nearest graphics, or NULL/invalid handle if none or failed.
Node OpenCMISS::Zinc::Scenepicker::getNearestNode ( )
inline

Get the nearest node in the defined bounding box on scene.

Returns
Handle to nearest node, or NULL/invalid handle if none or failed.
Graphics OpenCMISS::Zinc::Scenepicker::getNearestNodeGraphics ( )
inline

Get the nearest node graphics in the defined bounding box on scene.

Returns
Handle to graphics showing nearest node, or NULL/invalid handle if none or failed.
int OpenCMISS::Zinc::Scenepicker::getPickingVolumeCentre ( double *  coordinateValuesOut3)
inline

Return the centre of the picking volume in world coordinates.

Parameters
coordinateValuesOut3Array of size 3 to hold the values of the coordinates.
Returns
Status OpenCMISS::Zinc::OK on success, any other value on failure.
Scene OpenCMISS::Zinc::Scenepicker::getScene ( )
inline

Get the scene set for the scene picker to pick from.

Returns
Handle to scene, or NULL/invalid handle on failure.
Scenefilter OpenCMISS::Zinc::Scenepicker::getScenefilter ( )
inline

Get the scene filter for the scene picker.

Returns
Handle to scene filter, or NULL/invalid handle if none or failed.
bool OpenCMISS::Zinc::Scenepicker::isValid ( ) const
inline

Check if this is a valid Scenepicker object.

Returns
Status True if object is valid, false otherwise.
int OpenCMISS::Zinc::Scenepicker::setScene ( const Scene scene)
inline

Set the scene for the scene picker to pick from.

Parameters
sceneThe scene to pick from.
Returns
Status OpenCMISS::Zinc::OK on success, any other value on failure.
int OpenCMISS::Zinc::Scenepicker::setScenefilter ( const Scenefilter filter)
inline

Set the scene filter for the scene picker. This filters which graphics are pickable from the scene.

Parameters
filterThe scene filter to use, or NULL if none (all pickable).
Returns
Status OpenCMISS::Zinc::OK on success, any other value on failure.
int OpenCMISS::Zinc::Scenepicker::setSceneviewerRectangle ( const Sceneviewer sceneviewer,
Scenecoordinatesystem  scenecoordinatesystem,
double  x1,
double  y1,
double  x2,
double  y2 
)
inline

Set the bounding box of scene picker. Scene viewer will provide the preset modelview and projection matrix from itself. (x1,y1) and (x2,y2) are diagonally opposite corners of the rectangle.

Parameters
sceneviewerScene viewer to get the modelview and projection matrix from.
scenecoordinatesystemThe window coordinate system the corner points are specified in. Currently only SCENECOORDINATESYSTEM_WINDOW_PIXEL_TOP_LEFT is applied.
x1X coordinate of first corner point.
y1Y coordinate of first corner point.
x2X coordinate of second corner point, diagonally opposite first.
y2Y coordinate of second corner point, diagonally opposite first.
Returns
Status OpenCMISS::Zinc::OK on success, any other value on failure.

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