55#ifndef _SO_RAY_PICK_ACTION_
56#define _SO_RAY_PICK_ACTION_
144 float nearDistance = -1.0,
145 float farDistance = -1.0);
216 bool useFullViewVolume =
TRUE);
279 bool clipToNear, clipToFar;
294 void computeMatrices();
297 void computeObjVolAndLine();
306 static float rayDistance(
const SbVec3f &start,
#define SoEXTENDER
Provide inline template functions for abs, swap, min, max, and clamp.
#define INVENTOR_API
Disable some annoying warnings on MSVC 6.
#define SO_ACTION_HEADER(className)
Macros to be called within the class definition header for an action subclass:
Class for representing a viewport.
Abstract base class for all database nodes.
Abstract base class for picking objects in a scene.
Maintains a list of pointers to SoPickedPoint instances.
Represents point on surface of picked object.
Intersects objects with a ray cast into scene.
virtual ~SoRayPickAction()
Destructor.
bool isBetweenPlanes(const SbVec3f &intersection) const
Returns TRUE if the given object-space intersection point is between the near and far planes of the o...
bool intersect(const SbBox3f &box, bool useFullViewVolume=TRUE)
Bounding box: just return whether the ray intersects it.
void computeWorldSpaceRay()
If a ray was not defined with setRay(), this causes the world space pick ray to be computed from the ...
void setPickAll(bool flag)
Sets/returns whether the action will return all objects intersected or just the closest one.
bool hasWorldSpaceRay() const
This returns TRUE if the action has had a world space ray set or computed.
void setObjectSpace()
This is called by shapes to set up object space picking.
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.
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,...
void setPoint(const SbVec2s &viewportPoint)
Setting up the action before it is applied:
SoRayPickAction(const SbViewportRegion &viewportRegion)
Constructor takes viewport region to use for picking.
virtual void beginTraversal(SoNode *node)
Initiates action on graph.
const SbViewVolume & getViewVolume() const
Returns an SbViewVolume that represents the object-space ray to pick along.
void setNormalizedPoint(const SbVec2f &normPoint)
Sets the viewport point in normalized coordinates, which range from (0,0) at the lower left to (1,...
bool isPickAll() const
Sets/returns whether the action will return all objects intersected or just the closest one.
SoPickedPoint * getPickedPoint(int index=0) const
Returns the indexed picked point from the list.
bool intersect(const SbVec3f &v0, const SbVec3f &v1, SbVec3f &intersection) const
Line:
SoPickedPoint * addIntersection(const SbVec3f &objectSpacePoint)
Adds an SoPickedPoint instance representing the given object space point to the current list and retu...
const SbLine & getLine() const
Returns SbLine that can be used for other intersection tests.
void setRadius(float radiusInPixels)
Set the radius (in pixels) around the point.
bool intersect(const SbVec3f &point) const
Point:
const SoPickedPointList & getPickedPointList() const
Examining results after the action is applied:
void setObjectSpace(const SbMatrix &matrix)