Coin Logo http://www.sim.no
http://www.coin3d.org

SoIntersectionDetectionAction.h
1 #ifndef COIN_SOINTERSECTIONDETECTIONACTION_H
2 #define COIN_SOINTERSECTIONDETECTIONACTION_H
3 
4 /**************************************************************************\
5  *
6  * This file is part of the Coin 3D visualization library.
7  * Copyright (C) 1998-2007 by Systems in Motion. All rights reserved.
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 Systems in Motion about acquiring
18  * a Coin Professional Edition License.
19  *
20  * See http://www.coin3d.org/ for more information.
21  *
22  * Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
23  * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24  *
25 \**************************************************************************/
26 
27 #include <Inventor/actions/SoSubAction.h>
28 #include <Inventor/actions/SoAction.h>
29 #include <Inventor/actions/SoCallbackAction.h>
30 
32  SoPath * path;
33  enum PrimitiveType {
34  SEGMENT = 2,
35  LINE_SEGMENT = 2,
36  TRIANGLE = 3
37  } type;
38  SbVec3f vertex[3];
39  SbVec3f xf_vertex[3];
40 };
41 
42 class SoIntersectionDetectionActionP;
43 
44 class COIN_DLL_API SoIntersectionDetectionAction : public SoAction {
45  typedef SoAction hinherited;
46  SO_ACTION_HEADER(SoIntersectionDetectionAction);
47 public:
48  static void initClass(void);
50  virtual ~SoIntersectionDetectionAction(void);
51 
52  enum Resp {
53  NEXT_PRIMITIVE,
54  NEXT_SHAPE,
55  ABORT
56  };
57 
58  typedef SoCallbackAction::Response SoIntersectionVisitationCB(void * closure, const SoPath * where);
59  typedef SbBool SoIntersectionFilterCB(void * closure, const SoPath * p1, const SoPath * p2);
60  typedef Resp SoIntersectionCB(void * closure, const SoIntersectingPrimitive * p1, const SoIntersectingPrimitive * p2);
61 
62  void setIntersectionDetectionEpsilon(float epsilon);
63  float getIntersectionDetectionEpsilon(void) const;
64 
65  static void setIntersectionEpsilon(float epsilon);
66  static float getIntersectionEpsilon(void);
67 
68  void setTypeEnabled(SoType type, SbBool enable);
69  SbBool isTypeEnabled(SoType type, SbBool checkgroups = FALSE) const;
70 
71  void setManipsEnabled(SbBool enable);
72  SbBool isManipsEnabled(void) const;
73 
74  void setDraggersEnabled(SbBool enable);
75  SbBool isDraggersEnabled(void) const;
76 
77  void setShapeInternalsEnabled(SbBool enable);
78  SbBool isShapeInternalsEnabled(void) const;
79 
80  void addVisitationCallback(SoType type, SoIntersectionVisitationCB * cb, void * closure);
81  void removeVisitationCallback(SoType type, SoIntersectionVisitationCB * cb, void * closure);
82 
83  virtual void apply(SoNode * node);
84  virtual void apply(SoPath * path);
85  virtual void apply(const SoPathList & paths, SbBool obeysRules = FALSE);
86 
87  virtual void setFilterCallback(SoIntersectionFilterCB * cb, void * closure = NULL);
88  virtual void addIntersectionCallback(SoIntersectionCB * cb, void * closure = NULL);
89  virtual void removeIntersectionCallback(SoIntersectionCB * cb, void * closure = NULL);
90 
91 private:
92  SoIntersectionDetectionActionP * pimpl;
93 };
94 
95 #endif // !COIN_SOINTERSECTIONDETECTIONACTION_H
The SoPathList class is a container for pointers to SoPath objects.As this class inherits SoBaseList...
Definition: SoPathList.h:31
The SoNode class is the base class for nodes used in scene graphs.Coin is a retained mode 3D visualiz...
Definition: SoNode.h:47
The SoPath class is a container class for traversal path descriptions.SoPath objects contain a list o...
Definition: SoPath.h:43
The SoAction class is the base class for all traversal actions.Applying actions is the basic mechanis...
Definition: SoAction.h:67
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition: SbVec3f.h:37
Response
Definition: SoCallbackAction.h:85
The SoIntersectionDetectionAction class is for detecting intersecting primitives in a scene...
Definition: SoIntersectionDetectionAction.h:44
Struct with collision information.
Definition: SoIntersectionDetectionAction.h:31
The SoType class is the basis for the run-time type system in Coin.Many of the classes in the Coin li...
Definition: SoType.h:50

Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.

Generated on Fri Feb 17 2017 for Coin by Doxygen. 1.8.13