.TH "SoExtSelection" 3 "Thu May 29 2014" "Version 4.0.0a" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoExtSelection \- .PP The \fBSoExtSelection\fP class can be used for extended selection functionality\&. .PP This class enables you to select geometry by specifying a lasso (a polygon) or a rectangle on screen\&. When objects are selected, you'll receive the same callbacks as for the \fBSoSelection\fP node\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBSoSelection\fP\&. .SS "Public Types" .in +1c .ti -1c .RI "enum \fBLassoType\fP { \fBNOLASSO\fP, \fBLASSO\fP, \fBRECTANGLE\fP }" .br .ti -1c .RI "enum \fBLassoPolicy\fP { \fBFULL_BBOX\fP, \fBPART_BBOX\fP, \fBFULL\fP, \fBPART\fP }" .br .ti -1c .RI "enum \fBLassoMode\fP { \fBALL_SHAPES\fP, \fBVISIBLE_SHAPES\fP }" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "virtual \fBSoType\fP \fBgetTypeId\fP (void) const " .br .RI "\fIReturns the type identification of an object derived from a class inheriting \fBSoBase\fP\&. This is used for run-time type checking and 'downward' casting\&. \fP" .ti -1c .RI "\fBSoExtSelection\fP (void)" .br .ti -1c .RI "void \fBuseOverlay\fP (SbBool overlay=TRUE)" .br .ti -1c .RI "SbBool \fBisUsingOverlay\fP (void)" .br .ti -1c .RI "\fBSoSeparator\fP * \fBgetOverlaySceneGraph\fP (void)" .br .ti -1c .RI "void \fBsetOverlayLassoColorIndex\fP (const int index)" .br .ti -1c .RI "int \fBgetOverlayLassoColorIndex\fP (void)" .br .ti -1c .RI "void \fBsetLassoColor\fP (const \fBSbColor\fP &color)" .br .ti -1c .RI "const \fBSbColor\fP & \fBgetLassoColor\fP (void)" .br .ti -1c .RI "void \fBsetLassoWidth\fP (const float width)" .br .ti -1c .RI "float \fBgetLassoWidth\fP (void)" .br .ti -1c .RI "void \fBsetOverlayLassoPattern\fP (const unsigned short pattern)" .br .ti -1c .RI "unsigned short \fBgetOverlayLassoPattern\fP (void)" .br .ti -1c .RI "void \fBanimateOverlayLasso\fP (const SbBool animate=TRUE)" .br .ti -1c .RI "SbBool \fBisOverlayLassoAnimated\fP (void)" .br .ti -1c .RI "virtual void \fBhandleEvent\fP (\fBSoHandleEventAction\fP *action)" .br .ti -1c .RI "virtual void \fBGLRenderBelowPath\fP (\fBSoGLRenderAction\fP *action)" .br .ti -1c .RI "void \fBselect\fP (\fBSoNode\fP *root, int numcoords, \fBSbVec2f\fP *lasso, const \fBSbViewportRegion\fP &vp, SbBool shiftpolicy)" .br .ti -1c .RI "void \fBselect\fP (\fBSoNode\fP *root, int numcoords, \fBSbVec3f\fP *lasso, const \fBSbViewportRegion\fP &vp, SbBool shiftkeypolicy)" .br .ti -1c .RI "const \fBSbVec2s\fP * \fBgetLassoCoordsDC\fP (int &numCoords)" .br .ti -1c .RI "const \fBSbVec3f\fP * \fBgetLassoCoordsWC\fP (int &numCoords)" .br .ti -1c .RI "const \fBSoPathList\fP & \fBgetSelectionPathList\fP () const " .br .ti -1c .RI "void \fBsetLassoFilterCallback\fP (SoLassoSelectionFilterCB *f, void *userdata=NULL, const SbBool callonlyifselectable=TRUE)" .br .ti -1c .RI "void \fBsetTriangleFilterCallback\fP (SoExtSelectionTriangleCB *func, void *userdata=NULL)" .br .ti -1c .RI "void \fBsetLineSegmentFilterCallback\fP (SoExtSelectionLineSegmentCB *func, void *userdata=NULL)" .br .ti -1c .RI "void \fBsetPointFilterCallback\fP (SoExtSelectionPointCB *func, void *userdata=NULL)" .br .ti -1c .RI "SbBool \fBwasShiftDown\fP (void) const " .br .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "static \fBSoType\fP \fBgetClassTypeId\fP (void)" .br .ti -1c .RI "static void \fBinitClass\fP (void)" .br .in -1c .SS "Public Attributes" .in +1c .ti -1c .RI "\fBSoSFEnum\fP \fBlassoType\fP" .br .ti -1c .RI "\fBSoSFEnum\fP \fBlassoPolicy\fP" .br .ti -1c .RI "\fBSoSFEnum\fP \fBlassoMode\fP" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "virtual const \fBSoFieldData\fP * \fBgetFieldData\fP (void) const " .br .ti -1c .RI "virtual \fB~SoExtSelection\fP ()" .br .in -1c .SS "Static Protected Member Functions" .in +1c .ti -1c .RI "static const \fBSoFieldData\fP ** \fBgetFieldDataPtr\fP (void)" .br .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP The \fBSoExtSelection\fP class can be used for extended selection functionality\&. .PP This class enables you to select geometry by specifying a lasso (a polygon) or a rectangle on screen\&. When objects are selected, you'll receive the same callbacks as for the \fBSoSelection\fP node\&. The application programmer interface of this class is somewhat complex, due to it's non-trivial functionality\&. To see an \fIextensive\fP usage example of the \fBSoExtSelection\fP node, we advise you to go look at the 'extselection' example application in the 'nodes/' directory of Kongsberg Oil & Gas Technologies's SoGuiExamples Mercurial repository\&. Further information and links for downloading and building this module should be available at \fCwww\&.coin3d\&.org\fP\&. .PP This node class is an extension versus the original SGI Inventor v2\&.1 API\&. It is based on the API of TGS Inventor's \fBSoExtSelection\fP, and we aim to be fully compatible with this node to enable users to switch between using Coin and TGS Inventor\&. Please contact us if you find discrepancies between Coin's \fBSoExtSelection\fP and TGS's \fBSoExtSelection\fP node\&. .PP \fBFILE FORMAT/DEFAULTS:\fP .PP .nf ExtSelection { renderCaching AUTO boundingBoxCaching AUTO renderCulling AUTO pickCulling AUTO policy SHIFT lassoType NOLASSO lassoPolicy FULL_BBOX lassoMode ALL_SHAPES } .fi .PP .PP \fBSince:\fP .RS 4 TGS Inventor 2\&.5 .PP Coin 1\&.0 .RE .PP .SH "Member Enumeration Documentation" .PP .SS "enum \fBSoExtSelection::LassoType\fP" Enum for type of lasso selection\&. .PP \fBEnumerator\fP .in +1c .TP \fB\fINOLASSO \fP\fP Makes this node behave like a normal \fBSoSelection\fP node\&. .TP \fB\fILASSO \fP\fP Select objects using a lasso\&. Selections can be aborted by the end-user by hitting the \fCEND\fP key on the keyboard\&. .TP \fB\fIRECTANGLE \fP\fP Select objects using a rectangle\&. Selections can be aborted by the end-user by hitting the \fCEND\fP key on the keyboard\&. .SS "enum \fBSoExtSelection::LassoPolicy\fP" Enum for specifying how objects are selected\&. .PP \fBEnumerator\fP .in +1c .TP \fB\fIFULL_BBOX \fP\fP The entire bounding box must be inside the lasso/rectangle\&. .TP \fB\fIPART_BBOX \fP\fP Some part of the bounding box must intersect the lasso/rectangle\&. .TP \fB\fIFULL \fP\fP All primitives must be completely inside the lasso/rectangle\&. .TP \fB\fIPART \fP\fP Some primitive must intersect the lasso/rectangle\&. .SS "enum \fBSoExtSelection::LassoMode\fP" Enum for specifying selection mode\&. .PP \fBEnumerator\fP .in +1c .TP \fB\fIALL_SHAPES \fP\fP All primitives inside the lasso/rectangle will be selected\&. .TP \fB\fIVISIBLE_SHAPES \fP\fP All \fIvisible\fP primitives inside the lasso/rectangle will be selected\&. .SH "Constructor & Destructor Documentation" .PP .SS "SoExtSelection::SoExtSelection (void)" Constructor\&. .SS "SoExtSelection::~SoExtSelection ()\fC [protected]\fP, \fC [virtual]\fP" Destructor\&. .SH "Member Function Documentation" .PP .SS "\fBSoType\fP SoExtSelection::getTypeId (void) const\fC [virtual]\fP" .PP Returns the type identification of an object derived from a class inheriting \fBSoBase\fP\&. This is used for run-time type checking and 'downward' casting\&. Usage example: .PP .PP .nf void foo(SoNode * node) { if (node->getTypeId() == SoFile::getClassTypeId()) { SoFile * filenode = (SoFile *)node; // safe downward cast, knows the type } } .fi .PP .PP For application programmers wanting to extend the library with new nodes, engines, nodekits, draggers or others: this method needs to be overridden in \fIall\fP subclasses\&. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through for instance \fBInventor/nodes/SoSubNode\&.h\fP (SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes), Inventor/engines/SoSubEngine\&.h (for engine classes) and so on\&. .PP For more information on writing Coin extensions, see the class documentation of the toplevel superclasses for the various class groups\&. .PP Reimplemented from \fBSoSelection\fP\&. .SS "const \fBSoFieldData\fP * SoExtSelection::getFieldData (void) const\fC [protected]\fP, \fC [virtual]\fP" Returns a pointer to the class-wide field data storage object for this instance\&. If no fields are present, returns \fCNULL\fP\&. .PP Reimplemented from \fBSoSelection\fP\&. .SS "void SoExtSelection::useOverlay (SbBooloverlay = \fCTRUE\fP)" Specifies whether the overlay planes should be used to render the lasso\&. .PP This method has been obsoleted in Coin, as most graphics cards comes without support for overlay rendering\&. A better strategy is to just 'overlay' the lasso graphics on top of the scene after everything else has been rendered -- and this is the strategy we apply in Coin\&. .SS "SbBool SoExtSelection::isUsingOverlay (void)" Returns whether overlay planes are used to draw the lasso\&. .PP \fBSee also:\fP .RS 4 \fBuseOverlay()\fP\&. .RE .PP .SS "\fBSoSeparator\fP * SoExtSelection::getOverlaySceneGraph (void)" Returns the scene graph for overlay rendering\&. Will always return NULL in Coin, as this method has been obsoleted\&. .PP (It is probably used in TGS Inventor from the SoXt / SoWin libraries' So[Xt|Win]RenderArea class to fetch the overlay graph to draw, and as such should be treated as an internal method\&.) .SS "void SoExtSelection::setOverlayLassoColorIndex (const intindex)" Obsoleted in Coin, use \fBSoExtSelection::setLassoColor()\fP instead\&. .SS "int SoExtSelection::getOverlayLassoColorIndex (void)" Obsoleted in Coin, use \fBSoExtSelection::getLassoColor()\fP instead\&. .PP \fBSee also:\fP .RS 4 \fBsetOverlayLassoColorIndex()\fP\&. .RE .PP .SS "void SoExtSelection::setLassoColor (const \fBSbColor\fP &color)" Sets the lasso/rectangle line color\&. Default value is (1\&.0, 1\&.0, 1\&.0)\&. .SS "const \fBSbColor\fP & SoExtSelection::getLassoColor (void)" Returns the lasso color\&. .SS "void SoExtSelection::setLassoWidth (const floatwidth)" Sets the lasso line width\&. Default value is 1\&.0\&. .SS "float SoExtSelection::getLassoWidth (void)" Returns the lasso line width\&. .SS "void SoExtSelection::setOverlayLassoPattern (const unsigned shortpattern)" Sets the lasso line pattern\&. Default value is 0xf0f0\&. .SS "unsigned short SoExtSelection::getOverlayLassoPattern (void)" Returns the lasso line pattern\&. .SS "void SoExtSelection::animateOverlayLasso (const SbBoolanimate = \fCTRUE\fP)" Sets whether the lasso should be animated by scrolling the line pattern\&. .SS "SbBool SoExtSelection::isOverlayLassoAnimated (void)" Returns whether the lasso is set to animate or not\&. .SS "void SoExtSelection::handleEvent (\fBSoHandleEventAction\fP *action)\fC [virtual]\fP" Action method for \fBSoHandleEventAction\fP\&. .PP Inspects the event data from \fIaction\fP, and processes it if it is something which this node should react to\&. .PP Nodes influencing relevant state variables for how event handling is done also overrides this method\&. .PP Reimplemented from \fBSoSelection\fP\&. .SS "void SoExtSelection::GLRenderBelowPath (\fBSoGLRenderAction\fP *action)\fC [virtual]\fP" SGI Open Inventor v2\&.1 obsoleted support for \fBSoGLRenderAction::addMethod()\fP\&. Instead, \fBGLRender()\fP might be called directly, and to optimize traversal, the \fBSoSeparator\fP node calls GLRenderBelowPath whenever the path code is BELOW_PATH or NO_PATH (path code is guaranteed not to change)\&. To be compatible with SGI's Inventor (and thereby also TGS') we have chosen to follow their implementation in this respect\&. .PP \fBSoSeparator::GLRenderBelowPath()\fP do not traverse its children using \fBSoChildList::traverse()\fP, but calls \fBGLRenderBelowPath()\fP directly for all its children\&. .PP Reimplemented from \fBSoSeparator\fP\&. .SS "const \fBSbVec2s\fP * SoExtSelection::getLassoCoordsDC (int &numCoords)" Returns lasso coordinates in device coordinates\&. .PP This function is currently just stubbed\&. .SS "const \fBSbVec3f\fP * SoExtSelection::getLassoCoordsWC (int &numCoords)" Returns lasso coordinates in world coordinates\&. .PP This function is currently just stubbed\&. .SS "const \fBSoPathList\fP & SoExtSelection::getSelectionPathList () const" Returns a pathlist containing selected objects\&. .PP This function is currently just stubbed\&. .SS "void SoExtSelection::setLassoFilterCallback (SoLassoSelectionFilterCB *f, void *userdata = \fCNULL\fP, const SbBoolcallonlyifselectable = \fCTRUE\fP)" The lasso selection filter callback is called when a node is about to be selected, and enables the application programmer to return a new path to be used when selecting\&. The new returned path should not be ref'd\&. \fBSoExtSelection\fP will \fBref()\fP and \fBunref()\fP it\&. .PP To cancel the selection, return NULL from the callback\&. .PP if \fIcallonlyifselectable\fP is TRUE, the callback will only be invoked when the path to the new node pass through the \fBSoExtSelection\fP node\&. .PP This method is specific to Coin, and is not part of TGS OIV\&. .SS "void SoExtSelection::setTriangleFilterCallback (SoExtSelectionTriangleCB *func, void *userdata = \fCNULL\fP)" Sets the callback that will be called for every triangle inside the lasso/rectangle when selecting\&. .PP The callback should return \fCFALSE\fP if it wants to continue being invoked\&. When the callback returns \fCTRUE\fP, the object/shape is selected, and no more callbacks will be invoked for the object\&. .PP \fBSee also:\fP .RS 4 \fBsetLineSegmentFilterCallback\fP, \fBsetPointFilterCallback\fP .RE .PP .SS "void SoExtSelection::setLineSegmentFilterCallback (SoExtSelectionLineSegmentCB *func, void *userdata = \fCNULL\fP)" Sets the callback that will be called for every line segment inside the lasso/rectangle when selecting\&. .PP The callback should return \fCFALSE\fP if it wants to continue being invoked\&. When the callback returns \fCTRUE\fP, the object/shape is selected, and no more callbacks will be invoked for the object\&. .PP \fBSee also:\fP .RS 4 \fBsetTriangleFilterCallback\fP, \fBsetPointFilterCallback\fP .RE .PP .SS "void SoExtSelection::setPointFilterCallback (SoExtSelectionPointCB *func, void *userdata = \fCNULL\fP)" Sets the callback that will be called for every point inside the lasso/rectangle when selecting\&. .PP The callback should return \fCFALSE\fP if it wants to continue being invoked\&. When the user returns \fCTRUE\fP, the object/shape is selected, and no more callbacks will be invoked for the object\&. .PP \fBSee also:\fP .RS 4 \fBsetLineSegmentFilterCallback\fP, \fBsetTriangleFilterCallback\fP .RE .PP .SS "SbBool SoExtSelection::wasShiftDown (void) const" Returns whether the \fCSHIFT\fP key was pressed during the latest user interaction\&. This is useful if you want to respect the shift policy while selecting primitives\&. .PP This method is specific to Coin, and is not part of TGS OIV\&. .SH "Member Data Documentation" .PP .SS "\fBSoSFEnum\fP SoExtSelection::lassoType" Field for lasso type\&. Default value is \fBSoExtSelection::NOLASSO\fP\&. .PP Selections with type \fBSoExtSelection::RECTANGLE\fP or \fBSoExtSelection::LASSO\fP can be aborted by the end-user by hitting the \fCEND\fP key on the keyboard\&. .SS "\fBSoSFEnum\fP SoExtSelection::lassoPolicy" Field for lasso policy\&. Default value is FULL_BBOX\&. .SS "\fBSoSFEnum\fP SoExtSelection::lassoMode" Field for lasso mode\&. Default value is ALL_SHAPES\&. .PP Set this field to VISIBLE_SHAPES to make only the primitives visible from the current viewpoint be selected\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.