![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2005 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: vrfObjectIntersectionRecord.h,v $ $Revision: 1.2 $ $State: Exp $ 00007 ******************************************************************************/ 00008 #ifndef vrfObjectIntersectionRecord_H_ 00009 #define vrfObjectIntersectionRecord_H_ 00010 00014 00017 00018 #include "geometry/point.h" 00019 #include "geometry/surface.h" 00020 #include <assert.h> 00021 00022 class DtVrfObject; 00023 00027 #include "vrfobjcore/vrfobjcoreDefines.h" 00028 class DT_DLL_vrfobjcore DtVrfObjectIntersectionRecord 00029 { 00030 public: 00031 DtVrfObjectIntersectionRecord(); 00032 00033 DtVrfObjectIntersectionRecord(DtPoint& intersectionPoint, 00034 double intersectionTime, const DtSurface& surface, DtVrfObject* intersectedObject); 00035 00036 virtual ~DtVrfObjectIntersectionRecord(); 00037 00041 00042 //accessor/mutator functions 00044 bool intersectionFound() const; 00045 void setIntersectionFound(bool arg); 00046 00047 //set/get intersectionPoint 00048 const DtPoint intersectionPoint() const; 00049 void setIntersectionPoint(const DtPoint& pt); 00050 00051 //set/get intersectionTime 00052 const double intersectionTime() const; 00053 void setIntersectionTime(double t); 00054 00055 //set/get intersecting surface 00056 const DtSurface surface() const; 00057 void setSurface(const DtSurface& s); 00058 00060 DtVrfObject* intersectedVrfObject(); 00061 const DtVrfObject* intersectedVrfObject() const; 00062 void setIntersectedVrfObject(DtVrfObject* vrfObj); 00063 00069 inline unsigned int numberOfIntersectionTests() const; 00071 inline void incrementNumberOfIntersectionTests(); 00073 inline void setNumberOfIntersectionTests(unsigned int newNumberOfTests); 00075 00076 protected: 00077 bool testInvariant() const; 00078 00079 private: 00080 00081 bool myIntersectionFound; 00082 DtPoint myIntersectionPoint; 00083 double myIntersectionTime; 00084 DtSurface mySurface; 00085 00086 DtVrfObject* myIntersectedVrfObject; 00087 00092 unsigned int myNumberOfIntersectionTests; 00093 }; 00094 00095 00096 inline bool DtVrfObjectIntersectionRecord::intersectionFound() const 00097 { 00098 assert(testInvariant()); 00099 return myIntersectionFound; 00100 } 00101 00102 inline void DtVrfObjectIntersectionRecord::setIntersectionFound(bool yesOrNo) 00103 { 00104 assert(testInvariant()); 00105 myIntersectionFound = yesOrNo; 00106 assert(testInvariant()); 00107 } 00108 00109 inline const DtPoint DtVrfObjectIntersectionRecord::intersectionPoint() const 00110 { 00111 assert(testInvariant()); 00112 return myIntersectionPoint; 00113 } 00114 00115 inline void DtVrfObjectIntersectionRecord::setIntersectionPoint( 00116 const DtPoint& newPoint) 00117 { 00118 assert(testInvariant()); 00119 myIntersectionPoint = newPoint; 00120 assert(testInvariant()); 00121 } 00122 00123 inline const double DtVrfObjectIntersectionRecord::intersectionTime() const 00124 { 00125 assert(testInvariant()); 00126 return myIntersectionTime; 00127 } 00128 00129 inline void DtVrfObjectIntersectionRecord::setIntersectionTime(double newTime) 00130 { 00131 assert(testInvariant()); 00132 myIntersectionTime = newTime; 00133 assert(testInvariant()); 00134 } 00135 00136 inline const DtSurface DtVrfObjectIntersectionRecord::surface() const 00137 { 00138 assert(testInvariant()); 00139 return mySurface; 00140 } 00141 00142 inline void DtVrfObjectIntersectionRecord::setSurface(const DtSurface& newSurface) 00143 { 00144 assert(testInvariant()); 00145 mySurface = newSurface; 00146 assert(testInvariant()); 00147 } 00148 00149 inline DtVrfObject* DtVrfObjectIntersectionRecord::intersectedVrfObject() 00150 { 00151 assert(testInvariant()); 00152 return myIntersectedVrfObject; 00153 } 00154 inline const DtVrfObject* DtVrfObjectIntersectionRecord::intersectedVrfObject() const 00155 { 00156 assert(testInvariant()); 00157 return myIntersectedVrfObject; 00158 } 00159 00160 inline void DtVrfObjectIntersectionRecord::setIntersectedVrfObject(DtVrfObject* vrfObject) 00161 { 00162 assert(testInvariant()); 00163 myIntersectedVrfObject = vrfObject; 00164 assert(testInvariant()); 00165 } 00166 00167 inline unsigned int DtVrfObjectIntersectionRecord::numberOfIntersectionTests() const 00168 { 00169 assert(testInvariant()); 00170 return myNumberOfIntersectionTests; 00171 } 00172 00173 inline void DtVrfObjectIntersectionRecord::incrementNumberOfIntersectionTests() 00174 { 00175 assert(testInvariant()); 00176 ++myNumberOfIntersectionTests; 00177 assert(testInvariant()); 00178 } 00179 00180 inline void DtVrfObjectIntersectionRecord::setNumberOfIntersectionTests(unsigned int newNumberOfTests) 00181 { 00182 assert(testInvariant()); 00183 myNumberOfIntersectionTests = newNumberOfTests; 00184 assert(testInvariant()); 00185 } 00186 00187 #endif 00188 00189 00190