contrib/gel/gst/gst_edge_2d.h
Go to the documentation of this file.
00001 // This is gel/gst/gst_edge_2d.h
00002 #ifndef gst_edge_2d_h_
00003 #define gst_edge_2d_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 // \author crossge@crd.ge.com
00010 
00011 #include <vcl_iosfwd.h>
00012 #include <vbl/vbl_ref_count.h>
00013 
00014 #include "gst_vertex_2d_sptr.h"
00015 
00016 class gst_edge_2d : public vbl_ref_count
00017 {
00018  public:
00019   // constructor
00020   gst_edge_2d(gst_vertex_2d_sptr start, gst_vertex_2d_sptr end)
00021   : start_(start), end_(end) {}
00022 
00023   // copy constructor - compiler-provided one sets ref_count to nonzero which is wrong -PVr
00024   gst_edge_2d(gst_edge_2d const& e)
00025   : vbl_ref_count(), start_(e.start_), end_(e.end_) {}
00026 
00027   // getters (no setters)
00028 
00029   gst_vertex_2d_sptr get_start() const { return start_; }
00030   gst_vertex_2d_sptr get_end() const { return end_; }
00031 
00032   // operations
00033   void flip() { gst_vertex_2d_sptr temp= start_; start_= end_; end_= temp; }
00034 
00035   // display
00036   friend vcl_ostream &operator<<( vcl_ostream &os, gst_edge_2d &e);
00037 
00038  protected:
00039   gst_vertex_2d_sptr start_;
00040   gst_vertex_2d_sptr end_;
00041 };
00042 
00043 vcl_ostream &operator<<( vcl_ostream &os, gst_edge_2d &e);
00044 
00045 #endif // gst_edge_2d_h_