VR-Forces 4.6.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
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
bool
contains(
float
x,
float
y)
const
;
126
128
DtBoundingBox
& operator+=(
const
Dt2dPoint
& vector );
129
131
DtBoundingBox
& operator|=(
const
DtBoundingBox
& other );
132
134
void
centerOn(
Dt2dPoint
pos );
135
138
void
expandTo(
float
width,
float
height );
139
141
void
getCenter(
Dt2dPoint
& point )
const
;
142
145
147
inline
float
width
()
const
{
return
myUpperPoint.myX - myLowerPoint.myX;}
148
150
inline
float
height
()
const
{
return
myUpperPoint.myY - myLowerPoint.myY;}
151
153
156
158
inline
Dt2dPoint
&
upperPoint
() {
return
myUpperPoint; }
159
161
inline
const
Dt2dPoint
&
upperPoint
()
const
{
return
myUpperPoint; }
162
164
inline
Dt2dPoint
&
lowerPoint
() {
return
myLowerPoint; }
165
167
inline
const
Dt2dPoint
&
lowerPoint
()
const
{
return
myLowerPoint; }
168
170
172
void
toPoints(
float
points[8] )
const
;
173
174
protected
:
175
176
Dt2dPoint
myLowerPoint
;
177
Dt2dPoint
myUpperPoint
;
178
179
};
180
181
}
Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (
www.mak.com
)