VR-Forces 4.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
include
gdb
gdbChordIntersectionRecord.h
Go to the documentation of this file.
1
/*********************************************************************
2
** Copyright (c) 2010 MAK Technologies, Inc.
3
** All rights reserved.
4
*********************************************************************/
5
/*********************************************************************
6
** $RCSfile: gdbChordIntersectionRecord.h,v $ $Revision: 1.1 $ $State: Exp $
7
** Created: 2/2/10 MEM
8
*********************************************************************/
9
#ifndef gdbChordIntersectionRecord_H_
10
#define gdbChordIntersectionRecord_H_
11
12
// \file chrdIntRec.h
13
// \brief Contains the DtGdbChordIntersectionRecord class declaration.
14
#include "
gdb/gdbDefines.h
"
15
#include "
geometry/chrdIntRec.h
"
16
#include "
geometry/point.h
"
17
#include "
geometry/surface.h
"
18
#include <matrix/vlVector.h>
19
20
class
DtAllTypesPolygon
;
21
22
// Instances of DtGdbChordIntersectionRecord are used to record the
23
// results of chord/primitive intersection attempts.
24
class
DT_DLL_gdb
DtGdbChordIntersectionRecord
:
public
DtChordIntersectionRecord
25
{
26
public
:
27
28
// default constructor
29
DtGdbChordIntersectionRecord
();
30
31
DtGdbChordIntersectionRecord
(
DtPoint
& intersectionPoint,
32
double
intersectionTime,
33
DtVector
& normal,
34
DtSurface
* surface,
35
DtAllTypesPolygon
* polygon,
36
bool
ownPolygon);
37
38
// destructor
39
virtual
~
DtGdbChordIntersectionRecord
();
40
41
// copy constructor
42
DtGdbChordIntersectionRecord
(
const
DtGdbChordIntersectionRecord
& orig);
43
44
// assignment operator
45
// Note: if "orig" owns its own polygon, this will make a copy of the
46
// polygon so that this object can own it's own copy.
47
DtGdbChordIntersectionRecord
&
operator=
(
const
DtGdbChordIntersectionRecord
& orig);
48
49
// clone this object
50
virtual
DtIntersectionRecord
*
clone
()
const
;
51
52
//debugging aid
53
virtual
void
dump
()
const
;
54
55
// The type of record used for the intersection query. Returns
56
// DtIntersectionRecord::GDBCHORD_TYPE
57
virtual
DtRecordType
type
()
const
;
58
59
// Get a pointer to the intersecting polygon.
60
DtAllTypesPolygon
* polygon();
61
const
DtAllTypesPolygon
* polygon()
const
;
62
63
// \return A boolean indication whether or not the intersection record
64
// owns the polygon it points to or not. If not, then the polygon is not
65
// destroyed when the record is. If it is, then the polygon should only
66
// be referenced while the record is still valid.
67
bool
ownPolygon()
const
;
68
69
// Set the intersecting polygon.
70
// Makes it's own copy of the given polygon
71
void
setPolygon(
const
DtAllTypesPolygon
& arg);
72
73
// Shares a pointer to someone else's polygon (it better outlast us)
74
void
sharePolygon(
DtAllTypesPolygon
* arg);
75
76
// Takes over ownership of the given polygon
77
void
takePolygon(
DtAllTypesPolygon
* arg);
78
79
// Like operator= except that it transfers ownership of the polygon to
80
// another DtGdbChordIntersectionRecord instead of potentially copying it.
81
virtual
void
copyAndStealPolygonFrom(
DtGdbChordIntersectionRecord
& donor);
82
83
protected
:
84
85
// Make a copy of a polygon
86
static
DtAllTypesPolygon
* copyPolygon(
const
DtAllTypesPolygon
& orig);
87
88
// Most primitive polygon to get hit.
89
DtAllTypesPolygon
*
myPolygon
;
90
bool
myOwnPolygon
;
91
};
92
93
inline
DtAllTypesPolygon
*
DtGdbChordIntersectionRecord::polygon
()
94
{
95
return
myPolygon
;
96
}
97
inline
const
DtAllTypesPolygon
*
DtGdbChordIntersectionRecord::polygon
()
const
98
{
99
return
myPolygon
;
100
}
101
102
inline
bool
DtGdbChordIntersectionRecord::ownPolygon
()
const
103
{
104
return
myOwnPolygon
;
105
}
106
107
#endif
Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (
www.mak.com
)