# ifndef SR_LINES_H # define SR_LINES_H /** \file sr_lines.h * manages a set of lines */ # include "sr_vec.h" # include "sr_box.h" # include "sr_color.h" # include "sr_array.h" # include "sr_polygon.h" /*! \class SrLines sr_lines.h \brief a set of lines Keeps the description of segments or polygonal lines. Vertices are stored in array V. If no extra information is given, V is supposed to contain a sequence of vertices forming independent line segments. In order to specify multiple polygonal lines and colors, the array of indices 'I' can be used in the following way: Each pair of indices (i,j) indicates that V[i] to V[j] form a polygonal line and not independent line segments. If j<0, then it means that the current color for all vertices with indices >=i will be C[-j-1]. The indices i appearing in the sequence of pairs (i,j) must appear ordered, so that 'I' is just read once when drawing the lines. */ class SrLines { public : SrArray V; // C; // I; //& a ); /*! Push an array of points forming a polygon */ void push_polygon ( const SrArray& a ); /*! Push an array of points assumin each 2 consecutive points denote one line */ void push_lines ( const SrArray& a ); /*! Calls push_polygon() or push_polyline() according to p.open() */ void push_polygon ( const SrPolygon& p ) { if (p.open()) push_polyline( (const SrArray&)p ); else push_polygon( (const SrArray&)p ); } /*! Approximates a circle with a polyline, where: center is the center point, center+radius gives the first point, normal is orthogonal to radius, and nvertices gives the number of vertices in the polyline */ void push_circle_approximation ( const SrPnt& center, const SrVec& radius, const SrVec& normal, int nvertices ); /*! Returns the bounding box of all vertices used. The returned box can be empty. */ void get_bounding_box ( SrBox &b ) const; }; //================================ End of File ================================================= # endif // SR_LINES_H