VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
vrfObjectIntersectionRecord.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2005 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: vrfObjectIntersectionRecord.h,v $ $Revision: 1.2 $ $State: Exp $
7 ******************************************************************************/
8 #ifndef vrfObjectIntersectionRecord_H_
9 #define vrfObjectIntersectionRecord_H_
10 
14 
17 
18 #include "geometry/point.h"
19 #include "geometry/surface.h"
20 #include <assert.h>
21 
22 class DtVrfObject;
23 
29 {
30 public:
32 
33  DtVrfObjectIntersectionRecord(DtPoint& intersectionPoint,
34  double intersectionTime, const DtSurface& surface, DtVrfObject* intersectedObject);
35 
37 
41 
42  //accessor/mutator functions
44  bool intersectionFound() const;
45  void setIntersectionFound(bool arg);
46 
47  //set/get intersectionPoint
48  const DtPoint intersectionPoint() const;
49  void setIntersectionPoint(const DtPoint& pt);
50 
51  //set/get intersectionTime
52  const double intersectionTime() const;
53  void setIntersectionTime(double t);
54 
55  //set/get intersecting surface
56  const DtSurface surface() const;
57  void setSurface(const DtSurface& s);
58 
60  DtVrfObject* intersectedVrfObject();
61  const DtVrfObject* intersectedVrfObject() const;
62  void setIntersectedVrfObject(DtVrfObject* vrfObj);
63 
69  inline unsigned int numberOfIntersectionTests() const;
71  inline void incrementNumberOfIntersectionTests();
73  inline void setNumberOfIntersectionTests(unsigned int newNumberOfTests);
75 
76 protected:
77  bool testInvariant() const;
78 
79 private:
80 
85 
87 
93 };
94 
95 
97 {
98  assert(testInvariant());
99  return myIntersectionFound;
100 }
101 
103 {
104  assert(testInvariant());
105  myIntersectionFound = yesOrNo;
106  assert(testInvariant());
107 }
108 
110 {
111  assert(testInvariant());
112  return myIntersectionPoint;
113 }
114 
116  const DtPoint& newPoint)
117 {
118  assert(testInvariant());
119  myIntersectionPoint = newPoint;
120  assert(testInvariant());
121 }
122 
124 {
125  assert(testInvariant());
126  return myIntersectionTime;
127 }
128 
130 {
131  assert(testInvariant());
132  myIntersectionTime = newTime;
133  assert(testInvariant());
134 }
135 
137 {
138  assert(testInvariant());
139  return mySurface;
140 }
141 
143 {
144  assert(testInvariant());
145  mySurface = newSurface;
146  assert(testInvariant());
147 }
148 
150 {
151  assert(testInvariant());
152  return myIntersectedVrfObject;
153 }
155 {
156  assert(testInvariant());
157  return myIntersectedVrfObject;
158 }
159 
161 {
162  assert(testInvariant());
163  myIntersectedVrfObject = vrfObject;
164  assert(testInvariant());
165 }
166 
168 {
169  assert(testInvariant());
171 }
172 
174 {
175  assert(testInvariant());
177  assert(testInvariant());
178 }
179 
180 inline void DtVrfObjectIntersectionRecord::setNumberOfIntersectionTests(unsigned int newNumberOfTests)
181 {
182  assert(testInvariant());
183  myNumberOfIntersectionTests = newNumberOfTests;
184  assert(testInvariant());
185 }
186 
187 #endif
188 
189 
190 
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
DtVrfObject * myIntersectedVrfObject
Definition: vrfObjectIntersectionRecord.h:86
void incrementNumberOfIntersectionTests()
Increments the current number of intersection tests by one.
Definition: vrfObjectIntersectionRecord.h:173
DtPoint myIntersectionPoint
Definition: vrfObjectIntersectionRecord.h:82
*bool testInvariant() const
double myIntersectionTime
Definition: vrfObjectIntersectionRecord.h:83
Definition: surface.h:179
const double intersectionTime() const
Definition: vrfObjectIntersectionRecord.h:123
bool myIntersectionFound
Definition: vrfObjectIntersectionRecord.h:81
DtVrfObject * intersectedVrfObject()
Get a pointer to the intersecting vrfObject.
Definition: vrfObjectIntersectionRecord.h:149
DtSurface mySurface
Definition: vrfObjectIntersectionRecord.h:84
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
void setIntersectionPoint(const DtPoint &pt)
Definition: vrfObjectIntersectionRecord.h:115
bool intersectionFound() const
Copy constructor and Assignment operator left to compiler generate implementations.
Definition: vrfObjectIntersectionRecord.h:96
const DtSurface surface() const
Definition: vrfObjectIntersectionRecord.h:136
void setIntersectionFound(bool arg)
Definition: vrfObjectIntersectionRecord.h:102
unsigned int myNumberOfIntersectionTests
This represents the total number of intersection tests that were performed to fill in this intersecti...
Definition: vrfObjectIntersectionRecord.h:92
const DtPoint intersectionPoint() const
Definition: vrfObjectIntersectionRecord.h:109
unsigned int numberOfIntersectionTests() const
The number of intersection tests that were performed in order to fill in this class can be kept...
Definition: vrfObjectIntersectionRecord.h:167
Instances of DtVrfObjectIntersectionRecord are used to record the results of DtVrfObject/DtChord inte...
Definition: vrfObjectIntersectionRecord.h:28
void setIntersectionTime(double t)
Definition: vrfObjectIntersectionRecord.h:129
void setIntersectedVrfObject(DtVrfObject *vrfObj)
Definition: vrfObjectIntersectionRecord.h:160
void setNumberOfIntersectionTests(unsigned int newNumberOfTests)
Set outright the number of intersection tests.
Definition: vrfObjectIntersectionRecord.h:180
void setSurface(const DtSurface &s)
Definition: vrfObjectIntersectionRecord.h:142
Definition: point.h:34

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)