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
vrvGraphics
DtBoundingBox.h
Go to the documentation of this file.
1
/*****************************************************************************
2
* Copyright (c) 2011 MAK Technologies, Inc.
3
* All rights reserved.
4
*****************************************************************************/
5
9
10
#pragma once
11
12
#include <
vrvGraphics/vrvGraphics.h
>
13
14
namespace
makVrv
15
{
16
19
class
DT_DLL_VRVGRAPHICS
Dt2dPoint
20
{
21
public
:
22
24
Dt2dPoint
(
float
x = 0.0f,
float
y = 0.0f )
25
: myX( x )
26
, myY( y )
27
{
28
}
29
31
inline
Dt2dPoint
& operator+=(
const
Dt2dPoint
& p2 )
32
{
33
myX += p2.
myX
;
34
myY += p2.
myY
;
35
return
*
this
;
36
}
37
39
inline
Dt2dPoint
& operator-=(
const
Dt2dPoint
& p2 )
40
{
41
myX -= p2.
myX
;
42
myY -= p2.
myY
;
43
return
*
this
;
44
}
45
47
inline
bool
operator==
(
const
Dt2dPoint
& p2 )
const
48
{
49
return
myX == p2.
myX
&& myY == p2.
myY
;
50
}
51
53
inline
bool
operator!=
(
const
Dt2dPoint
& p2 )
const
54
{
55
return
myX != p2.
myX
|| myY != p2.
myY
;
56
}
57
59
inline
Dt2dPoint
operator+(
const
Dt2dPoint
& p2 )
const
60
{
61
return
Dt2dPoint
( myX + p2.
myX
, myY + p2.
myY
);
62
}
63
65
inline
Dt2dPoint
operator-(
const
Dt2dPoint
& p2 )
const
66
{
67
return
Dt2dPoint
( myX - p2.
myX
, myY - p2.
myY
);
68
}
69
70
public
:
71
72
float
myX
;
73
float
myY
;
74
75
};
76
77
80
class
DT_DLL_VRVGRAPHICS
DtPen
81
{
82
public
:
83
85
DtPen
(
const
Dt2dPoint
& location );
86
88
DtPen
(
float
x = 0.0f,
float
y = 0.0f );
89
90
public
:
91
92
Dt2dPoint
myLocation
;
93
Dt2dPoint
mySpacing
;
94
float
myColor[4];
95
96
};
97
98
101
class
DT_DLL_VRVGRAPHICS
DtBoundingBox
102
{
103
public
:
104
106
DtBoundingBox
();
107
109
DtBoundingBox
(
float
lx,
float
ly,
float
ux,
float
uy );
110
111
//Construct a bounding box from a lower point and an upper point.
112
DtBoundingBox
(
Dt2dPoint
l,
Dt2dPoint
u );
113
115
~
DtBoundingBox
();
116
119
void
invalidate();
120
122
bool
valid()
const
;
123
125
DtBoundingBox
& operator+=(
const
Dt2dPoint
& vector );
126
128
DtBoundingBox
& operator|=(
const
DtBoundingBox
& other );
129
131
void
centerOn(
Dt2dPoint
pos );
132
135
void
expandTo(
float
width,
float
height );
136
138
void
getCenter(
Dt2dPoint
& point )
const
;
139
142
144
inline
float
width
()
const
{
return
myUpperPoint.myX - myLowerPoint.myX;}
145
147
inline
float
height
()
const
{
return
myUpperPoint.myY - myLowerPoint.myY;}
148
150
153
155
inline
Dt2dPoint
&
upperPoint
() {
return
myUpperPoint; }
156
158
inline
const
Dt2dPoint
&
upperPoint
()
const
{
return
myUpperPoint; }
159
161
inline
Dt2dPoint
&
lowerPoint
() {
return
myLowerPoint; }
162
164
inline
const
Dt2dPoint
&
lowerPoint
()
const
{
return
myLowerPoint; }
165
167
169
void
toPoints(
float
points[8] )
const
;
170
171
protected
:
172
173
Dt2dPoint
myLowerPoint
;
174
Dt2dPoint
myUpperPoint
;
175
176
};
177
178
}
Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (
www.mak.com
)