14 #include "msdevstudio/MSconfig.h" 33 m_line_style ( Line::
Solid )
85 unsigned int size = ntuple -> rows ();
86 if ( size == 0 )
return;
95 for ( ; i <
size; i++ ) {
96 const vector < double > & row = ntuple -> getRow ( i );
97 double x = row [
dp::X ];
98 double y = row [
dp::Y ];
105 t -> transform (
m_x,
m_y );
122 unsigned int size =
m_x.size ();
123 if ( size == 0 )
return;
141 std::vector<double>::const_iterator ix =
m_x.begin();
142 std::vector<double>::const_iterator iy =
m_y.begin();
143 bool isCorner(
false);
144 std::vector<double> xcorner;
145 std::vector<double> ycorner;
159 isCorner =
cornerCase(ix, iy, xcorner, ycorner);
175 std::vector<double>::const_iterator iy)
const {
184 std::vector<double>::const_iterator iy,
186 double & distance)
const {
222 std::vector<double>::const_iterator iy,
224 double & distance)
const {
260 std::vector<double>::const_iterator iy)
const {
261 return (x - *ix)/(*(ix+1) - *ix)*(*(iy+1) - *iy) + *iy;
272 std::vector<double>::const_iterator iy,
273 std::vector<double> & x, std::vector<double> & y)
const {
278 x.push_back(pt1.
getX());
279 y.push_back(pt1.
getY());
280 x.push_back(pt2.
getX());
281 y.push_back(pt2.
getY());
287 std::vector<double>::const_iterator iy,
289 Point xpt1, xpt2, ypt1, ypt2;
293 if (xstrad || ystrad) {
294 if ( (xstrad && ystrad && xdist < ydist) || xstrad ) {
297 }
else if ( (xstrad && ystrad && xdist > ydist) || ystrad ) {
309 std::vector<double>::const_iterator iy,
310 std::vector<double> & x, std::vector<double> & y)
const {
311 Point xpt1, xpt2, ypt1, ypt2;
321 x.push_back(xpt1.
getX());
322 y.push_back(xpt1.
getY());
324 x.push_back(xpt2.
getX());
325 y.push_back(xpt2.
getY());
328 x.push_back(ypt1.
getX());
329 y.push_back(ypt1.
getY());
331 x.push_back(ypt2.
getX());
332 y.push_back(ypt2.
getY());
double interpolate(double x, std::vector< double >::const_iterator ix, std::vector< double >::const_iterator iy) const
A namespace to set the standard for indexing into 2 dimension data point tuple.
bool isInBounds(double x1, double y1) const
Checks the coordinates to see if they are inside or on the boundary of the rectangle.
void addEndPoints(std::vector< double >::const_iterator ix, std::vector< double >::const_iterator iy, std::vector< double > &x, std::vector< double > &y) const
const std::string & name() const
Returns the name of the representation.
Style convert(unsigned int style)
virtual bool uses(hippodraw::Line::Style) const
Returns true as this class uses hippodraw::Line::Style.
hippodraw::LinePointRep class interface
hippodraw::Line::Style m_line_style
The style currently used.
double getX() const
The following function returns the X coordinate.
bool straddles_x_boundary(std::vector< double >::const_iterator ix, std::vector< double >::const_iterator iy, Point &pt1, Point &pt2, double &distance) const
A transform that transforms coordinates from one 2D coordinate system to another. ...
double getY() const
The following function returns the Y coordinate.
void findEndPoints(std::vector< double >::const_iterator ix, std::vector< double >::const_iterator iy, Point &pt1, Point &pt2) const
double getX() const
A shortcut to get origin.X.
bool cornerCase(std::vector< double >::const_iterator ix, std::vector< double >::const_iterator iy, std::vector< double > &x, std::vector< double > &y) const
The base class for the point representation hierarchy.
double getY() const
A shortcut to get origin.Y.
std::vector< double > m_x
A cache of the points along the X axis to be drawn.
void setPoint(double x, double y)
hippodraw::ViewBase class interface
virtual void drawProjectedValues(const DataSource *ntuple, TransformBase *transform, ViewBase *previews)
Draws the projected values.
Base class for DataSource.
The base class for the point representation hierarchy.
hippodraw::BinaryTransform class interface
void transformValues(const DataSource *source, TransformBase *transform)
Transform the projected values in source with transform.
LinePointRep()
The default constructor.
A Color class for creating the color object following the standard RGB color space.
double getWidth() const
A shortcut to get size.width.
double separation(const Point &pt1, const Point &pt2) const
virtual RepBase * clone()
The clone function returns an object of its own kind which is a copy of this object at this moment...
float size() const
Returns the size of the representation.
Class representing a two or three dimension point.
hippodraw::DataSource class interface.
A transform that transforms coordinates from one coordinate system to another.
double getHeight() const
A shortcut to get size.height.
void drawValues(ViewBase *view)
Draws the projected values from protected transformed copy to view.
virtual void setStyle(unsigned int style)
Sets the style of the line drawing.
virtual const Color & color() const
Returns the representation's color.
The abstract base class for views.
bool outside_box(std::vector< double >::const_iterator ix, std::vector< double >::const_iterator iy) const
hippodraw::DataPointTuple namespace interface
virtual ~LinePointRep()
The destructor.
A PointRep class that draws a column to represent the value.
virtual unsigned int getStyle() const
Returns the style of the line drawing.
std::vector< double > m_y
A cache of the points along the Y axis to be drawn.
float m_size
The size of the representation.
bool straddles_y_boundary(std::vector< double >::const_iterator ix, std::vector< double >::const_iterator iy, Point &pt1, Point &pt2, double &distance) const
hippodraw::Range class interface
Style
Line style constants.