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