ESyS-Particle  4.0.1
LineSegment.h
00001 
00002 //                                                         //
00003 // Copyright (c) 2003-2011 by The University of Queensland //
00004 // Earth Systems Science Computational Centre (ESSCC)      //
00005 // http://www.uq.edu.au/esscc                              //
00006 //                                                         //
00007 // Primary Business: Brisbane, Queensland, Australia       //
00008 // Licensed under the Open Software License version 3.0    //
00009 // http://www.opensource.org/licenses/osl-3.0.php          //
00010 //                                                         //
00012 
00013 #ifndef __LINE_SEGMENT_H
00014 #define  __LINE_SEGMENT_H
00015 
00016 //--- Project includes ---
00017 #include "Foundation/vec3.h"
00018 #include "Geometry/Line.h"
00019 
00028 class LineSegment : public Line
00029 {
00030  private:
00031   double m_len;
00032 
00033  public:
00034   LineSegment(const Vec3&,const Vec3&);
00035   virtual ~LineSegment(){}
00036 
00037   virtual double sep(const Vec3&);
00038   virtual bool intersect(const Vec3&,const Vec3&);
00039   Vec3 getP1() {return Pos;};
00040   Vec3 getP2() {return Pos+m_len*U;};
00041 };
00042 
00043 #endif // __LINE_SEGMENT_H