VR-Forces Development_Version Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
include
geometry
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
14
#include "
geometry/intersectionRecord.h
"
15
#include "
geometry/geometryDefines.h
"
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.
23
class
DT_DLL_geometry
DtChordIntersectionRecord
:
public
DtIntersectionRecord
24
{
25
public
:
26
27
// default constructor
28
DtChordIntersectionRecord
();
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
40
DtChordIntersectionRecord
(
const
DtChordIntersectionRecord
& orig);
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.
45
DtChordIntersectionRecord
&
operator=
(
const
DtChordIntersectionRecord
& orig);
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
88
DtPoint
myIntersectionPoint
;
89
DtVector
myIntersectionVector
;
90
double
myIntersectionTime
;
91
DtVector
myNormal
;
92
DtSurface
mySurface
;
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.
99
unsigned
int
myNumberOfIntersectionTests
;
100
};
101
102
inline
const
DtPoint
DtChordIntersectionRecord::intersectionPoint
()
const
103
{
104
return
myIntersectionPoint
;
105
}
106
107
inline
const
DtVector
DtChordIntersectionRecord::intersectionVector
()
const
108
{
109
return
myIntersectionVector
;
110
}
111
112
inline
void
DtChordIntersectionRecord::setIntersectionPoint
(
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
122
inline
const
double
DtChordIntersectionRecord::intersectionTime
()
const
123
{
124
return
myIntersectionTime
;
125
}
126
127
inline
void
DtChordIntersectionRecord::setIntersectionTime
(
double
t)
128
{
129
myIntersectionTime
= t;
130
}
131
132
inline
const
DtVector
DtChordIntersectionRecord::normal
()
const
133
{
134
return
myNormal
;
135
}
136
137
inline
void
DtChordIntersectionRecord::setNormal
(
const
DtVector
& v)
138
{
139
myNormal
= v;
140
}
141
142
inline
const
DtSurface
DtChordIntersectionRecord::surface
()
const
143
{
144
return
mySurface
;
145
}
146
147
inline
void
DtChordIntersectionRecord::setSurface
(
const
DtSurface
& s)
148
{
149
mySurface
= s;
150
}
151
152
inline
unsigned
int
DtChordIntersectionRecord::numberOfIntersectionTests
()
const
153
{
154
return
myNumberOfIntersectionTests
;
155
}
156
157
inline
void
DtChordIntersectionRecord::incrementNumberOfIntersectionTests
()
158
{
159
++
myNumberOfIntersectionTests
;
160
}
161
162
inline
void
DtChordIntersectionRecord::setNumberOfIntersectionTests
(
unsigned
int
newNumberOfTests)
163
{
164
myNumberOfIntersectionTests
= newNumberOfTests;
165
}
166
167
168
#endif
Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (
www.mak.com
)