23 using namespace hippodraw;
53 const Range & y_range,
60 if ( dim == 2 ) yes |=
m_cut_list[1].getInversion ();
81 double x1 = x_range.
low ();
82 double y1 = y_range.
low ();
83 double x2 = x_range.
high ();
84 double y2 = y_range.
high ();
89 double cut_low = range.
low ();
90 double cut_high = range.
high ();
91 if ( cut_low > x1 ) x1 = cut_low;
92 if ( cut_high < x2 ) x2 = cut_high;
98 double cut_low = range.
low ();
99 double cut_high = range.
high ();
100 if ( cut_low > y1 ) y1 = cut_low;
101 if ( cut_high < y2 ) y2 = cut_high;
121 view.
drawSquare ( x1, y1, x2, y2, red, green, blue );
130 double xl = x_range.
low ();
131 double xr = x_range.
high ();
134 double cut_low = range.
low();
135 double cut_high = range.
high ();
137 double x1 = std::max ( cut_low, xl );
138 double x2 = std::min ( cut_high, xr );
140 double y1 = y_range.
low ();
141 double y2 = y_range.
high ();
169 view.
drawSquare ( xl, y1, x1, y2, red, green, blue );
170 view.
drawSquare ( x2, y1, xr, yr, red, green, blue );
183 double xLow = x_range.
low ();
184 double yLow = y_range.
low ();
187 double xHigh = x_range.
high ();
188 double yHigh = y_range.
high ();
199 double cut_low = range.
low();
200 double cut_high = range.
high ();
201 if ( cut_low > x1 ) x1 = cut_low;
202 if ( cut_high < x2 ) x2 = cut_high;
208 double cut_low = range.
low();
209 double cut_high = range.
high();
210 if ( cut_low > y1 ) y1 = cut_low;
211 if ( cut_high < y2 ) y2 = cut_high;
237 view.
drawSquare( xLow, yLow, x1, yHigh, red, green, blue );
240 view.
drawSquare( x2, yLow, xHigh, yHigh, red, green, blue );
243 view.
drawSquare( x1, y2, x2, yHigh, red, green, blue );
246 view.
drawSquare( x1, yLow, x2, y1, red, green, blue );
250 const vector < TupleCut > &
295 string what (
"CutRangeRep::setCutRange: index out of range." );
296 throw std::out_of_range ( what );
bool m_desel
A flag to indicate the representation is de-selected.
double high() const
Returns the maximum of the range object.
A transform that transforms coordinates from one coordinate system to another.
A derived class of PointRepBase class that draws a representation of a cut range. ...
virtual void transform(double &x, double &y) const =0
Transform the coordinates on the X and Y axes.
void drawProjectedValues(const Range &x_range, const Range &y_range, const TransformBase &tb, ViewBase &view)
Draw the Range of the cut.
void throwRangeException()
Throws exception that index was out of range.
The class expresses a cut on a DataSource, i.e.
void setCutRangeAt(const Range &range, unsigned int i)
Set the Range of the i-th cut.
A Color class for creating the color object following the standard RGB color space.
static const Color s_desel_color
The color of the representation when it is de-selected.
CutList_t m_cut_list
A list of cut objects used to highlight region of the data representation.
hippodraw::BinaryTransform class interface
void toggleInverted(unsigned int i)
Toggles the i-th cut to be inverted from its current state.
const std::vector< TupleCut > & getCuts() const
Returns the TupleCut objects used by the receiving object.
void drawNormalRange(const Range &x_range, const Range &y_range, const TransformBase &tb, ViewBase &view)
Draws the Range for cut within x_range and y_range using view under transform tb. ...
void setEnabled(unsigned int i, bool yes)
Sets the enabled state of the i-th cut.
virtual void setColor(const Color &)
Sets the color of the representation.
Color m_color
The color of the representation.
CutRangeRep()
The default constructor.
virtual void drawSquare(double x1, double y1, double x2, double y2, int red, int green, int blue)=0
Draws a colored square.
virtual CutRangeRep * clone()
The clone function returns an object of its own kind which is a copy of this object at this moment...
The abstract base class for views.
hippodraw::TupleCut class interface
A transform that transforms coordinates from one 2D coordinate system to another. ...
double low() const
Returns the minimum of the range object.
Expresses a range of values.
void addCut(const TupleCut &cut)
Add a TupleCut object to the list of cuts.
void drawInvertedRange1D(const Range &x_range, const Range &y_range, const TransformBase &tb, ViewBase &view)
Draws the Range for 1D cut with inversion within x_range and y_range using view under transform tb...
hippodraw::ViewBase class interface
void drawInvertedRange2D(const Range &x_range, const Range &y_range, const TransformBase &transform, ViewBase &view)
Draws the Range for 2D cut with inversion within x_range and y_range using view under transform trans...
CutRangeRep class interface.
The base class for the point representation hierarchy.
Base class for DataSource.