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

SoExtSelection.h
1 #ifndef COIN_SOEXTSELECTION_H
2 #define COIN_SOEXTSELECTION_H
3 
4 /**************************************************************************\
5  *
6  * This file is part of the Coin 3D visualization library.
7  * Copyright (C) 1998-2007 by Systems in Motion. All rights reserved.
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * ("GPL") version 2 as published by the Free Software Foundation.
12  * See the file LICENSE.GPL at the root directory of this source
13  * distribution for additional information about the GNU GPL.
14  *
15  * For using Coin with software that can not be combined with the GNU
16  * GPL, and for taking advantage of the additional benefits of our
17  * support services, please contact Systems in Motion about acquiring
18  * a Coin Professional Edition License.
19  *
20  * See http://www.coin3d.org/ for more information.
21  *
22  * Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
23  * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24  *
25 \**************************************************************************/
26 
27 #include <Inventor/nodes/SoSubNode.h>
28 #include <Inventor/nodes/SoSelection.h>
29 #include <Inventor/fields/SoSFEnum.h>
30 #include <stddef.h> // NULL
31 
32 #ifndef COIN_INTERNAL
33 #include <Inventor/actions/SoCallbackAction.h>
34 #endif // !COIN_INTERNAL
35 
36 class SbColor;
37 class SbVec3f;
38 class SbVec2f;
39 class SbVec2s;
40 class SbViewportRegion;
41 class SoPrimitiveVertex;
42 
43 // This shouldn't strictly be necessary, but the OSF1/cxx compiler
44 // complains if this is left out, while using the "friend class
45 // SoExtSelectionP" statement in the class definition.
46 class SoExtSelectionP;
47 
48 
49 typedef SbBool SoExtSelectionTriangleCB(void * userdata,
50  SoCallbackAction * action,
51  const SoPrimitiveVertex * v1,
52  const SoPrimitiveVertex * v2,
53  const SoPrimitiveVertex * v3);
54 
55 typedef SbBool SoExtSelectionLineSegmentCB(void * userdata,
56  SoCallbackAction * action,
57  const SoPrimitiveVertex * v1,
58  const SoPrimitiveVertex * v2);
59 
60 typedef SbBool SoExtSelectionPointCB(void * userdata,
61  SoCallbackAction * action,
62  const SoPrimitiveVertex * v1);
63 
64 typedef SoPath * SoLassoSelectionFilterCB(void * userdata, const SoPath * path);
65 
66 
67 class COIN_DLL_API SoExtSelection : public SoSelection {
68  typedef SoSelection inherited;
69 
70  SO_NODE_HEADER(SoExtSelection);
71 
72 public:
73  static void initClass(void);
74  SoExtSelection(void);
75 
76  enum LassoType {
77  NOLASSO, LASSO, RECTANGLE
78  };
79 
80  enum LassoPolicy {
81  FULL_BBOX, PART_BBOX, FULL, PART
82  };
83 
84  enum LassoMode {
86  VISIBLE_SHAPES
87  };
88 
92 
93  void useOverlay(SbBool overlay = TRUE);
94  SbBool isUsingOverlay(void);
95  SoSeparator * getOverlaySceneGraph(void);
96  void setOverlayLassoColorIndex(const int index);
97  int getOverlayLassoColorIndex(void);
98  void setLassoColor(const SbColor & color);
99  const SbColor & getLassoColor(void);
100  void setLassoWidth(const float width);
101  float getLassoWidth(void);
102  void setOverlayLassoPattern(const unsigned short pattern);
103  unsigned short getOverlayLassoPattern(void);
104  void animateOverlayLasso(const SbBool animate = TRUE);
105  SbBool isOverlayLassoAnimated(void);
106 
107  virtual void handleEvent(SoHandleEventAction * action);
108  virtual void GLRenderBelowPath(SoGLRenderAction * action);
109 
110  void select(SoNode * root, int numcoords, SbVec2f * lasso,
111  const SbViewportRegion & vp, SbBool shiftpolicy);
112  void select(SoNode * root, int numcoords, SbVec3f * lasso,
113  const SbViewportRegion & vp, SbBool shiftkeypolicy);
114  const SbVec2s * getLassoCoordsDC(int & numCoords);
115  const SbVec3f * getLassoCoordsWC(int & numCoords);
116  const SoPathList & getSelectionPathList() const;
117 
118  void setLassoFilterCallback(SoLassoSelectionFilterCB * f, void * userdata = NULL,
119  const SbBool callonlyifselectable = TRUE);
120 
121  void setTriangleFilterCallback(SoExtSelectionTriangleCB * func,
122  void * userdata = NULL);
123  void setLineSegmentFilterCallback(SoExtSelectionLineSegmentCB * func,
124  void * userdata = NULL);
125  void setPointFilterCallback(SoExtSelectionPointCB * func,
126  void * userdata = NULL);
127  SbBool wasShiftDown(void) const;
128 
129 protected:
130  virtual ~SoExtSelection();
131 
132 private:
133  void draw(SoGLRenderAction * action);
134 
135  friend class SoExtSelectionP;
136  class SoExtSelectionP * pimpl;
137 };
138 
139 #endif // !COIN_SOEXTSELECTION_H
SoExtSelection::getOverlayLassoPattern
unsigned short getOverlayLassoPattern(void)
Definition: SoExtSelection.cpp:938
SoExtSelection::PART
@ PART
Definition: SoExtSelection.h:81
SoCallbackAction::Response
Response
Definition: SoCallbackAction.h:85
SbTesselator
The SbTesselator class is used to tessellate polygons into triangles.
Definition: SbTesselator.h:38
SbBox2s::getMax
const SbVec2s & getMax(void) const
Definition: SbBox2s.cpp:234
SoState
The SoState class manages the Coin scenegraph traversal state data.
Definition: SoState.h:35
SbBox2s
The SbBox2s class is a 2 dimensional box with short integer coordinates.
Definition: SbBox2s.h:34
SoPointSizeElement::get
static float get(SoState *const state)
Definition: SoPointSizeElement.cpp:92
SoEvent::wasShiftDown
SbBool wasShiftDown(void) const
Definition: SoEvent.cpp:236
SbViewportRegion::getViewportSizePixels
const SbVec2s & getViewportSizePixels(void) const
Definition: SbViewportRegion.cpp:425
SbList::getArrayPtr
const Type * getArrayPtr(const int start=0) const
Definition: SbList.h:168
SbVec2f
The SbVec2f class is a 2 dimensional vector with floating point coordinates.
Definition: SbVec2f.h:36
SoAction::apply
virtual void apply(SoNode *root)
Definition: SoAction.cpp:476
SoPath::getTail
SoNode * getTail(void) const
Definition: SoPath.cpp:373
SoExtSelection::getLassoWidth
float getLassoWidth(void)
Definition: SoExtSelection.cpp:918
SoState::pop
void pop(void)
Definition: SoState.cpp:284
SoShape
The SoShape class is the superclass for geometry shapes.
Definition: SoShape.h:43
SoPrimitiveVertex::getPoint
const SbVec3f & getPoint(void) const
Definition: SoPrimitiveVertex.cpp:91
SbMatrix
The SbMatrix class is a 4x4 dimensional representation of a matrix.
Definition: SbMatrix.h:37
SoShape::getBoundingBoxCache
const SoBoundingBoxCache * getBoundingBoxCache(void) const
Definition: SoShape.cpp:1537
SoExtSelection::setLassoWidth
void setLassoWidth(const float width)
Definition: SoExtSelection.cpp:909
SoExtSelection::LassoPolicy
LassoPolicy
Definition: SoExtSelection.h:80
SbBox3f::getCenter
SbVec3f getCenter(void) const
Definition: SbBox3f.cpp:161
SoDebugError::post
static void post(const char *const source, const char *const format,...)
Definition: SoDebugError.cpp:314
SoSensor
The SoSensor class is the abstract base class for all sensors.
Definition: SoSensor.h:34
SoExtSelection::useOverlay
void useOverlay(SbBool overlay=1)
Definition: SoExtSelection.cpp:827
SbViewVolume::getWidth
float getWidth(void) const
Definition: SbViewVolume.cpp:631
SoExtSelection::LassoType
LassoType
Definition: SoExtSelection.h:76
SoExtSelection::getOverlayLassoColorIndex
int getOverlayLassoColorIndex(void)
Definition: SoExtSelection.cpp:876
SbViewportRegion::getWindowSize
const SbVec2s & getWindowSize(void) const
Definition: SbViewportRegion.cpp:366
SbList::truncate
void truncate(const int length, const int dofit=0)
Definition: SbList.h:149
SoExtSelection::getLassoCoordsWC
const SbVec3f * getLassoCoordsWC(int &numCoords)
Definition: SoExtSelection.cpp:1278
SbMatrix::multVecMatrix
void multVecMatrix(const SbVec3f &src, SbVec3f &dst) const
Definition: SbMatrix.cpp:1357
SoState::push
void push(void)
Definition: SoState.cpp:265
SoExtSelection::PART_BBOX
@ PART_BBOX
Definition: SoExtSelection.h:81
SoExtSelection::setOverlayLassoColorIndex
void setOverlayLassoColorIndex(const int index)
Definition: SoExtSelection.cpp:865
SoGLRenderAction::addDelayedPath
void addDelayedPath(SoPath *path)
Definition: SoGLRenderAction.cpp:1205
SbBox3f::getMin
const SbVec3f & getMin(void) const
Definition: SbBox3f.cpp:122
SoExtSelection::select
void select(SoNode *root, int numcoords, SbVec2f *lasso, const SbViewportRegion &vp, SbBool shiftpolicy)
Definition: SoExtSelection.cpp:1249
SoExtSelection::getSelectionPathList
const SoPathList & getSelectionPathList() const
Definition: SoExtSelection.cpp:1293
SoTimerSensor::setBaseTime
void setBaseTime(const SbTime &base)
Definition: SoTimerSensor.cpp:94
SoBase::touch
void touch(void)
Definition: SoBase.cpp:700
SoGLRenderAction::getCacheContext
uint32_t getCacheContext(void) const
Definition: SoGLRenderAction.cpp:902
SbBox3f
The SbBox3f class is an abstraction for an axis aligned 3 dimensional box.
Definition: SbBox3f.h:37
SoAction::getCurPath
const SoPath * getCurPath(void)
Definition: SoAction.cpp:1044
SbMatrix::multLeft
SbMatrix & multLeft(const SbMatrix &m)
Definition: SbMatrix.cpp:1280
SoAction
The SoAction class is the base class for all traversal actions.
Definition: SoAction.h:67
SoCallback
The SoCallback class is a node type which provides a means of setting callback hooks in the scene gra...
Definition: SoCallback.h:31
SoExtSelection::getLassoCoordsDC
const SbVec2s * getLassoCoordsDC(int &numCoords)
Definition: SoExtSelection.cpp:1263
SoExtSelection::NOLASSO
@ NOLASSO
Definition: SoExtSelection.h:77
SoExtSelection::GLRenderBelowPath
virtual void GLRenderBelowPath(SoGLRenderAction *action)
Definition: SoExtSelection.cpp:1201
SoPathList
The SoPathList class is a container for pointers to SoPath objects.
Definition: SoPathList.h:31
SbList::append
void append(const Type item)
Definition: SbList.h:98
SoExtSelection::handleEvent
virtual void handleEvent(SoHandleEventAction *action)
Definition: SoExtSelection.cpp:1060
SoExtSelection::FULL
@ FULL
Definition: SoExtSelection.h:81
SoSeparator::GLRenderBelowPath
virtual void GLRenderBelowPath(SoGLRenderAction *action)
Definition: SoSeparator.cpp:605
SoCallback::setCallback
void setCallback(SoCallbackCB *function, void *userdata=NULL)
Definition: SoCallback.cpp:144
SoSelection::handleEvent
virtual void handleEvent(SoHandleEventAction *action)
Definition: SoSelection.cpp:835
SoCallbackAction::setViewportRegion
void setViewportRegion(const SbViewportRegion &vp)
Definition: SoCallbackAction.cpp:400
SoBase::unref
void unref(void) const
Definition: SoBase.cpp:627
SbVec2s
The SbVec2s class is a 2 dimensional vector with short integer coordinates.
Definition: SbVec2s.h:37
SoPath::findNode
int findNode(const SoNode *const node) const
Definition: SoPath.cpp:587
SoExtSelection::setTriangleFilterCallback
void setTriangleFilterCallback(SoExtSelectionTriangleCB *func, void *userdata=NULL)
Definition: SoExtSelection.cpp:1336
SoPath
The SoPath class is a container class for traversal path descriptions.
Definition: SoPath.h:43
SoSeparator::handleEvent
virtual void handleEvent(SoHandleEventAction *action)
Definition: SoSeparator.cpp:745
SoHandleEventAction::isHandled
SbBool isHandled(void) const
Definition: SoHandleEventAction.cpp:223
SoExtSelection::lassoType
SoSFEnum lassoType
Definition: SoExtSelection.h:89
SoExtSelection::setOverlayLassoPattern
void setOverlayLassoPattern(const unsigned short pattern)
Definition: SoExtSelection.cpp:929
SbList< SbVec2s >
SbName::getString
const char * getString(void) const
Definition: SbName.cpp:278
SoDebugError::postInfo
static void postInfo(const char *const source, const char *const format,...)
Definition: SoDebugError.cpp:334
SoExtSelection::LASSO
@ LASSO
Definition: SoExtSelection.h:77
SbBox3f::getMax
const SbVec3f & getMax(void) const
Definition: SbBox3f.cpp:134
SoSelection::SINGLE
@ SINGLE
Definition: SoSelection.h:51
SbList::getLength
int getLength(void) const
Definition: SbList.h:145
SoSFEnum
The SoSFEnum class is a container for an enum value.
Definition: SoSFEnum.h:31
SoExtSelection::RECTANGLE
@ RECTANGLE
Definition: SoExtSelection.h:77
SoTimerSensor::setInterval
void setInterval(const SbTime &interval)
Definition: SoTimerSensor.cpp:117
SoPrimitiveVertex
The SoPrimitiveVertex class represents a single vertex of a generated primitive.
Definition: SoPrimitiveVertex.h:33
SoExtSelection::getLassoColor
const SbColor & getLassoColor(void)
Definition: SoExtSelection.cpp:898
SoExtSelection::setLassoColor
void setLassoColor(const SbColor &color)
Definition: SoExtSelection.cpp:889
SoExtSelection::LassoMode
LassoMode
Definition: SoExtSelection.h:84
SbColor
The SbColor class contains the red, green and blue components which make up a color value.
Definition: SbColor.h:30
SoBase
The SoBase class is the top-level superclass for a number of class-hierarchies.
Definition: SoBase.h:41
SoExtSelection
The SoExtSelection class can be used for extended selection functionality.
Definition: SoExtSelection.h:67
SoTimerSensor
The SoTimerSensor class is a sensor which will trigger at given intervals.
Definition: SoTimerSensor.h:29
SoAction::getState
SoState * getState(void) const
Definition: SoAction.cpp:1028
SoExtSelection::isUsingOverlay
SbBool isUsingOverlay(void)
Definition: SoExtSelection.cpp:838
SoBase::ref
void ref(void) const
Definition: SoBase.cpp:574
SbVec3f
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition: SbVec3f.h:37
SoSelection::select
void select(const SoPath *path)
Definition: SoSelection.cpp:353
SoSelection::SHIFT
@ SHIFT
Definition: SoSelection.h:51
SoCallbackAction::CONTINUE
@ CONTINUE
Definition: SoCallbackAction.h:85
SoGLRenderAction::isRenderingDelayedPaths
SbBool isRenderingDelayedPaths(void) const
Definition: SoGLRenderAction.cpp:1218
SoPath::copy
SoPath * copy(const int startfromnodeindex=0, int numnodes=0) const
Definition: SoPath.cpp:673
SoTimerQueueSensor::isScheduled
virtual SbBool isScheduled(void) const
Definition: SoTimerQueueSensor.cpp:216
SbBox2s::getMin
const SbVec2s & getMin(void) const
Definition: SbBox2s.cpp:215
SbViewVolume::narrow
SbViewVolume narrow(float left, float bottom, float right, float top) const
Definition: SbViewVolume.cpp:386
SoCallbackAction
The SoCallbackAction class invokes callbacks at specific nodes.
Definition: SoCallbackAction.h:70
SoExtSelection::VISIBLE_SHAPES
@ VISIBLE_SHAPES
Definition: SoExtSelection.h:86
SbViewVolume::getDepth
float getDepth(void) const
Definition: SbViewVolume.cpp:654
SbViewportRegion
The SbViewportRegion class is a viewport within a full window.
Definition: SbViewportRegion.h:31
SoHandleEventAction::getViewportRegion
const SbViewportRegion & getViewportRegion(void) const
Definition: SoHandleEventAction.cpp:178
SoBase::getTypeId
virtual SoType getTypeId(void) const =0
SoExtSelection::animateOverlayLasso
void animateOverlayLasso(const SbBool animate=1)
Definition: SoExtSelection.cpp:950
SoSeparator
The SoSeparator class is a state-preserving group node.
Definition: SoSeparator.h:34
SbViewVolume
The SbViewVolume class is a viewing volume in 3D space.
Definition: SbViewVolume.h:41
SoExtSelection::isOverlayLassoAnimated
SbBool isOverlayLassoAnimated(void)
Definition: SoExtSelection.cpp:959
SoExtSelection::setLassoFilterCallback
void setLassoFilterCallback(SoLassoSelectionFilterCB *f, void *userdata=NULL, const SbBool callonlyifselectable=1)
Definition: SoExtSelection.cpp:1317
SoHandleEventAction::getEvent
const SoEvent * getEvent(void) const
Definition: SoHandleEventAction.cpp:196
SbTime
The SbTime class instances represents time values.
Definition: SbTime.h:41
SoExtSelection::wasShiftDown
SbBool wasShiftDown(void) const
Definition: SoExtSelection.cpp:1387
SbBox2s::intersect
SbBool intersect(const SbVec2s &point) const
Definition: SbBox2s.cpp:286
SoOffscreenRenderer
The SoOffscreenRenderer class is used for rendering scenes in offscreen buffers.
Definition: SoOffscreenRenderer.h:47
SoBase::isOfType
SbBool isOfType(SoType type) const
Definition: SoBase.cpp:710
SoNode
The SoNode class is the base class for nodes used in scene graphs.
Definition: SoNode.h:47
SoExtSelection::SoExtSelection
SoExtSelection(void)
Definition: SoExtSelection.cpp:723
SbVec3f::getValue
const float * getValue(void) const
Definition: SbVec3f.cpp:334
SoTimerSensor::unschedule
virtual void unschedule(void)
Definition: SoTimerSensor.cpp:214
SoCallbackAction::PRUNE
@ PRUNE
Definition: SoCallbackAction.h:85
SoType::getName
SbName getName(void) const
Definition: SoType.cpp:628
SoHandleEventAction
The SoHandleEventAction class distributes user events to the scene.
Definition: SoHandleEventAction.h:36
SoExtSelection::setLineSegmentFilterCallback
void setLineSegmentFilterCallback(SoExtSelectionLineSegmentCB *func, void *userdata=NULL)
Definition: SoExtSelection.cpp:1354
SoTimerSensor::schedule
virtual void schedule(void)
Definition: SoTimerSensor.cpp:180
SoExtSelection::getOverlaySceneGraph
SoSeparator * getOverlaySceneGraph(void)
Definition: SoExtSelection.cpp:853
SbTime::zero
static SbTime zero(void)
Definition: SbTime.cpp:164
SoEvent
The SoEvent class is the base class for all Coin events.
Definition: SoEvent.h:34
SbViewVolume::getHeight
float getHeight(void) const
Definition: SbViewVolume.cpp:642
SoExtSelection::setPointFilterCallback
void setPointFilterCallback(SoExtSelectionPointCB *func, void *userdata=NULL)
Definition: SoExtSelection.cpp:1372
SoExtSelection::~SoExtSelection
virtual ~SoExtSelection()
Definition: SoExtSelection.cpp:799
SoPath::getHead
SoNode * getHead(void) const
Definition: SoPath.cpp:180
SoGLRenderAction
The SoGLRenderAction class renders the scene graph with OpenGL calls.
Definition: SoGLRenderAction.h:39
SoExtSelection::ALL_SHAPES
@ ALL_SHAPES
Definition: SoExtSelection.h:85
SoExtSelection::lassoPolicy
SoSFEnum lassoPolicy
Definition: SoExtSelection.h:90
SoExtSelection::FULL_BBOX
@ FULL_BBOX
Definition: SoExtSelection.h:81
SoExtSelection::lassoMode
SoSFEnum lassoMode
Definition: SoExtSelection.h:91
SbViewportRegion::getViewportOriginPixels
const SbVec2s & getViewportOriginPixels(void) const
Definition: SbViewportRegion.cpp:398
SbBox2s::extendBy
void extendBy(const SbVec2s &point)
Definition: SbBox2s.cpp:254
SoSelection
The SoSelection class manages a list of selected nodes.
Definition: SoSelection.h:41

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

Generated on Mon Jul 27 2020 for Coin by Doxygen. 1.8.18