14 #include "msdevstudio/MSconfig.h"
29 using namespace hippodraw;
33 m_line_style ( Line::
Solid )
40 m_line_style ( Line::
Solid )
46 m_line_style ( Line::
Solid )
52 m_line_style ( point_rep.m_line_style )
79 namespace dp = hippodraw::DataPoint2DTuple;
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());
bool outside_box(std::vector< double >::const_iterator ix, std::vector< double >::const_iterator iy) const
bool isInBounds(double x1, double y1) const
Checks the coordinates to see if they are inside or on the boundary of the rectangle.
The abstract base class for views.
double getHeight() const
A shortcut to get size.height.
A PointRep class that draws a column to represent the value.
double getX() const
The following function returns the X coordinate.
Style
Line style constants.
hippodraw::Range class interface
std::vector< double > m_x
A cache of the points along the X axis to be drawn.
hippodraw::DataPointTuple namespace interface
hippodraw::LinePointRep class interface
double getY() const
A shortcut to get origin.Y.
The base class for the point representation hierarchy.
Base class for DataSource.
double separation(const Point &pt1, const Point &pt2) const
double getWidth() const
A shortcut to get size.width.
hippodraw::ViewBase class interface
The base class for the point representation hierarchy.
hippodraw::BinaryTransform class interface
virtual bool uses(hippodraw::Line::Style) const
Returns true as this class uses hippodraw::Line::Style.
virtual const Color & color() const
Returns the representation's color.
void transformValues(const DataSource *source, TransformBase *transform)
Transform the projected values in source with transform.
virtual unsigned int getStyle() const
Returns the style of the line drawing.
virtual void drawProjectedValues(const DataSource *ntuple, TransformBase *transform, ViewBase *previews)
Draws the projected values.
void setPoint(double x, double y)
virtual void setStyle(unsigned int style)
Sets the style of the line drawing.
bool straddles_y_boundary(std::vector< double >::const_iterator ix, std::vector< double >::const_iterator iy, Point &pt1, Point &pt2, double &distance) const
Class representing a two or three dimension point.
A transform that transforms coordinates from one 2D coordinate system to another. ...
float m_size
The size of the representation.
void addEndPoints(std::vector< double >::const_iterator ix, std::vector< double >::const_iterator iy, std::vector< double > &x, std::vector< double > &y) const
double getY() const
The following function returns the Y coordinate.
intp size(numeric::array arr)
virtual ~LinePointRep()
The destructor.
bool straddles_x_boundary(std::vector< double >::const_iterator ix, std::vector< double >::const_iterator iy, Point &pt1, Point &pt2, double &distance) const
float size() const
Returns the size of the representation.
virtual RepBase * clone()
The clone function returns an object of its own kind which is a copy of this object at this moment...
void findEndPoints(std::vector< double >::const_iterator ix, std::vector< double >::const_iterator iy, Point &pt1, Point &pt2) const
bool cornerCase(std::vector< double >::const_iterator ix, std::vector< double >::const_iterator iy, std::vector< double > &x, std::vector< double > &y) const
Style convert(unsigned int style)
A Color class for creating the color object following the standard RGB color space.
hippodraw::DataSource class interface.
hippodraw::Line::Style m_line_style
The style currently used.
std::vector< double > m_y
A cache of the points along the Y axis to be drawn.
void drawValues(ViewBase *view)
Draws the projected values from protected transformed copy to view.
A transform that transforms coordinates from one coordinate system to another.
double interpolate(double x, std::vector< double >::const_iterator ix, std::vector< double >::const_iterator iy) const
LinePointRep()
The default constructor.
double getX() const
A shortcut to get origin.X.