ESyS-Particle  2.3
LineSegment.h
Go to the documentation of this file.
1 // //
3 // Copyright (c) 2003-2014 by The University of Queensland //
4 // Centre for Geoscience Computing //
5 // http://earth.uq.edu.au/centre-geoscience-computing //
6 // //
7 // Primary Business: Brisbane, Queensland, Australia //
8 // Licensed under the Open Software License version 3.0 //
9 // http://www.opensource.org/licenses/osl-3.0.php //
10 // //
12 
13 #ifndef __LINE_SEGMENT_H
14 #define __LINE_SEGMENT_H
15 
16 //--- Project includes ---
17 #include "Foundation/vec3.h"
18 #include "Geometry/Line.h"
19 
28 class LineSegment : public Line
29 {
30  private:
31  double m_len;
32 
33  public:
34  LineSegment(const Vec3&,const Vec3&);
35  virtual ~LineSegment(){}
36 
37  virtual double sep(const Vec3&);
38  virtual bool intersect(const Vec3&,const Vec3&);
39  Vec3 getP1() {return Pos;};
40  Vec3 getP2() {return Pos+m_len*U;};
41 };
42 
43 #endif // __LINE_SEGMENT_H
Vec3 getP1()
Definition: LineSegment.h:39
Definition: vec3.h:46
virtual ~LineSegment()
Definition: LineSegment.h:35
Class representing a line.
Definition: Line.h:25
Vec3 Pos
Definition: Line.h:28
Class representing a line segment for intersection/fitting calculation in 2D.
Definition: LineSegment.h:28
virtual bool intersect(const Vec3 &, const Vec3 &)
Definition: LineSegment.cpp:60
LineSegment(const Vec3 &, const Vec3 &)
Definition: LineSegment.cpp:23
double m_len
Definition: LineSegment.h:31
virtual double sep(const Vec3 &)
Definition: LineSegment.cpp:38
Vec3 U
Definition: Line.h:28
Vec3 getP2()
Definition: LineSegment.h:40