SoExtSelection.h
#ifndef COIN_SOEXTSELECTION_H
#define COIN_SOEXTSELECTION_H
/**************************************************************************\
* Copyright (c) Kongsberg Oil & Gas Technologies AS
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\**************************************************************************/
#include <Inventor/nodes/SoSubNode.h>
#include <Inventor/nodes/SoSelection.h>
#include <Inventor/fields/SoSFEnum.h>
#include <cstddef> // NULL
#ifndef COIN_INTERNAL
#include <Inventor/actions/SoCallbackAction.h>
#endif // !COIN_INTERNAL
class SbColor;
class SbVec3f;
class SbVec2f;
class SbVec2s;
class SbViewportRegion;
class SoPrimitiveVertex;
// This shouldn't strictly be necessary, but the OSF1/cxx compiler
// complains if this is left out, while using the "friend class
// SoExtSelectionP" statement in the class definition.
class SoExtSelectionP;
typedef SbBool SoExtSelectionTriangleCB(void * userdata,
SoCallbackAction * action,
const SoPrimitiveVertex * v1,
const SoPrimitiveVertex * v2,
const SoPrimitiveVertex * v3);
typedef SbBool SoExtSelectionLineSegmentCB(void * userdata,
SoCallbackAction * action,
const SoPrimitiveVertex * v1,
const SoPrimitiveVertex * v2);
typedef SbBool SoExtSelectionPointCB(void * userdata,
SoCallbackAction * action,
const SoPrimitiveVertex * v1);
typedef SoPath * SoLassoSelectionFilterCB(void * userdata, const SoPath * path);
class COIN_DLL_API SoExtSelection : public SoSelection {
typedef SoSelection inherited;
SO_NODE_HEADER(SoExtSelection);
public:
static void initClass(void);
SoExtSelection(void);
enum LassoType {
NOLASSO, LASSO, RECTANGLE
};
enum LassoPolicy {
FULL_BBOX, PART_BBOX, FULL, PART
};
enum LassoMode {
ALL_SHAPES,
VISIBLE_SHAPES
};
SoSFEnum lassoType;
SoSFEnum lassoPolicy;
SoSFEnum lassoMode;
void useOverlay(SbBool overlay = TRUE);
SbBool isUsingOverlay(void);
SoSeparator * getOverlaySceneGraph(void);
void setOverlayLassoColorIndex(const int index);
int getOverlayLassoColorIndex(void);
void setLassoColor(const SbColor & color);
const SbColor & getLassoColor(void);
void setLassoWidth(const float width);
float getLassoWidth(void);
void setOverlayLassoPattern(const unsigned short pattern);
unsigned short getOverlayLassoPattern(void);
void animateOverlayLasso(const SbBool animate = TRUE);
SbBool isOverlayLassoAnimated(void);
virtual void handleEvent(SoHandleEventAction * action);
virtual void GLRenderBelowPath(SoGLRenderAction * action);
void select(SoNode * root, int numcoords, SbVec2f * lasso,
const SbViewportRegion & vp, SbBool shiftpolicy);
void select(SoNode * root, int numcoords, SbVec3f * lasso,
const SbViewportRegion & vp, SbBool shiftkeypolicy);
const SbVec2s * getLassoCoordsDC(int & numCoords);
const SbVec3f * getLassoCoordsWC(int & numCoords);
const SoPathList & getSelectionPathList() const;
void setLassoFilterCallback(SoLassoSelectionFilterCB * f, void * userdata = NULL,
const SbBool callonlyifselectable = TRUE);
void setTriangleFilterCallback(SoExtSelectionTriangleCB * func,
void * userdata = NULL);
void setLineSegmentFilterCallback(SoExtSelectionLineSegmentCB * func,
void * userdata = NULL);
void setPointFilterCallback(SoExtSelectionPointCB * func,
void * userdata = NULL);
SbBool wasShiftDown(void) const;
protected:
virtual ~SoExtSelection();
private:
void draw(SoGLRenderAction * action);
friend class SoExtSelectionP;
class SoExtSelectionP * pimpl;
};
#endif // !COIN_SOEXTSELECTION_H
SbColor
The SbColor class contains the red, green and blue components which make up a color value.
Definition SbColor.h:39
SbVec2f
The SbVec2f class is a 2 dimensional vector with floating point coordinates.
Definition SbVec2f.h:49
SbVec2s
The SbVec2s class is a 2 dimensional vector with short integer coordinates.
Definition SbVec2s.h:51
SbVec3f
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition SbVec3f.h:51
SbViewportRegion
The SbViewportRegion class is a viewport within a full window.
Definition SbViewportRegion.h:40
SoCallbackAction
The SoCallbackAction class invokes callbacks at specific nodes.
Definition SoCallbackAction.h:80
SoExtSelection::lassoPolicy
SoSFEnum lassoPolicy
Definition SoExtSelection.h:99
SoExtSelection::isUsingOverlay
SbBool isUsingOverlay(void)
Definition SoExtSelection.cpp:855
SoExtSelection::LassoPolicy
LassoPolicy
Definition SoExtSelection.h:89
SoExtSelection::FULL
@ FULL
Definition SoExtSelection.h:90
SoExtSelection::FULL_BBOX
@ FULL_BBOX
Definition SoExtSelection.h:90
SoExtSelection::PART
@ PART
Definition SoExtSelection.h:90
SoExtSelection::PART_BBOX
@ PART_BBOX
Definition SoExtSelection.h:90
SoExtSelection::setLassoColor
void setLassoColor(const SbColor &color)
Definition SoExtSelection.cpp:906
SoExtSelection::setOverlayLassoColorIndex
void setOverlayLassoColorIndex(const int index)
Definition SoExtSelection.cpp:882
SoExtSelection::lassoMode
SoSFEnum lassoMode
Definition SoExtSelection.h:100
SoExtSelection::setOverlayLassoPattern
void setOverlayLassoPattern(const unsigned short pattern)
Definition SoExtSelection.cpp:946
SoExtSelection::getLassoCoordsWC
const SbVec3f * getLassoCoordsWC(int &numCoords)
Definition SoExtSelection.cpp:1295
SoExtSelection::getLassoWidth
float getLassoWidth(void)
Definition SoExtSelection.cpp:935
SoExtSelection::setPointFilterCallback
void setPointFilterCallback(SoExtSelectionPointCB *func, void *userdata=NULL)
Definition SoExtSelection.cpp:1387
SoExtSelection::isOverlayLassoAnimated
SbBool isOverlayLassoAnimated(void)
Definition SoExtSelection.cpp:976
SoExtSelection::getOverlayLassoPattern
unsigned short getOverlayLassoPattern(void)
Definition SoExtSelection.cpp:955
SoExtSelection::getLassoCoordsDC
const SbVec2s * getLassoCoordsDC(int &numCoords)
Definition SoExtSelection.cpp:1282
SoExtSelection::SoExtSelection
SoExtSelection(void)
Definition SoExtSelection.cpp:735
SoExtSelection::getLassoColor
const SbColor & getLassoColor(void)
Definition SoExtSelection.cpp:915
SoExtSelection::getOverlaySceneGraph
SoSeparator * getOverlaySceneGraph(void)
Definition SoExtSelection.cpp:870
SoExtSelection::animateOverlayLasso
void animateOverlayLasso(const SbBool animate=TRUE)
Definition SoExtSelection.cpp:967
SoExtSelection::setTriangleFilterCallback
void setTriangleFilterCallback(SoExtSelectionTriangleCB *func, void *userdata=NULL)
Definition SoExtSelection.cpp:1351
SoExtSelection::setLassoFilterCallback
void setLassoFilterCallback(SoLassoSelectionFilterCB *f, void *userdata=NULL, const SbBool callonlyifselectable=TRUE)
Definition SoExtSelection.cpp:1332
SoExtSelection::LassoMode
LassoMode
Definition SoExtSelection.h:93
SoExtSelection::VISIBLE_SHAPES
@ VISIBLE_SHAPES
Definition SoExtSelection.h:95
SoExtSelection::ALL_SHAPES
@ ALL_SHAPES
Definition SoExtSelection.h:94
SoExtSelection::getSelectionPathList
const SoPathList & getSelectionPathList() const
Definition SoExtSelection.cpp:1308
SoExtSelection::getOverlayLassoColorIndex
int getOverlayLassoColorIndex(void)
Definition SoExtSelection.cpp:893
SoExtSelection::lassoType
SoSFEnum lassoType
Definition SoExtSelection.h:98
SoExtSelection::setLassoWidth
void setLassoWidth(const float width)
Definition SoExtSelection.cpp:926
SoExtSelection::setLineSegmentFilterCallback
void setLineSegmentFilterCallback(SoExtSelectionLineSegmentCB *func, void *userdata=NULL)
Definition SoExtSelection.cpp:1369
SoExtSelection::LassoType
LassoType
Definition SoExtSelection.h:85
SoExtSelection::RECTANGLE
@ RECTANGLE
Definition SoExtSelection.h:86
SoExtSelection::NOLASSO
@ NOLASSO
Definition SoExtSelection.h:86
SoExtSelection::LASSO
@ LASSO
Definition SoExtSelection.h:86
SoExtSelection::wasShiftDown
SbBool wasShiftDown(void) const
Definition SoExtSelection.cpp:1402
SoExtSelection::useOverlay
void useOverlay(SbBool overlay=TRUE)
Definition SoExtSelection.cpp:844
SoGLRenderAction
The SoGLRenderAction class renders the scene graph with OpenGL calls.
Definition SoGLRenderAction.h:50
SoHandleEventAction
The SoHandleEventAction class distributes user events to the scene.
Definition SoHandleEventAction.h:46
SoNode
The SoNode class is the base class for nodes used in scene graphs.
Definition SoNode.h:56
SoPathList
The SoPathList class is a container for pointers to SoPath objects.
Definition SoPathList.h:40
SoPath
The SoPath class is a container class for traversal path descriptions.
Definition SoPath.h:52
SoPrimitiveVertex
The SoPrimitiveVertex class represents a single vertex of a generated primitive.
Definition SoPrimitiveVertex.h:43
SoSFEnum
The SoSFEnum class is a container for an enum value.
Definition SoSFEnum.h:40
SoSelection::handleEvent
virtual void handleEvent(SoHandleEventAction *action)
Definition SoSelection.cpp:856
SoSelection::initClass
static void initClass(void)
Sets up initialization for data common to all instances of this class, like submitting necessary info...
Definition SoSelection.cpp:330
SoSelection::SoSelection
SoSelection(void)
Definition SoSelection.cpp:294
SoSelection::select
void select(const SoPath *path)
Definition SoSelection.cpp:371
SoSeparator::GLRenderBelowPath
virtual void GLRenderBelowPath(SoGLRenderAction *action)
Definition SoSeparator.cpp:653
SoSeparator::SoSeparator
SoSeparator(void)
Definition SoSeparator.cpp:383
SO_NODE_HEADER
#define SO_NODE_HEADER(classname)
Definition Coin_macros.dox:50