contrib/gel/gtrl/gtrl_triangle.h
Go to the documentation of this file.
00001 // This is gel/gtrl/gtrl_triangle.h
00002 #ifndef gtrl_triangle_h_
00003 #define gtrl_triangle_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 // \author crossge@crd.ge.com
00010 
00011 #include <vbl/vbl_smart_ptr.h>
00012 #include <vbl/vbl_ref_count.h>
00013 
00014 #include <gtrl/gtrl_vertex.h>
00015 
00016 class gtrl_triangle : public vbl_ref_count
00017 {
00018  public:
00019   gtrl_triangle( gtrl_vertex_sptr p1, gtrl_vertex_sptr p2, gtrl_vertex_sptr p3);
00020   // copy constructor - compiler-provided one sets ref_count to nonzero which is wrong -PVr
00021   gtrl_triangle(gtrl_triangle const& t)
00022     : vbl_ref_count(),p1_(t.p1_),p2_(t.p2_),p3_(t.p3_),midpoint_(t.midpoint_) {}
00023 
00024   gtrl_vertex_sptr p1() const { return p1_; }
00025   gtrl_vertex_sptr p2() const { return p2_; }
00026   gtrl_vertex_sptr p3() const { return p3_; }
00027   gtrl_vertex_sptr mid_point() const { return midpoint_; }
00028 
00029  protected:
00030   gtrl_vertex_sptr p1_;
00031   gtrl_vertex_sptr p2_;
00032   gtrl_vertex_sptr p3_;
00033 
00034   gtrl_vertex_sptr midpoint_;
00035 };
00036 
00037 typedef vbl_smart_ptr<gtrl_triangle> gtrl_triangle_sptr;
00038 
00039 #endif // gtrl_triangle_h_