Coin Logo http://www.sim.no
http://www.coin3d.org

Public Member Functions | List of all members
SoPickedPoint Class Reference

The SoPickedPoint class is used for specifying picked points.It holds miscellaneous information about the picked point, such as position, normal, texture coordinate and material index in the current material. It might also hold detail information (an SoDetail subclass) for every node in the picked path. More...

#include <Inventor/SoPickedPoint.h>

Public Member Functions

 SoPickedPoint (const SoPickedPoint &pp)
 
 SoPickedPoint (const SoPath *const path, SoState *const state, const SbVec3f &objSpacePoint)
 
 ~SoPickedPoint ()
 
SoPickedPointcopy () const
 
const SbVec3fgetPoint () const
 
const SbVec3fgetNormal () const
 
const SbVec4fgetTextureCoords () const
 
int getMaterialIndex () const
 
SoPathgetPath () const
 
SbBool isOnGeometry () const
 
const SoDetailgetDetail (const SoNode *const node=NULL) const
 
const SbMatrixgetObjectToWorld (const SoNode *const node=NULL) const
 
const SbMatrixgetWorldToObject (const SoNode *const node=NULL) const
 
const SbMatrixgetObjectToImage (const SoNode *const node=NULL) const
 
const SbMatrixgetImageToObject (const SoNode *const node=NULL) const
 
SbVec3f getObjectPoint (const SoNode *const node=NULL) const
 
SbVec3f getObjectNormal (const SoNode *const node=NULL) const
 
SbVec4f getObjectTextureCoords (const SoNode *const node=NULL) const
 
void setObjectNormal (const SbVec3f &normal)
 
void setObjectTextureCoords (const SbVec4f &texCoords)
 
void setMaterialIndex (const int index)
 
void setDetail (SoDetail *detail, SoNode *node)
 

Detailed Description

The SoPickedPoint class is used for specifying picked points.

It holds miscellaneous information about the picked point, such as position, normal, texture coordinate and material index in the current material. It might also hold detail information (an SoDetail subclass) for every node in the picked path.

See also
SoRayPickAction

Constructor & Destructor Documentation

◆ SoPickedPoint() [1/2]

SoPickedPoint::SoPickedPoint ( const SoPickedPoint pp)

Copy constructor.

References SoDetailList::copy(), SbPList::getLength(), and SoBase::ref().

Referenced by copy().

◆ SoPickedPoint() [2/2]

SoPickedPoint::SoPickedPoint ( const SoPath *const  pathptr,
SoState *const  stateptr,
const SbVec3f objSpacePoint 
)

Constructor. Uses the state to convert between world and object space for the data.

References SoPath::copy(), and SoBase::ref().

◆ ~SoPickedPoint()

SoPickedPoint::~SoPickedPoint ( )

Destructor.

References SoBase::unref().

Member Function Documentation

◆ copy()

SoPickedPoint * SoPickedPoint::copy ( ) const

Returns a copy of this picked point.

Note that if the Coin library has been built as a DLL under Microsoft Windows and you use this method from application code, you must make sure that both the Coin DLL and the application executable is using the same instance of a C Run-Time (CRT) library. Otherwise, you will get memory heap corruption upon deallocating the returned instances, eventually leading to mysterious crashes.

References SoPickedPoint().

◆ getPoint()

const SbVec3f & SoPickedPoint::getPoint ( ) const

◆ getNormal()

const SbVec3f & SoPickedPoint::getNormal ( void  ) const

Returns the world space normal.

Referenced by SoVRMLTouchSensor::handleEvent().

◆ getTextureCoords()

const SbVec4f & SoPickedPoint::getTextureCoords ( ) const

Returns the image space texture coordinates.

Referenced by SoVRMLTouchSensor::handleEvent().

◆ getMaterialIndex()

int SoPickedPoint::getMaterialIndex ( ) const

Returns the material index.

◆ getPath()

SoPath * SoPickedPoint::getPath ( ) const

◆ isOnGeometry()

SbBool SoPickedPoint::isOnGeometry ( ) const

Returns TRUE if this picked point is on the actual geometry of the picked object, or FALSE if not (it might for instance be on the bounding box if picking was done on bounding boxes).

◆ getDetail()

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

Returns detail for node. If node equals NULL, the detail for the picked object is returned.

References SoPath::findNode().

Referenced by SoBaseKit::rayPick().

◆ getObjectToWorld()

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

Returns the matrix which converts from object (specified by node) to world space. If node equals NULL, the object space of the picked object will used.

References SoGetMatrixAction::getMatrix().

Referenced by SoVRMLDragSensor::handleEvent().

◆ getWorldToObject()

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

Returns the matrix which converts from world to object (specified by node) space. If node equals NULL, the object space of the picked object will used.

References SoGetMatrixAction::getInverse().

Referenced by getObjectNormal(), getObjectPoint(), and SoVRMLTouchSensor::handleEvent().

◆ getObjectToImage()

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

Returns the matrix which converts from object (specified by node) to image space. If node equals NULL, the object space of the picked object will used.

References SoGetMatrixAction::getTextureMatrix().

◆ getImageToObject()

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

Returns the matrix which converts from image to object (specified by node) space. If node equals NULL, the object space of the picked object will used.

References SoGetMatrixAction::getTextureInverse().

Referenced by getObjectTextureCoords(), and SoVRMLTouchSensor::handleEvent().

◆ getObjectPoint()

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

Returns the object space point, in the object space specified by node. If node equals NULL, the object space of the node where the point was actually picked will be used (this is what one would usually be interested in).

node can be any node in the scenegraph.

References getWorldToObject(), and SbMatrix::multVecMatrix().

Referenced by SoWWWAnchor::handleEvent().

◆ getObjectNormal()

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

Returns the object space (specified by node) normal. If node equals NULL, the picked point object space will be used.

References getWorldToObject(), and SbMatrix::multDirMatrix().

◆ getObjectTextureCoords()

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

Returns the object space (specified by node) texture coordinates. If node equals NULL, the picked point object space will be used.

References getImageToObject(), and SbMatrix::multVecMatrix().

◆ setObjectNormal()

void SoPickedPoint::setObjectNormal ( const SbVec3f normalref)

◆ setObjectTextureCoords()

void SoPickedPoint::setObjectTextureCoords ( const SbVec4f texCoordsref)

Sets the picked point object space texture coordinates.

Referenced by SoShape::invokeLineSegmentCallbacks(), SoShape::invokePointCallbacks(), and SoShape::invokeTriangleCallbacks().

◆ setMaterialIndex()

void SoPickedPoint::setMaterialIndex ( const int  index)

◆ setDetail()

void SoPickedPoint::setDetail ( SoDetail detail,
SoNode node 
)

Sets the detail for node. node must be in the picked path, of course. Set to NULL if you want to remove a detail for a node.

References SoAction::apply(), SoPath::findNode(), SoPath::getNode(), SoDetailList::set(), and SoGetMatrixAction::setViewportRegion().

Referenced by SoShape::invokeLineSegmentCallbacks(), SoShape::invokePointCallbacks(), SoShape::invokeTriangleCallbacks(), SoText2::rayPick(), and SoBaseKit::setPart().


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

Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.

Generated on Fri Feb 17 2017 for Coin by Doxygen. 1.8.13