Assignments Assignments

lineSegments.h
Go to the documentation of this file.
1#ifndef LINE_SEGMENTS_INCLUDED
2#define LINE_SEGMENTS_INCLUDED
3
4#include <iostream>
5#include <utility>
6#include <string>
7#include <vector>
8#include <Util/geometry.h>
9#include <Util/algebra.h>
10
11 namespace Image
12{
14 class OrientedLineSegment : public Util::VectorSpace< OrientedLineSegment >
15 {
16 public:
18 static const double A;
19
21 static const double B;
22
24 static const double P;
25
27 Util::Point2D endPoints[2];
28
30 double getWeight( Util::Point2D p ) const;
31
33 double length( void ) const;
34
36 double distance( Util::Point2D p ) const;
37
39 Util::Point2D perpendicular( void ) const;
40
43 static Util::Point2D GetSourcePosition( const OrientedLineSegment &source , const OrientedLineSegment &destination , Util::Point2D target );
44
46 // VectorSpace methods //
48
49 OrientedLineSegment operator * ( double s ) const;
50
52 OrientedLineSegment operator + ( const OrientedLineSegment &ols ) const;
53 };
54
56 std::ostream &operator << ( std::ostream &stream , const OrientedLineSegment &ols );
57
59 std::istream &operator >> ( std::istream &stream , OrientedLineSegment &ols );
60
62 class OrientedLineSegmentPairs : public std::vector< std::pair< OrientedLineSegment , OrientedLineSegment > >
63 {
64 public:
68 Util::Point2D getSourcePosition( Util::Point2D destination ) const;
69 };
70
72 std::ostream &operator << ( std::ostream &stream , const OrientedLineSegmentPairs &ols );
73
75 std::istream &operator >> ( std::istream &stream , OrientedLineSegmentPairs &ols );
76}
77#endif // LINE_SEGMENTS_INCLUDED
algebra.h
Image::OrientedLineSegment
Definition lineSegments.h:15
Image::OrientedLineSegment::endPoints
Util::Point2D endPoints[2]
Definition lineSegments.h:27
Image::OrientedLineSegment::perpendicular
Util::Point2D perpendicular(void) const
Definition lineSegments.todo.cpp:27
Image::OrientedLineSegment::A
static const double A
Definition lineSegments.h:18
Image::OrientedLineSegment::P
static const double P
Definition lineSegments.h:24
Image::OrientedLineSegment::length
double length(void) const
Definition lineSegments.todo.cpp:11
Image::OrientedLineSegment::getWeight
double getWeight(Util::Point2D p) const
Definition lineSegments.cpp:17
Image::OrientedLineSegment::GetSourcePosition
static Util::Point2D GetSourcePosition(const OrientedLineSegment &source, const OrientedLineSegment &destination, Util::Point2D target)
Definition lineSegments.todo.cpp:36
Image::OrientedLineSegment::operator+
OrientedLineSegment operator+(const OrientedLineSegment &ols) const
Definition lineSegments.cpp:26
Image::OrientedLineSegment::B
static const double B
Definition lineSegments.h:21
Image::OrientedLineSegment::distance
double distance(Util::Point2D p) const
Definition lineSegments.todo.cpp:19
Image::OrientedLineSegmentPairs
Definition lineSegments.h:63
Image::OrientedLineSegmentPairs::getSourcePosition
Util::Point2D getSourcePosition(Util::Point2D destination) const
Definition lineSegments.cpp:44
Util::Point
Definition geometry.h:52
Util::VectorSpace
Definition algebra.h:66
Util::VectorSpace< OrientedLineSegment >::operator*
friend OrientedLineSegment operator*(double s, const OrientedLineSegment &e)
Definition algebra.h:90
geometry.h
Image
Definition bmp.cpp:142
Image::operator>>
std::istream & operator>>(std::istream &stream, OrientedLineSegment &ols)
Definition lineSegments.cpp:37
Image::operator<<
std::ostream & operator<<(std::ostream &stream, const OrientedLineSegment &ols)
Definition lineSegments.cpp:35