DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
ImplicitHyperCube.h
1
16
17
#pragma once
18
30
31
#if defined(ImplicitHyperCube_RECURSES)
32
#error Recursive header files inclusion detected in ImplicitHyperCube.h
33
#else
// defined(ImplicitHyperCube_RECURSES)
35
#define ImplicitHyperCube_RECURSES
36
37
#if !defined ImplicitHyperCube_h
39
#define ImplicitHyperCube_h
40
42
// Inclusions
43
#include <iostream>
44
#include "DGtal/base/Common.h"
46
47
namespace
DGtal
48
{
49
51
58
template
<
typename
TSpace>
59
class
ImplicitHyperCube
60
{
61
62
public
:
63
typedef
ImplicitHyperCube<TSpace>
Self
;
64
typedef
TSpace
Space
;
65
typedef
typename
Space::RealPoint
RealPoint
;
66
typedef
double
Value
;
67
75
ImplicitHyperCube
(
const
RealPoint
&aCenter,
const
double
&aHalfWidth):
76
myCenter
(aCenter),
77
myHalfWidth
(aHalfWidth)
78
{};
79
84
~ImplicitHyperCube
();
85
86
87
// ----------------------- Interface --------------------------------------
88
public
:
89
98
inline
99
double
operator()
(
const
RealPoint
&
aPoint
)
const
100
{
101
return
myHalfWidth
- (
aPoint
-
myCenter
).norm(
RealPoint::L_infty
);
102
}
103
104
111
inline
112
bool
isInside
(
const
RealPoint
&
aPoint
)
const
113
{
114
return
this->
operator()
(
aPoint
) >0.0;
115
}
116
117
118
inline
119
Orientation
orientation
(
const
RealPoint
&
aPoint
)
const
120
{
121
if
(this->
operator
()(aPoint) > 0.0)
122
return
INSIDE
;
123
else
124
if
(this->
operator
()(aPoint) < 0.0)
125
return
OUTSIDE
;
126
else
127
return
ON
;
128
}
129
136
inline
137
RealPoint
getLowerBound
()
const
138
{
139
return
(
myCenter
-
RealPoint::diagonal
(
myHalfWidth
));
140
}
141
148
inline
149
RealPoint
getUpperBound
()
const
150
{
151
return
(
myCenter
+
RealPoint::diagonal
(
myHalfWidth
));
152
}
153
157
RealPoint
center
()
const
158
{
159
return
myCenter
;
160
}
161
166
inline
167
void
moveTo
(
const
RealPoint
& newCenter )
168
{
169
myCenter
= newCenter;
170
}
171
172
// ----------------------- Interface --------------------------------------
173
public
:
174
179
void
selfDisplay
( std::ostream & out )
const
;
180
185
bool
isValid
()
const
;
186
187
// ------------------------- Protected Data ------------------------------
188
private
:
189
// ------------------------- Private Data --------------------------------
190
private
:
191
193
RealPoint
myCenter
;
194
196
double
myHalfWidth
;
197
198
// ------------------------- Hidden services ------------------------------
199
protected
:
200
205
ImplicitHyperCube
();
206
207
private
:
208
215
ImplicitHyperCube
&
operator=
(
const
ImplicitHyperCube
& other );
216
217
218
};
// end of class ImplicitHyperCube
219
220
227
template
<
typename
T>
228
std::ostream&
229
operator<<
( std::ostream & out,
const
ImplicitHyperCube<T>
&
object
);
230
231
}
// namespace DGtal
232
233
235
// Includes inline functions.
236
#include "DGtal/shapes/implicit/ImplicitHyperCube.ih"
237
238
// //
240
241
#endif
// !defined ImplicitHyperCube_h
242
243
#undef ImplicitHyperCube_RECURSES
244
#endif
// else defined(ImplicitHyperCube_RECURSES)
DGtal::ImplicitHyperCube
Aim: model of CEuclideanOrientedShape and CEuclideanBoundedShape concepts to create an hypercube in n...
Definition
ImplicitHyperCube.h:60
DGtal::ImplicitHyperCube::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::ImplicitHyperCube::orientation
Orientation orientation(const RealPoint &aPoint) const
Definition
ImplicitHyperCube.h:119
DGtal::ImplicitHyperCube::Self
ImplicitHyperCube< TSpace > Self
Definition
ImplicitHyperCube.h:63
DGtal::ImplicitHyperCube::operator=
ImplicitHyperCube & operator=(const ImplicitHyperCube &other)
DGtal::ImplicitHyperCube::ImplicitHyperCube
ImplicitHyperCube()
DGtal::ImplicitHyperCube::ImplicitHyperCube
ImplicitHyperCube(const RealPoint &aCenter, const double &aHalfWidth)
Definition
ImplicitHyperCube.h:75
DGtal::ImplicitHyperCube::getLowerBound
RealPoint getLowerBound() const
Definition
ImplicitHyperCube.h:137
DGtal::ImplicitHyperCube::moveTo
void moveTo(const RealPoint &newCenter)
Definition
ImplicitHyperCube.h:167
DGtal::ImplicitHyperCube::isValid
bool isValid() const
DGtal::ImplicitHyperCube::operator()
double operator()(const RealPoint &aPoint) const
Definition
ImplicitHyperCube.h:99
DGtal::ImplicitHyperCube::isInside
bool isInside(const RealPoint &aPoint) const
Definition
ImplicitHyperCube.h:112
DGtal::ImplicitHyperCube::Value
double Value
Definition
ImplicitHyperCube.h:66
DGtal::ImplicitHyperCube::Space
TSpace Space
Definition
ImplicitHyperCube.h:64
DGtal::ImplicitHyperCube::RealPoint
Space::RealPoint RealPoint
Definition
ImplicitHyperCube.h:65
DGtal::ImplicitHyperCube::center
RealPoint center() const
Definition
ImplicitHyperCube.h:157
DGtal::ImplicitHyperCube::myCenter
RealPoint myCenter
Ball center.
Definition
ImplicitHyperCube.h:193
DGtal::ImplicitHyperCube::getUpperBound
RealPoint getUpperBound() const
Definition
ImplicitHyperCube.h:149
DGtal::ImplicitHyperCube::myHalfWidth
double myHalfWidth
Ball HalfWidth.
Definition
ImplicitHyperCube.h:196
DGtal::ImplicitHyperCube::~ImplicitHyperCube
~ImplicitHyperCube()
DGtal::PointVector< dim, double >::diagonal
static Self diagonal(Component val=1)
DGtal::PointVector< dim, double >::L_infty
@ L_infty
Definition
PointVector.h:1493
DGtal::SpaceND< 3, Integer >::RealPoint
PointVector< dim, double > RealPoint
Definition
SpaceND.h:117
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
DGtal::Orientation
Orientation
Definition
Common.h:124
DGtal::INSIDE
@ INSIDE
Definition
Common.h:124
DGtal::OUTSIDE
@ OUTSIDE
Definition
Common.h:124
DGtal::ON
@ ON
Definition
Common.h:124
aPoint
const Point aPoint(3, 4)
src
DGtal
shapes
implicit
ImplicitHyperCube.h
Generated on
for DGtal by
1.18.0