SoPickedPoint Class Reference
[General]

Represents point on surface of picked object. More...

#include <Inventor/SoPickedPoint.h>

List of all members.

Public Member Functions

 SoPickedPoint ()
 SoPickedPoint (const SoPickedPoint &pp)
 ~SoPickedPoint ()
SoPickedPointcopy () const
const SbVec3fgetPoint () const
const SbVec3fgetNormal () const
const SbVec4fgetTextureCoords () const
int getMaterialIndex () const
SoPathgetPath () const
SbBool isOnGeometry () const
const SoDetailgetDetail (const SoNode *node=NULL) const
SbMatrix getObjectToWorld (const SoNode *node=NULL) const
SbMatrix getWorldToObject (const SoNode *node=NULL) const
SbMatrix getObjectToImage (const SoNode *node=NULL) const
SbMatrix getImageToObject (const SoNode *node=NULL) const
SbVec3f getObjectPoint (const SoNode *node=NULL) const
SbVec3f getObjectNormal (const SoNode *node=NULL) const
SbVec4f getObjectTextureCoords (const SoNode *node=NULL) const

Detailed Description

Represents point on surface of picked object.

An SoPickedPoint represents a point on the surface of an object that was picked by applying an SoRayPickAction to a scene. It contains a path to the picked shape, the point of intersection, the surface normal and texture coordinates at that point, and other information. Note that it is not always necessary to explicitly apply an SoRayPickAction to the scene. The getPickedPoint method may also be called on an SoHandleEventAction or an SoEventCallback node.

Each node in the picked path may have a corresponding instance of an SoDetail subclass. These detail instances are stored in the SoPickedPoint.

SEE ALSO

SoRayPickAction, SoPickStyle, SoDetail, SoPath, SoEventCallback

See related examples:

DetailSelection, TutorialPicking1, TutorialPicking2, TutorialPicking3, TutorialPicking4, TutorialPicking5, TutorialPicking6, TutorialPicking7, TutorialPicking8, TutorialPicking9


Constructor & Destructor Documentation

SoPickedPoint::SoPickedPoint (  ) 

Default constructor.

SoPickedPoint::SoPickedPoint ( const SoPickedPoint pp  ) 

Copy constructor.

SoPickedPoint::~SoPickedPoint (  ) 

Destructor.


Member Function Documentation

SoPickedPoint* SoPickedPoint::copy (  )  const
const SoDetail* SoPickedPoint::getDetail ( const SoNode node = NULL  )  const

Returns the detail that corresponds to the specified node in the path returned by getPath().

If the node is null, the detail corresponding to the tail of the pick path is returned.

Caution: If there is no detail class associated with the node, null is returned.

SbMatrix SoPickedPoint::getImageToObject ( const SoNode node = NULL  )  const

Returns the texture transformation matrix between image space and the object space corresponding to the given node in the path.

If the node is NULL, the matrix corresponding to the tail of the (full) path is returned.

By default, the node is NULL.

int SoPickedPoint::getMaterialIndex (  )  const [inline]

Returns the index into the current set of materials of the material active at the intersection point.

Note that if the materials are interpolated between vertices, the index will correspond to the material at one of the vertices.

const SbVec3f& SoPickedPoint::getNormal (  )  const [inline]

Returns the surface normal in world space.

NOTE: It is possible to disable computation of normal vectors by calling the enableNormalsGeneration() method on SoRayPickAction. If normal vectors are disabled, this method returns 0,0,0.

SbVec3f SoPickedPoint::getObjectNormal ( const SoNode node = NULL  )  const

Returns the surface normal in the object space corresponding to the given node in the path.

If the node is NULL, the information corresponding to the tail of the (full) path is returned.

By default, the node is NULL.

SbVec3f SoPickedPoint::getObjectPoint ( const SoNode node = NULL  )  const

Returns the intersection point in the object space corresponding to the given node in the path.

If the node is NULL, the information corresponding to the tail of the (full) path is returned.

By default, the node is NULL.

SbVec4f SoPickedPoint::getObjectTextureCoords ( const SoNode node = NULL  )  const

Returns the texture coordinates in the object space corresponding to the given node in the path.

If the node is NULL, the information corresponding to the tail of the (full) path is returned.

By default, the node is NULL.

SbMatrix SoPickedPoint::getObjectToImage ( const SoNode node = NULL  )  const

Returns the texture transformation matrix between the object space and image space corresponding to the given node in the path.

If the node is NULL, the matrix corresponding to the tail of the (full) path is returned.

By default, the node is NULL.

SbMatrix SoPickedPoint::getObjectToWorld ( const SoNode node = NULL  )  const

Returns the transformation matrix between the object space and world space corresponding to the given node in the path.

If the node is NULL, the matrix corresponding to the tail of the (full) path is returned.

By default, the node is NULL.

SoPath* SoPickedPoint::getPath (  )  const [inline]

Returns the path to the object that was intersected.

const SbVec3f& SoPickedPoint::getPoint (  )  const [inline]

Returns the intersection point in world space.

const SbVec4f& SoPickedPoint::getTextureCoords (  )  const [inline]

Returns the texture coordinates in image space.

NOTE: By default the SoRayPickAction does not compute texture coordinates and this method returns 0,0,0,0. To enable texture coordinate computation call the enableTexCoordsGeneration() method on the pick action object or set the environment variable OIV_PICK_GENERATE_ALL_PROPERTIES to true.

SbMatrix SoPickedPoint::getWorldToObject ( const SoNode node = NULL  )  const

Returns the transformation matrix between world space and the object space corresponding to the given node in the path.

If the node is NULL, the matrix corresponding to the tail of the (full) path is returned.

By default, the node is NULL.

SbBool SoPickedPoint::isOnGeometry (  )  const [inline]

Returns whether the intersection is actually on the geometry of the character that was hit, as opposed to being on the bounding box.

The pick style (see SoPickStyle) affects this decision.


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

Open Inventor Toolkit reference manual, generated on 15 Mar 2023
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/