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

SoRayPickAction.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_SORAYPICKACTION_H
00021 #define COIN_SORAYPICKACTION_H
00022 
00023 #include <Inventor/actions/SoPickAction.h>
00024 
00025 class SbBox3f;
00026 class SbLine;
00027 class SbMatrix;
00028 class SbVec2f;
00029 class SbVec2s;
00030 class SbVec3f;
00031 class SbViewVolume;
00032 class SbViewportRegion;
00033 class SoPickedPoint;
00034 class SoPickedPointList;
00035 
00036 
00037 class COIN_DLL_API SoRayPickAction : public SoPickAction {
00038   typedef SoPickAction inherited;
00039 
00040   SO_ACTION_HEADER(SoRayPickAction);
00041 
00042 public:
00043   SoRayPickAction(const SbViewportRegion & viewportregion);
00044   virtual ~SoRayPickAction();
00045   static void initClass(void);
00046 
00047   void setPoint(const SbVec2s & viewportPoint);
00048   void setNormalizedPoint(const SbVec2f & normpoint);
00049   void setRadius(const float radiusinpixels);
00050   void setRay(const SbVec3f & start, const SbVec3f & direction,
00051               float neardistance = -1.0,
00052               float fardistance = -1.0);
00053   void setPickAll(const SbBool flag);
00054   SbBool isPickAll(void) const;
00055   const SoPickedPointList & getPickedPointList(void) const;
00056   SoPickedPoint * getPickedPoint(const int index = 0) const;
00057 
00058 
00059   void computeWorldSpaceRay(void);
00060   SbBool hasWorldSpaceRay(void) const;
00061   void setObjectSpace(void);
00062   void setObjectSpace(const SbMatrix & matrix);
00063   SbBool intersect(const SbVec3f & v0, const SbVec3f & v1, const SbVec3f & v2,
00064                    SbVec3f & intersection, SbVec3f & barycentric,
00065                    SbBool & front) const;
00066   SbBool intersect(const SbVec3f & v0, const SbVec3f & v1,
00067                    SbVec3f & intersection) const;
00068   SbBool intersect(const SbVec3f & point) const;
00069   SbBool intersect(const SbBox3f & box, const SbBool usefullviewvolume = TRUE);
00070   SbBool intersect(const SbBox3f & box, SbVec3f & intersection,
00071                    const SbBool usefullviewvolume = TRUE);
00072   const SbViewVolume & getViewVolume(void);
00073   const SbLine & getLine(void);
00074   SbBool isBetweenPlanes(const SbVec3f & intersection) const;
00075   SoPickedPoint * addIntersection(const SbVec3f & objectspacepoint);
00076 
00077 protected:
00078   virtual void beginTraversal(SoNode * node);
00079 
00080 private:
00081   class SoRayPickActionP * pimpl;
00082 };
00083 
00084 #endif // !COIN_SORAYPICKACTION_H

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