00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef COIN_SOEXTSELECTION_H
00021 #define COIN_SOEXTSELECTION_H
00022
00023 #include <Inventor/nodes/SoSubNode.h>
00024 #include <Inventor/nodes/SoSelection.h>
00025 #include <Inventor/fields/SoSFEnum.h>
00026 #include <stddef.h>
00027
00028 class SbColor;
00029 class SoPrimitiveVertex;
00030
00031
00032
00033
00034 class SoExtSelectionP;
00035
00036
00037 typedef SbBool SoExtSelectionTriangleCB(void * userdata,
00038 SoCallbackAction * action,
00039 const SoPrimitiveVertex * v1,
00040 const SoPrimitiveVertex * v2,
00041 const SoPrimitiveVertex * v3);
00042
00043 typedef SbBool SoExtSelectionLineSegmentCB(void * userdata,
00044 SoCallbackAction * action,
00045 const SoPrimitiveVertex * v1,
00046 const SoPrimitiveVertex * v2);
00047
00048 typedef SbBool SoExtSelectionPointCB(void * userdata,
00049 SoCallbackAction * action,
00050 const SoPrimitiveVertex * v1);
00051
00052 typedef SoPath * SoLassoSelectionFilterCB(void * userdata, const SoPath * path);
00053
00054
00055 class COIN_DLL_API SoExtSelection : public SoSelection {
00056 typedef SoSelection inherited;
00057
00058 SO_NODE_HEADER(SoExtSelection);
00059
00060 public:
00061 static void initClass(void);
00062 SoExtSelection(void);
00063
00064 enum LassoType {
00065 NOLASSO, LASSO, RECTANGLE
00066 };
00067
00068 enum LassoPolicy {
00069 FULL_BBOX, PART_BBOX, FULL, PART
00070 };
00071
00072 SoSFEnum lassoType;
00073 SoSFEnum lassoPolicy;
00074
00075 void useOverlay(SbBool overlay = TRUE);
00076 SbBool isUsingOverlay(void);
00077 SoSeparator * getOverlaySceneGraph(void);
00078 void setOverlayLassoColorIndex(const int index);
00079 int getOverlayLassoColorIndex(void);
00080 void setLassoColor(const SbColor & color);
00081 const SbColor & getLassoColor(void);
00082 void setLassoWidth(const float width);
00083 float getLassoWidth(void);
00084 void setOverlayLassoPattern(const unsigned short pattern);
00085 unsigned short getOverlayLassoPattern(void);
00086 void animateOverlayLasso(const SbBool animate = TRUE);
00087 SbBool isOverlayLassoAnimated(void);
00088
00089 virtual void handleEvent(SoHandleEventAction * action);
00090 virtual void GLRenderBelowPath(SoGLRenderAction * action);
00091
00092 void setLassoFilterCallback(SoLassoSelectionFilterCB * f, void * userdata = NULL,
00093 const SbBool callonlyifselectable = TRUE);
00094
00095 void setTriangleFilterCallback(SoExtSelectionTriangleCB * func,
00096 void * userdata = NULL);
00097 void setLineSegmentFilterCallback(SoExtSelectionLineSegmentCB * func,
00098 void * userdata = NULL);
00099 void setPointFilterCallback(SoExtSelectionPointCB * func,
00100 void * userdata = NULL);
00101 SbBool wasShiftDown(void) const;
00102
00103 protected:
00104 virtual ~SoExtSelection();
00105
00106 private:
00107 void draw(SoGLRenderAction * action);
00108
00109 friend class SoExtSelectionP;
00110 class SoExtSelectionP * pimpl;
00111 };
00112
00113 #endif // !COIN_SOEXTSELECTION_H