13 #include "msdevstudio/MSconfig.h" 89 double high = range.
high();
90 double low = range.
low();
96 bt -> transformZ ( high );
97 bt -> transformZ ( low );
99 Range newrange ( low, high );
101 const Rect & user_rect = view -> getUserRect ();
103 const Rect & raw_rect = view -> getRawRect();
105 bool isLinear = bt -> isLinearInXY ();
106 bool surpress_zero = low == 0.0;
108 unsigned int size = ntuple -> rows ();
115 bool isPeriodic = bt -> isPeriodic();
125 beta = pbt -> xOffset ();
126 gamma = pbt -> yOffset ();
127 max_x = pbt -> limitX().high();
133 for (
unsigned int i = 0; i <
size; i++ ) {
134 const vector < double > & row = ntuple -> getRow ( i );
136 double value = row [
dp::Z ];
137 if ( surpress_zero && value == 0.0 )
continue;
139 double half_xwidth = row [
dp::XERR ];
140 double half_ywidth = row [
dp::YERR ];
142 double x = row [
dp::X ];
143 double y = row [
dp::Y ];
151 rotate ( x, y, 0.0, beta, gamma, (max_x==180) );
155 double x1 = x - half_xwidth;
156 double y1 = y - half_ywidth;
157 double x2 = x + half_xwidth;
158 double y2 = y + half_ywidth;
175 if ( isLinear ==
false ) {
176 bt -> transform ( xtl, ytl );
177 bt -> transform ( xbl, ybl );
178 bt -> transform ( xtr, ytr );
179 bt -> transform ( xbr, ybr );
184 if ( isLinear ==
false ) {
185 std::vector <double> xx;
190 std::vector <double> yy;
196 view -> drawPolygon ( xx, yy, black, black );
198 const int gray = 256;
199 view -> drawSquare ( x1, y1, x2, y2, gray, gray, gray );
205 bt -> transformZ ( value );
209 if ( value > user_rect.
getZ() ) {
222 if ( isLinear ==
false ) {
224 std::vector <double> xx;
229 std::vector <double> yy;
235 view -> drawPolygon ( xx, yy, color,
m_box_edge?black:color );
242 view -> drawSquare ( xtl, ytl, xbr, ybr,
247 std::vector<double> x;
254 std::vector<double> y;
281 double alpha,
double beta,
double gamma,
bool negative )
283 if ( !negative ) lat-=180.0;
286 lat = M_PI * lat / 180.0;
287 lon = M_PI * lon / 180.0;
288 alpha = M_PI * alpha / 180.0;
289 beta = M_PI * beta / 180.0;
290 gamma = M_PI * gamma / 180.0;
294 double x = cos( lat ) * cos( lon );
295 double y = sin( lat ) * cos( lon );
296 double z = sin( lon );
300 double ry = y * cos( alpha ) + z * sin( alpha );
301 double rz = - y * sin( alpha ) + z * cos( alpha );
303 x = rx; y = ry; z = rz;
306 rx = x * cos( beta ) - z * sin( beta );
308 rz = x * sin( beta ) + z * cos( beta );
310 x = rx; y = ry; z = rz;
313 rx = x * cos( gamma ) + y * sin( gamma );
314 ry = - x * sin( gamma ) + y * cos( gamma );
317 x = rx; y = ry; z = rz;
320 lon = ( 180.0 / M_PI ) * asin( z );
321 lat = ( 180.0 / M_PI ) * atan2( y, x );
323 if ( !negative ) lat+=180.0;
A namespace to set the standard for indexing into 2 dimension data point tuple.
virtual const BinToColor * getValueTransform() const
Returns the value transform.
bool m_desel
A flag to indicate the representation is de-selected.
Class representing a rectangle.
~ColorBoxPointRep()
The destructor.
static const Color s_desel_color
The color of the representation when it is de-selected.
hippodraw::BinToColor class interface
A transform that transforms coordinates from one 2D coordinate system to another. ...
virtual void drawPolyLine(const std::vector< double > &xpoints, const std::vector< double > &ypoints, Line::Style style, const Color &color, float size)=0
Draws a polyline.
ColorBoxPointRep()
The default constructor.
static BinToColorFactory * instance()
Returns a pointer to the singleton instance.
double high() const
Returns the maximum of the range object.
bool isInDepth(double z1) const
Checks the value against the depth to see if it is in bounds.
The base class for the point representation hierarchy.
Value
A few common colors.
virtual bool uses(Color::Value) const
Returns false as this class represents a Z value in color.
virtual RepBase * clone()
The clone function returns an object of its own kind which is a copy of this object at this moment...
hippodraw::ViewBase class interface
Base class for DataSource.
A Periodic transform that transforms coordinates from one 2D coordinate system to another...
The base class for the point representation hierarchy.
void setRange(const Range &r)
Sets the range of the values passed.
virtual void setValueTransform(BinToColor *)
Sets the value transform.
double low() const
Returns the minimum of the range object.
A Color class for creating the color object following the standard RGB color space.
BinToColorFactory class interface.
The base class for the PlotterBase hierarchy.
hippodraw::PeriodicBinaryTransform class interface
float size() const
Returns the size of the representation.
BinToColor * m_bin_to_color
The following function transforms the projected value to a color scale.
Expresses a range of values.
hippodraw::DataSource class interface.
A factory for creation of objects whose class is derived from BinToColor.
A transform that transforms coordinates from one coordinate system to another.
A PointRep class that draws a colored box to represent the value.
virtual const Color & color() const
Returns the representation's color.
The abstract base class for views.
hippodraw::ColorBoxPointRep class interface
hippodraw::PlotterBase class interface.
virtual void drawProjectedValues(const DataSource *ntuple, TransformBase *transform, ViewBase *view)
Draws the projected values.
hippodraw::DataPointTuple namespace interface
A namespace to set the standard for indexing into 3 dimension data point tuple.
error on X or half bin width
void makeInBounds(double &x, double &y) const
Changes the coordinates so that they are inside or on the boundary of the rectangle.
virtual void setBoxEdge(bool show)
virtual const Color & repColor() const =0
Returns the color used for the representation.
The base class for the value to the color transformation.
static void rotate(double &lat, double &lon, double alpha, double beta, double gamma, bool negative=true)
The following function do a rotation for periodic transform.
double getZ() const
A shortcut to get origin.Z.
bool m_box_edge
Flag to indicated that box edge needs to be shown.