VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
chordIntersectionRecord.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1998 MAK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: chrdIntRec.h,v $ $Revision: 1.14 $ $State: Exp $
7 *********************************************************************/
8 #ifndef chordIntersectionRecord_H_
9 #define chordIntersectionRecord_H_
10 
11 // \file chrdIntRec.h
12 // \brief Contains the DtChordIntersectionRecord class declaration.
13 
16 #include "geometry/point.h"
17 #include "geometry/surface.h"
18 #include <matrix/vlVector.h>
19 
20 
21 // Instances of DtChordIntersectionRecord are used to record the
22 // results of chord/primitive intersection attempts.
24 {
25 public:
26 
27  // default constructor
29 
30  //additional constructor
31  DtChordIntersectionRecord(DtPoint& intersectionPoint,
32  double intersectionTime,
33  DtVector& normal,
34  DtSurface* surface);
35 
36  // destructor
37  virtual ~DtChordIntersectionRecord();
38 
39  // copy constructor
41 
42  // assignment operator
43  // Note: if "orig" owns its own polygon, this will make a copy of the
44  // polygon so that this object can own it's own copy.
46 
47  // clone this object
48  virtual DtIntersectionRecord* clone() const;
49 
50  // The type of record used for the intersection query. Returns
51  // CHORD_TYPE
52  virtual DtRecordType type() const;
53 
54  //debugging aid
55  virtual void dump() const;
56 
57  //set/get intersectionPoint
58  const DtPoint intersectionPoint() const;
59  const DtVector intersectionVector() const;
60  void setIntersectionPoint(const DtPoint& pt);
61 
62  //set/get intersectionTime
63  const double intersectionTime() const;
64  void setIntersectionTime(double t);
65 
66  //set/get normal to intersecting terrain element
67  const DtVector normal() const;
68  void setNormal(const DtVector& v);
69 
70  //set/get intersecting surface
71  const DtSurface surface() const;
72  void setSurface(const DtSurface& s);
73 
74  // The number of intersection tests that were performed in order to fill in
75  // this class can be kept, for instrumentation purposes. These are the
76  // accessor functions.
77  // @{
78  // @returns The number of intersection tests associated with this record.
79  inline unsigned int numberOfIntersectionTests() const;
80  // Increments the current number of intersection tests by one.
81  inline void incrementNumberOfIntersectionTests();
82  // Set outright the number of intersection tests.
83  inline void setNumberOfIntersectionTests(unsigned int newNumberOfTests);
84  // @}
85 
86 protected:
87 
93 
94 
95  // This represents the total number of intersection tests that were
96  // performed to fill in this intersection record. This is intended to
97  // be used for instrumentation purposes, and is included because of the
98  // very low overhead.
100 };
101 
103 {
104  return myIntersectionPoint;
105 }
106 
108 {
109  return myIntersectionVector;
110 }
111 
113  const DtPoint& pt)
114 {
115  myIntersectionPoint = pt;
116 
117  myIntersectionVector[0] = pt.x();
118  myIntersectionVector[1] = pt.y();
119  myIntersectionVector[2] = pt.z();
120 }
121 
123 {
124  return myIntersectionTime;
125 }
126 
128 {
129  myIntersectionTime = t;
130 }
131 
133 {
134  return myNormal;
135 }
136 
138 {
139  myNormal = v;
140 }
141 
143 {
144  return mySurface;
145 }
146 
148 {
149  mySurface = s;
150 }
151 
153 {
155 }
156 
158 {
160 }
161 
162 inline void DtChordIntersectionRecord::setNumberOfIntersectionTests(unsigned int newNumberOfTests)
163 {
164  myNumberOfIntersectionTests = newNumberOfTests;
165 }
166 
167 
168 #endif

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)