core/vgl/vgl_conic_segment_2d.txx
Go to the documentation of this file.
00001 // This is core/vgl/vgl_conic_segment_2d.txx
00002 #ifndef vgl_conic_segment_2d_txx_
00003 #define vgl_conic_segment_2d_txx_
00004 
00005 #include "vgl_conic_segment_2d.h"
00006 #include <vcl_iostream.h>
00007 
00008 // stream operators
00009 template <class Type>
00010 vcl_ostream& operator<<(vcl_ostream& s, vgl_conic_segment_2d<Type> const & p)
00011 {
00012   return s << "<vgl_conic_segment_2d " << p.point1() << " to " << p.point2() << "with " << p.conic()
00013            << (p.is_clockwise() ? ", clockwise" : ", counterclockwise") << " >";
00014 }
00015 
00016 template <class Type>
00017 vcl_istream& operator>>(vcl_istream& s, vgl_conic_segment_2d<Type>& p)
00018 {
00019   vgl_point_2d<Type> p1, p2;
00020   s >> p1 >> p2;
00021   vgl_conic<Type> conic;
00022   s >> conic;
00023   p.set(p1, p2, conic, true);
00024   return s;
00025 }
00026 
00027 #undef VGL_CONIC_SEGMENT_2D_INSTANTIATE
00028 #define VGL_CONIC_SEGMENT_2D_INSTANTIATE(Type) \
00029 template class vgl_conic_segment_2d<Type >;\
00030 template vcl_istream& operator>>(vcl_istream&, vgl_conic_segment_2d<Type >&);\
00031 template vcl_ostream& operator<<(vcl_ostream&, vgl_conic_segment_2d<Type > const&)
00032 
00033 #endif // vgl_conic_segment_2d_txx_