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) by Kongsberg Oil & Gas Technologies.
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 Kongsberg Oil & Gas Technologies
18  * about acquiring a Coin Professional Edition License.
19  *
20  * See http://www.coin3d.org/ for more information.
21  *
22  * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, 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 
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
The SbVec2f class is a 2 dimensional vector with floating point coordinates.This vector class is used...
Definition: SbVec2f.h:39
The SoBase class is the top-level superclass for a number of class-hierarchies.SoBase provides the ba...
Definition: SoBase.h:36
SoSFEnum lassoType
Definition: SoExtSelection.h:89
The SbColor class contains the red, green and blue components which make up a color value...
Definition: SbColor.h:30
Definition: SoExtSelection.h:81
The SoPrimitiveVertex class represents a single vertex of a generated primitive.Instances of SoPrimit...
Definition: SoPrimitiveVertex.h:34
#define SO_NODE_HEADER(classname)
LassoType
Definition: SoExtSelection.h:76
The SoPathList class is a container for pointers to SoPath objects.As this class inherits SoBaseList...
Definition: SoPathList.h:31
SoSFEnum lassoMode
Definition: SoExtSelection.h:91
The SoNode class is the base class for nodes used in scene graphs.Coin is a retained mode 3D visualiz...
Definition: SoNode.h:47
virtual void GLRenderBelowPath(SoGLRenderAction *action)
Definition: SoSeparator.cpp:641
The SoSFEnum class is a container for an enum value.This field is used where nodes, engines or other field containers needs to store one particular value out of an enumerated set.
Definition: SoSFEnum.h:31
The SoExtSelection class can be used for extended selection functionality.This class enables you to s...
Definition: SoExtSelection.h:67
virtual void handleEvent(SoHandleEventAction *action)
Definition: SoSelection.cpp:836
The SoPath class is a container class for traversal path descriptions.SoPath objects contain a list o...
Definition: SoPath.h:43
The SbVec3f class is a 3 dimensional vector with floating point coordinates.This vector class is used...
Definition: SbVec3f.h:40
Definition: SoExtSelection.h:85
The SoHandleEventAction class distributes user events to the scene.This is the action used by the GUI...
Definition: SoHandleEventAction.h:37
LassoPolicy
Definition: SoExtSelection.h:80
void select(const SoPath *path)
Definition: SoSelection.cpp:354
The SoCallbackAction class invokes callbacks at specific nodes.This action has mechanisms for trackin...
Definition: SoCallbackAction.h:71
The SoSelection class manages a list of selected nodes.Inserting an SoSelection node in your scene gr...
Definition: SoSelection.h:41
The SbViewportRegion class is a viewport within a full window.The SbViewportRegion class contains inf...
Definition: SbViewportRegion.h:31
SoSFEnum lassoPolicy
Definition: SoExtSelection.h:90
LassoMode
Definition: SoExtSelection.h:84
The SoSeparator class is a state-preserving group node.Subgraphs parented by SoSeparator nodes will n...
Definition: SoSeparator.h:35
The SbVec2s class is a 2 dimensional vector with short integer coordinates.This vector class is used ...
Definition: SbVec2s.h:41
The SoGLRenderAction class renders the scene graph with OpenGL calls.Applying this method at a root n...
Definition: SoGLRenderAction.h:41

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.

Generated for Coin by Doxygen 1.8.14.