DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
StraightLineFrom2Points.h
1
16
17
#pragma once
18
33
34
#if defined(StraightLineFrom2Points_RECURSES)
35
#error Recursive header files inclusion detected in StraightLineFrom2Points.h
36
#else
// defined(StraightLineFrom2Points_RECURSES)
38
#define StraightLineFrom2Points_RECURSES
39
40
#if !defined StraightLineFrom2Points_h
42
#define StraightLineFrom2Points_h
43
45
// Inclusions
46
#include <iostream>
47
48
#include "DGtal/base/Common.h"
49
#include "DGtal/kernel/PointVector.h"
50
#include "DGtal/kernel/CInteger.h"
51
#include "DGtal/io/Color.h"
53
54
namespace
DGtal
55
{
56
57
59
// template class StraightLineFrom2Points
67
template
<
typename
TPo
int
>
68
class
StraightLineFrom2Points
69
{
70
71
// ----------------------- associated types ------------------------------
72
public
:
73
74
typedef
typename
TPoint::Coordinate
Coordinate
;
75
typedef
Coordinate
Distance
;
//to promote
76
typedef
TPoint
Point
;
77
typedef
TPoint
Vector
;
78
79
// ----------------------- Standard services ------------------------------
80
public
:
81
85
StraightLineFrom2Points
();
86
87
93
StraightLineFrom2Points
(
const
Point
& aFirstPoint,
const
Point
& aSecondPoint);
94
100
void
init
(
const
Point
& aFirstPoint,
const
Point
& aSecondPoint);
101
106
StraightLineFrom2Points
(
const
StraightLineFrom2Points
& other );
107
113
StraightLineFrom2Points
&
operator=
(
const
StraightLineFrom2Points
& other );
114
115
119
~StraightLineFrom2Points
();
120
121
// ----------------------- Interface --------------------------------------
122
public
:
123
128
void
selfDisplay
( std::ostream & out )
const
;
129
134
bool
isValid
()
const
;
135
141
Distance
signedDistance
(
const
Point
& aP)
const
;
142
146
const
Point
&
p
()
const
147
{
148
return
myP
;
149
};
150
154
const
Point
&
q
()
const
155
{
156
return
myQ
;
157
};
158
159
//------------------ display -------------------------------
164
//DrawableWithBoard2D* defaultStyle( std::string mode="" ) const;
165
169
std::string
className
()
const
;
170
171
// ------------------------- Protected Data ------------------------------
172
private
:
173
// ------------------------- Private Data --------------------------------
174
private
:
175
//the two points that uniquely define the straight line
179
Point
myP
;
183
Point
myQ
;
184
// ------------------------- Hidden services ------------------------------
185
protected
:
186
187
188
private
:
189
190
191
192
// ------------------------- Internals ------------------------------------
193
private
:
194
195
196
197
198
};
// end of class StraightLineFrom2Points
199
200
207
template
<
typename
TPo
int
>
208
inline
209
std::ostream&
210
operator<<
( std::ostream & out,
211
const
StraightLineFrom2Points<TPoint>
&
object
)
212
{
213
object
.selfDisplay( out );
214
return
out;
215
}
216
217
218
}
// namespace DGtal
219
220
222
// Includes inline functions.
223
#include "DGtal/shapes/fromPoints/StraightLineFrom2Points.ih"
224
225
// //
227
228
#endif
// !defined StraightLineFrom2Points_h
229
230
#undef StraightLineFrom2Points_RECURSES
231
#endif
// else defined(StraightLineFrom2Points_RECURSES)
DGtal::StraightLineFrom2Points
Aim: Represents a straight line uniquely defined by two 2D points and that is able to return for any ...
Definition
StraightLineFrom2Points.h:69
DGtal::StraightLineFrom2Points< Point >::Vector
Point Vector
Definition
StraightLineFrom2Points.h:77
DGtal::StraightLineFrom2Points::isValid
bool isValid() const
DGtal::StraightLineFrom2Points::StraightLineFrom2Points
StraightLineFrom2Points()
DGtal::StraightLineFrom2Points::init
void init(const Point &aFirstPoint, const Point &aSecondPoint)
DGtal::StraightLineFrom2Points::~StraightLineFrom2Points
~StraightLineFrom2Points()
DGtal::StraightLineFrom2Points< Point >::Distance
Coordinate Distance
Definition
StraightLineFrom2Points.h:75
DGtal::StraightLineFrom2Points::q
const Point & q() const
Definition
StraightLineFrom2Points.h:154
DGtal::StraightLineFrom2Points::className
std::string className() const
DGtal::StraightLineFrom2Points::operator=
StraightLineFrom2Points & operator=(const StraightLineFrom2Points &other)
DGtal::StraightLineFrom2Points< Point >::Point
Point Point
Definition
StraightLineFrom2Points.h:76
DGtal::StraightLineFrom2Points::signedDistance
Distance signedDistance(const Point &aP) const
DGtal::StraightLineFrom2Points::StraightLineFrom2Points
StraightLineFrom2Points(const StraightLineFrom2Points &other)
DGtal::StraightLineFrom2Points::p
const Point & p() const
Definition
StraightLineFrom2Points.h:146
DGtal::StraightLineFrom2Points< Point >::Coordinate
Point::Coordinate Coordinate
Definition
StraightLineFrom2Points.h:74
DGtal::StraightLineFrom2Points::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::StraightLineFrom2Points< Point >::myP
Point myP
Definition
StraightLineFrom2Points.h:179
DGtal::StraightLineFrom2Points< Point >::myQ
Point myQ
Definition
StraightLineFrom2Points.h:183
DGtal::StraightLineFrom2Points::StraightLineFrom2Points
StraightLineFrom2Points(const Point &aFirstPoint, const Point &aSecondPoint)
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)
src
DGtal
shapes
fromPoints
StraightLineFrom2Points.h
Generated on
for DGtal by
1.18.0