Main Page   Modules   Class Hierarchy   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 typedef SbBool SoExtSelectionTriangleCB(void * userdata,
00032                                         SoCallbackAction * action,
00033                                         const SoPrimitiveVertex * v1,
00034                                         const SoPrimitiveVertex * v2,
00035                                         const SoPrimitiveVertex * v3);
00036 
00037 typedef SbBool SoExtSelectionLineSegmentCB(void * userdata,
00038                                            SoCallbackAction * action,
00039                                            const SoPrimitiveVertex * v1,
00040                                            const SoPrimitiveVertex * v2);
00041 
00042 typedef SbBool SoExtSelectionPointCB(void * userdata,
00043                                      SoCallbackAction * action,
00044                                      const SoPrimitiveVertex * v1);
00045 
00046 typedef SoPath * SoLassoSelectionFilterCB(void * userdata, const SoPath * path);
00047 
00048 class COIN_DLL_API SoExtSelection : public SoSelection {
00049   typedef SoSelection inherited;
00050 
00051   SO_NODE_HEADER(SoExtSelection);
00052 
00053 public:
00054   static void initClass(void);
00055   SoExtSelection(void);
00056 
00057   enum LassoType {
00058     NOLASSO, LASSO, RECTANGLE
00059   };
00060 
00061   enum LassoPolicy {
00062     FULL_BBOX, PART_BBOX, FULL, PART
00063   };
00064 
00065   SoSFEnum lassoType;
00066   SoSFEnum lassoPolicy;
00067 
00068   void useOverlay(SbBool overlay = TRUE);
00069   SbBool isUsingOverlay(void);
00070   SoSeparator * getOverlaySceneGraph(void);
00071   void setOverlayLassoColorIndex(const int index);
00072   int getOverlayLassoColorIndex(void);
00073   void setLassoColor(const SbColor & color);
00074   const SbColor & getLassoColor(void);
00075   void setLassoWidth(const float width);
00076   float getLassoWidth(void);
00077   void setOverlayLassoPattern(const unsigned short pattern);
00078   unsigned short getOverlayLassoPattern(void);
00079   void animateOverlayLasso(const SbBool animate = TRUE);
00080   SbBool isOverlayLassoAnimated(void);
00081 
00082   virtual void handleEvent(SoHandleEventAction * action);
00083   virtual void GLRenderBelowPath(SoGLRenderAction * action);
00084 
00085   void setLassoFilterCallback(SoLassoSelectionFilterCB * f, void * userdata = NULL,
00086                               const SbBool callonlyifselectable = TRUE);
00087 
00088   void setTriangleFilterCallback(SoExtSelectionTriangleCB * func,
00089                                  void * userdata = NULL);
00090   void setLineSegmentFilterCallback(SoExtSelectionLineSegmentCB * func,
00091                                     void * userdata = NULL);
00092   void setPointFilterCallback(SoExtSelectionPointCB * func,
00093                               void * userdata = NULL);
00094   SbBool wasShiftDown(void) const;
00095 
00096 protected:
00097   virtual ~SoExtSelection();
00098 
00099 private:
00100   void draw(SoGLRenderAction * action);
00101 
00102   friend class SoExtSelectionP;
00103   class SoExtSelectionP * pimpl;
00104 };
00105 
00106 #endif // !COIN_SOEXTSELECTION_H

Generated on Sat Jan 12 11:40:37 2002 for Coin by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001