Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

SoExtSelection.h

00001 /**************************************************************************\
00002  *
00003  *  This file is part of the Coin 3D visualization library.
00004  *  Copyright (C) 1998-2002 by Systems in Motion. All rights reserved.
00005  *
00006  *  This library is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU Lesser General Public License
00008  *  version 2.1 as published by the Free Software Foundation. See the
00009  *  file LICENSE.LGPL at the root directory of the distribution for
00010  *  more details.
00011  *
00012  *  If you want to use Coin for applications not compatible with the
00013  *  LGPL, please contact SIM to acquire a Professional Edition license.
00014  *
00015  *  Systems in Motion, Prof Brochs gate 6, 7030 Trondheim, NORWAY
00016  *  http://www.sim.no support@sim.no Voice: +47 22114160 Fax: +47 22207097
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> // NULL
00027 
00028 class SbColor;
00029 class SoPrimitiveVertex;
00030 
00031 // This shouldn't strictly be necessary, but the OSF1/cxx compiler
00032 // complains if this is left out, while using the "friend class
00033 // SoExtSelectionP" statement in the class definition.
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

Generated at Tue Mar 5 03:31:13 2002 for Coin by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001