contrib/oxl/mvl/HomgLineSeg3D.cxx
Go to the documentation of this file.
00001 // This is oxl/mvl/HomgLineSeg3D.cxx
00002 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00003 #pragma implementation
00004 #endif
00005 //:
00006 //  \file
00007 
00008 #include "HomgLineSeg3D.h"
00009 #include <mvl/HomgLine3D.h>
00010 #include <mvl/HomgOperator3D.h>
00011 #include <vcl_iostream.h>
00012 
00013 //--------------------------------------------------------------
00014 //
00015 //: Default constructor
00016 HomgLineSeg3D::HomgLineSeg3D ()
00017 {
00018 }
00019 
00020 //--------------------------------------------------------------
00021 //
00022 //: Constructor forming line segment from start and end points
00023 HomgLineSeg3D::HomgLineSeg3D (const HomgPoint3D& point1, const HomgPoint3D& point2):
00024   HomgLine3D(point1, point2)
00025 {
00026   point1_ = point1;
00027   point2_ = point2;
00028 }
00029 
00030 
00031 //--------------------------------------------------------------
00032 //
00033 //: Destructor
00034 HomgLineSeg3D::~HomgLineSeg3D()
00035 {
00036 }
00037 
00038 
00039 //--------------------------------------------------------------
00040 //
00041 //: Return the line through the two points.
00042 const HomgLine3D& HomgLineSeg3D::get_line () const
00043 {
00044   return *this;
00045 }
00046 
00047 //--------------------------------------------------------------
00048 //
00049 //: Return the first point of the line segment
00050 const HomgPoint3D& HomgLineSeg3D::get_point1 () const
00051 {
00052   return point1_;
00053 }
00054 
00055 //--------------------------------------------------------------
00056 //
00057 //: Return the second point of the line segment
00058 const HomgPoint3D& HomgLineSeg3D::get_point2 () const
00059 {
00060   return point2_;
00061 }
00062 
00063 
00064 //--------------------------------------------------------------
00065 //
00066 // Set the line segment given two points
00067 void HomgLineSeg3D::set (const HomgPoint3D& point1, const HomgPoint3D& point2)
00068 {
00069   point1_ = point1;
00070   point2_ = point2;
00071 }
00072 
00073 vcl_ostream& operator << (vcl_ostream& s, const HomgLineSeg3D& l)
00074 {
00075   return s << l.get_point1().get_vector() << ", " << l.get_point2().get_vector();
00076 }