contrib/oxl/osl/osl_edge.h
Go to the documentation of this file.
00001 // This is oxl/osl/osl_edge.h
00002 #ifndef osl_edge_h_
00003 #define osl_edge_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 // \author fsm
00010 
00011 #include <osl/osl_edgel_chain.h>
00012 #include <osl/osl_vertex.h>
00013 
00014 class osl_edge : public osl_topology_base, public osl_edgel_chain
00015 {
00016  public:
00017   // end-vertices (ref-counted)
00018   osl_vertex *v1, *v2;
00019 
00020   osl_edge(int n, osl_vertex *v1, osl_vertex *v2);
00021   osl_edge(osl_edgel_chain const &, osl_vertex *v1, osl_vertex *v2);
00022   ~osl_edge();
00023 
00024   // set new end-vertex pointers
00025   osl_vertex *GetV1() const { return v1; }
00026   osl_vertex *GetV2() const { return v2; }
00027 
00028   // replace end-vertices pointers
00029   void set_v1(osl_vertex *newv);
00030   void set_v2(osl_vertex *newv);
00031 
00032   // return coordinates of end-vertices
00033   float GetStartX() const;
00034   float GetStartY() const;
00035 
00036   float GetEndX() const;
00037   float GetEndY() const;
00038 
00039   // set coordinates of end-vertices
00040   void SetStartX(float v);
00041   void SetStartY(float v);
00042   void SetStart(float x, float y);
00043 
00044   void SetEndX(float v);
00045   void SetEndY(float v);
00046   void SetEnd(float x, float y);
00047 };
00048 
00049 #endif // osl_edge_h_