SoRayPickAction.h Source File

| http://www.sim.no/ http://www.coin3d.org/

- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List
- File Members

SoRayPickAction.h
1 #ifndef COIN_SORAYPICKACTION_H
2 #define COIN_SORAYPICKACTION_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/actions/SoPickAction.h>
28
29 class SbBox3f;
30 class SbLine;
31 class SbMatrix;
32 class SbVec2f;
33 class SbVec2s;
34 class SbVec3f;
35 class SbViewVolume;
36 class SbViewportRegion;
37 class SoPickedPoint;
38 class SoPickedPointList;
39 class SoRayPickActionP;
40
41 class COIN_DLL_API SoRayPickAction : public SoPickAction {
42 typedef SoPickAction inherited;
43
44 SO_ACTION_HEADER(SoRayPickAction);
45
46 public:
47 SoRayPickAction(const SbViewportRegion & viewportregion);
48 virtual ~SoRayPickAction();
49 static void initClass(void);
50
51 void setPoint(const SbVec2s & viewportPoint);
52 void setNormalizedPoint(const SbVec2f & normpoint);
53 void setRadius(const float radiusinpixels);
54 void setRay(const SbVec3f & start, const SbVec3f & direction,
55 float neardistance = -1.0,
56 float fardistance = -1.0);
57 void setPickAll(const SbBool flag);
58 SbBool isPickAll(void) const;
59 const SoPickedPointList & getPickedPointList(void) const;
60 SoPickedPoint * getPickedPoint(const int index = 0) const;
61
62
63 void computeWorldSpaceRay(void);
64 SbBool hasWorldSpaceRay(void) const;
65 void setObjectSpace(void);
66 void setObjectSpace(const SbMatrix & matrix);
67 SbBool intersect(const SbVec3f & v0, const SbVec3f & v1, const SbVec3f & v2,
68 SbVec3f & intersection, SbVec3f & barycentric,
69 SbBool & front) const;
70 SbBool intersect(const SbVec3f & v0, const SbVec3f & v1,
71 SbVec3f & intersection) const;
72 SbBool intersect(const SbVec3f & point) const;
73 SbBool intersect(const SbBox3f & box, const SbBool usefullviewvolume = TRUE);
74 SbBool intersect(const SbBox3f & box, SbVec3f & intersection,
75 const SbBool usefullviewvolume = TRUE);
76 const SbViewVolume & getViewVolume(void);
77 const SbLine & getLine(void);
78 SbBool isBetweenPlanes(const SbVec3f & intersection) const;
79 SoPickedPoint * addIntersection(const SbVec3f & objectspacepoint, SbBool frontpick = TRUE);
80
81 void reset(void);
82
83 protected:
84 virtual void beginTraversal(SoNode * node);
85
86 private:
87 SbPimplPtr<SoRayPickActionP> pimpl;
88
89 // NOT IMPLEMENTED:
90 SoRayPickAction(const SoRayPickAction & rhs);
91 SoRayPickAction & operator = (const SoRayPickAction & rhs);
92 }; // SoRayPickAction
93
94 #endif // !COIN_SORAYPICKACTION_H
SbVec2f
The SbVec2f class is a 2 dimensional vector with floating point coordinates.This vector class is used...
Definition: SbVec2f.h:39
SoRayPickAction
The SoRayPickAction class does ray intersection with scene graphs.For interaction with the scene grap...
Definition: SoRayPickAction.h:41
SbBox3f
The SbBox3f class is an abstraction for an axis aligned 3 dimensional box.This box abstraction class ...
Definition: SbBox3f.h:37
SoPickAction
The SoPickAction class is the base class for picking actions.The basis for all interaction features t...
Definition: SoPickAction.h:34
SoNode
The SoNode class is the base class for nodes used in scene graphs.Coin is a retained mode 3D visualiz...
Definition: SoNode.h:47
SoPickedPointList
The SoPickedPointList class is a container for pointers to SoPickedPoint objects.This list class will...
Definition: SoPickedPointList.h:31
SoAction
The SoAction class is the base class for all traversal actions.Applying actions is the basic mechanis...
Definition: SoAction.h:68
SbVec3f
The SbVec3f class is a 3 dimensional vector with floating point coordinates.This vector class is used...
Definition: SbVec3f.h:40
SbLine
The SbLine class represents a line in 3D space.SbLine provides a way of specifying a directed line...
Definition: SbLine.h:32
SbMatrix
The SbMatrix class is a 4x4 dimensional representation of a matrix.SbMatrix is used by many other cla...
Definition: SbMatrix.h:37
SbViewVolume
The SbViewVolume class is a viewing volume in 3D space.This class contains the necessary information ...
Definition: SbViewVolume.h:41
SoPickedPoint
The SoPickedPoint class is used for specifying picked points.It holds miscellaneous information about...
Definition: SoPickedPoint.h:39
SoPickAction::beginTraversal
virtual void beginTraversal(SoNode *node)
Definition: SoPickAction.cpp:124
SbViewportRegion
The SbViewportRegion class is a viewport within a full window.The SbViewportRegion class contains inf...
Definition: SbViewportRegion.h:31
SbVec2s
The SbVec2s class is a 2 dimensional vector with short integer coordinates.This vector class is used ...
Definition: SbVec2s.h:41

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