|
| SoRayPickAction (const SbViewportRegion &viewportRegion) |
| Constructor takes viewport region to use for picking. More...
|
|
virtual | ~SoRayPickAction () |
| Destructor. More...
|
|
void | setPoint (const SbVec2s &viewportPoint) |
| Setting up the action before it is applied: More...
|
|
void | setNormalizedPoint (const SbVec2f &normPoint) |
| Sets the viewport point in normalized coordinates, which range from (0,0) at the lower left to (1,1) at the upper right. More...
|
|
void | setRadius (float radiusInPixels) |
| Set the radius (in pixels) around the point. More...
|
|
void | setRay (const SbVec3f &start, const SbVec3f &direction, float nearDistance=-1.0, float farDistance=-1.0) |
| Sets a world-space ray along which to pick. More...
|
|
void | setPickAll (bool flag) |
| Sets/returns whether the action will return all objects intersected or just the closest one. More...
|
|
bool | isPickAll () const |
| Sets/returns whether the action will return all objects intersected or just the closest one. More...
|
|
const SoPickedPointList & | getPickedPointList () const |
| Examining results after the action is applied: More...
|
|
SoPickedPoint * | getPickedPoint (int index=0) const |
| Returns the indexed picked point from the list. More...
|
|
void | computeWorldSpaceRay () |
| If a ray was not defined with setRay(), this causes the world space pick ray to be computed from the screen space point and radius, using the current view specification from the state. More...
|
|
bool | hasWorldSpaceRay () const |
| This returns TRUE if the action has had a world space ray set or computed. More...
|
|
void | setObjectSpace () |
| This is called by shapes to set up object space picking. More...
|
|
void | setObjectSpace (const SbMatrix &matrix) |
|
bool | intersect (const SbVec3f &v0, const SbVec3f &v1, const SbVec3f &v2, SbVec3f &intersection, SbVec3f &barycentric, bool &front) const |
| These intersect the current object-space ray with a variety of primitives: triangle, line, point, bounding-box. More...
|
|
bool | intersect (const SbVec3f &v0, const SbVec3f &v1, SbVec3f &intersection) const |
| Line: More...
|
|
bool | intersect (const SbVec3f &point) const |
| Point: More...
|
|
bool | intersect (const SbBox3f &box, bool useFullViewVolume=TRUE) |
| Bounding box: just return whether the ray intersects it. More...
|
|
const SbViewVolume & | getViewVolume () const |
| Returns an SbViewVolume that represents the object-space ray to pick along. More...
|
|
const SbLine & | getLine () const |
| Returns SbLine that can be used for other intersection tests. More...
|
|
bool | isBetweenPlanes (const SbVec3f &intersection) const |
| Returns TRUE if the given object-space intersection point is between the near and far planes of the object-space view volume, as well as any clipping planes that have been defined. More...
|
|
SoPickedPoint * | addIntersection (const SbVec3f &objectSpacePoint) |
| Adds an SoPickedPoint instance representing the given object space point to the current list and returns a pointer to it. More...
|
|
void | setViewportRegion (const SbViewportRegion &newRegion) |
| Sets current viewport region to use for action. More...
|
|
const SbViewportRegion & | getViewportRegion () const |
| Returns current viewport region to use for action. More...
|
|
void | enableCulling (bool flag) |
| Setting this flag to FALSE disables any pick culling that might take place (as in SoSeparators). More...
|
|
bool | isCullingEnabled () const |
|
virtual | ~SoAction () |
| Destructor. More...
|
|
virtual SoType | getTypeId () const =0 |
| Returns the type identifier for a specific instance. More...
|
|
bool | isOfType (SoType type) const |
| Returns TRUE if this instance is of the type specified in type or is derived from that type. More...
|
|
virtual void | apply (SoNode *node) |
|
virtual void | apply (SoPath *path) |
|
virtual void | apply (const SoPathList &pathList, bool obeysRules=FALSE) |
| Initiates an action on the graph defined either by a node, path, or list of paths. More...
|
|
virtual void | invalidateState () |
| Invalidates the current traversal state in the action, forcing it to be recreated when the action is next applied. More...
|
|
AppliedCode | getWhatAppliedTo () const |
| Returns code indicating what action is being applied to. More...
|
|
SoNode * | getNodeAppliedTo () const |
| These returns a pointer to the node, path, or path list the action is being applied to. More...
|
|
SoPath * | getPathAppliedTo () const |
|
const SoPathList * | getPathListAppliedTo () const |
| A single path list may be split into several, one for each different head node. More...
|
|
const SoPathList * | getOriginalPathListAppliedTo () const |
|
bool | isLastPathListAppliedTo () const |
|
PathCode | getPathCode (int &numIndices, const int *&indices) |
| Returns path code based on where current node (the node at the end of the current path) lies with respect to the path(s) the action is being applied to. More...
|
|
void | traverse (SoNode *node) |
| Does traversal of a graph rooted by a node. More...
|
|
bool | hasTerminated () const |
| Returns TRUE if the traversal has reached a termination condition. More...
|
|
const SoPath * | getCurPath () |
| Returns a pointer to the path accumulated during traversal, i.e., the chain of nodes from the root of the traversed graph to the current node being traversed. More...
|
|
SoState * | getState () const |
| Get the state from the action. More...
|
|
PathCode | getCurPathCode () const |
| These methods maintain the current path accumulated so far during traversal. More...
|
|
void | pushCurPath (int childIndex) |
|
void | popCurPath (PathCode prevPathCode) |
|
virtual SoNode * | getCurPathTail () |
| This is virtual, so that SoCallbackAction can use current node. More...
|
|
void | usePathCode (int &numIndices, const int *&indices) |
| called by inline getPathCode: More...
|
|
void | pushCurPath () |
| Optimized versions of push/pop when we know path codes won't change: More...
|
|
void | popPushCurPath (int childIndex) |
|
void | popCurPath () |
|
const SoLightweightPath & | getCurrentLightweightPath () const |
| Returns the current "light" path. More...
|
|
void | setCurrentLightweightPath (const SoLightweightPath &path) |
| Sets the current "light" path. More...
|
|
This class performs picking by casting a ray into a scene and performing intersection tests with each object. The ray is extended to be a cone or cylinder, depending on the camera type, for intersection with points and lines. Each intersection is returned as an SoPickedPoint instance.
The picking ray can be specified as either a ray from the camera location through a particular viewport pixel, or as a world-space ray. In the former case, a valid camera must be encountered during traversal of the graph to determine the location of the ray in world space.
Callers can cause the action to compute all intersections along the ray (sorted closest to farthest) by setting the pickAll flag to TRUE. By default, the action computes only the closest intersection. In either case, the intersections are returned in an SoPickedPointList. Each intersection can be examined by accessing the appropriate SoPickedPoint in the list. The SoPickedPoint class provides methods to get the intersection point, normal, and other info.
- See Also
- SoPickedPoint, SoPickedPointList
Definition at line 97 of file SoRayPickAction.h.