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;
virtual RepBase * clone()
The clone function returns an object of its own kind which is a copy of this object at this moment...
Value
A few common colors.
The base class for the PlotterBase hierarchy.
A Periodic transform that transforms coordinates from one 2D coordinate system to another...
static BinToColorFactory * instance()
Returns a pointer to the singleton instance.
A factory for creation of objects whose class is derived from BinToColor.
hippodraw::BinToColor class interface
BinToColor * m_bin_to_color
The following function transforms the projected value to a color scale.
The base class for the point representation hierarchy.
~ColorBoxPointRep()
The destructor.
hippodraw::ViewBase class interface
error on X or half bin width
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.
virtual void setBoxEdge(bool show)
The base class for the value to the color transformation.
float size() const
Returns the size of the representation.
virtual bool uses(Color::Value) const
Returns false as this class represents a Z value in color.
virtual void drawProjectedValues(const DataSource *ntuple, TransformBase *transform, ViewBase *view)
Draws the projected values.
hippodraw::PlotterBase class interface.
A PointRep class that draws a colored box to represent the value.
hippodraw::DataPointTuple namespace interface
A transform that transforms coordinates from one coordinate system to another.
void makeInBounds(double &x, double &y) const
Changes the coordinates so that they are inside or on the boundary of the rectangle.
double low() const
Returns the minimum of the range object.
virtual const BinToColor * getValueTransform() const
Returns the value transform.
bool isInDepth(double z1) const
Checks the value against the depth to see if it is in bounds.
A transform that transforms coordinates from one 2D coordinate system to another. ...
BinToColorFactory class interface.
hippodraw::DataSource class interface.
hippodraw::ColorBoxPointRep class interface
A Color class for creating the color object following the standard RGB color space.
bool m_box_edge
Flag to indicated that box edge needs to be shown.
The base class for the point representation hierarchy.
Base class for DataSource.
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.
void setRange(const Range &r)
Sets the range of the values passed.
virtual const Color & repColor() const =0
Returns the color used for the representation.
bool m_desel
A flag to indicate the representation is de-selected.
double high() const
Returns the maximum of the range object.
Class representing a rectangle.
A namespace to set the standard for indexing into 3 dimension data point tuple.
double getZ() const
A shortcut to get origin.Z.
static const Color s_desel_color
The color of the representation when it is de-selected.
virtual void setValueTransform(BinToColor *)
Sets the value transform.
hippodraw::PeriodicBinaryTransform class interface
ColorBoxPointRep()
The default constructor.
virtual const Color & color() const
Returns the representation's color.
Expresses a range of values.
A namespace to set the standard for indexing into 2 dimension data point tuple.
The abstract base class for views.