14 #include "msdevstudio/MSconfig.h"
35 using namespace hippodraw;
40 m_plot_symbol( symbol )
56 m_x_flag( point_rep.m_x_flag ),
57 m_y_flag( point_rep.m_y_flag ),
58 m_plot_symbol( point_rep.m_plot_symbol )
140 double alpha,
double beta,
double gamma,
bool negative )
142 if ( negative ==
false ) lat-=180.0;
145 lat = M_PI * lat / 180.0;
146 lon = M_PI * lon / 180.0;
147 alpha = M_PI * alpha / 180.0;
148 beta = M_PI * beta / 180.0;
149 gamma = M_PI * gamma / 180.0;
153 double x = cos( lat ) * cos( lon );
154 double y = sin( lat ) * cos( lon );
155 double z = sin( lon );
159 double ry = y * cos( alpha ) + z * sin( alpha );
160 double rz = - y * sin( alpha ) + z * cos( alpha );
162 x = rx; y = ry; z = rz;
165 rx = x * cos( beta ) - z * sin( beta );
167 rz = x * sin( beta ) + z * cos( beta );
169 x = rx; y = ry; z = rz;
172 rx = x * cos( gamma ) + y * sin( gamma );
173 ry = - x * sin( gamma ) + y * cos( gamma );
176 x = rx; y = ry; z = rz;
179 lon = ( 180.0 / M_PI ) * asin( z );
180 lat = ( 180.0 / M_PI ) * atan2( y, x );
182 if (negative==
false) lat+=180.0;
186 namespace dp = hippodraw::DataPoint2DTuple;
196 unsigned int size = ntuple -> rows ();
197 if ( size == 0 )
return;
204 for (
unsigned int i = 0;
i <
size;
i++ ) {
211 tf -> transform (
m_x,
m_y);
228 m_x.reserve ( size );
229 m_y.reserve ( size );
234 if ( tf -> isPeriodic () ) {
251 const vector < double > & row = ntuple -> getRow ( i );
252 double x = row [
dp::X ];
253 double y = row [
dp::Y ];
258 if ( tf -> isPeriodic() )
virtual void setErrorOn(hippodraw::Axes::Type axis, bool yes=true)
Sets the display of the error bar.
hippodraw::SymbolPointRep class interface
static void rotate(double &lat, double &lon, double alpha, double beta, double gamma, bool negative=true)
Rotates the coordinate.
hippodraw::ErrorBarRep class interface
A transform that transforms coordinates from one coordinate system to another.
const PeriodicBinaryTransform * c_periodic_tf
Cached dynamic cast of BinaryTransform to PeriodicBinaryTransform if the BinaryTransform is periodic...
hippodraw::Symbol::Type m_plot_symbol
The PlotSymbol currently used.
virtual void transform(double &x, double &y) const =0
Transform the coordinates on the X and Y axes.
virtual void setStyle(unsigned int symbol)
Sets the symbol of the representation.
~SymbolPointRep()
The destructor.
hippodraw::PeriodicBinaryTransform class interface
virtual void transformPoints(const TransformBase &transform, ViewBase &view)
Transforms the cached coordinates using transform.
Type
Enumeration of the type of symbols supported by this class.
void beginPlot(unsigned int size, const BinaryTransform *tf, const ViewBase *view)
Sets the value of cached data members.
bool includes(double value) const
Returns true if the argument value is inside the range.
virtual bool uses(hippodraw::Symbol::Type) const
Returns true as this class uses hippodraw::Symbol::Type as a property.
A Color class for creating the color object following the standard RGB color space.
hippodraw::DataSource class interface.
double c_beta
Cached xOffset of PeriodicBinaryTransform.
A Periodic transform that transforms coordinates from one 2D coordinate system to another...
A PointRep class draws a symbol to represent the value.
std::vector< double > m_y
A cache of the points to be drawn on the Y axis.
virtual RepBase * clone()
The clone function returns an object of its own kind which is a copy of this object at this moment...
virtual void setColor(const Color &color)
Sets the color of the representation.
virtual unsigned int getStyle() const
Returns the style of the point symbol.
ErrorBarRep * m_error_rep
The error bar representation.
intp size(numeric::array arr)
virtual void setSize(float value)
Sets the size of the representation.
virtual const Color & color() const
Returns the representation's color.
virtual void setSize(float value)
Sets the size of the line drawing and that of the error bar.
virtual void drawProjectedValues(const DataSource *ntuple, TransformBase *transform, ViewBase *view)
virtual void setColor(const Color &)
Sets the color of the representation.
double c_max_x
Cached xHighLimit of PeriodicBinaryTransform.
bool drawProjectedValue(unsigned int i, const DataSource *ntuple, const BinaryTransform *transform, ViewBase *view)
Draws a projected value.
float m_size
The size of the representation.
The abstract base class for views.
std::vector< double > m_x
A cache of the points to be drawn on the X axis.
RepBase * clone()
The clone function returns an object of its own kind which is a copy of this object at this moment...
Range c_x_range
Cached Range on X axis.
A transform that transforms coordinates from one 2D coordinate system to another. ...
virtual bool yError() const
Returns true if the point representation displays error on the Y axis.
SymbolPointRep()
The default constructor.
Type convert(unsigned int type)
Expresses a range of values.
hippodraw::DataPointTuple namespace interface
bool m_x_flag
The x error flag.
Range c_y_range
Cached Range on X axis.
A rep to draw error bars, owned by point reps.
hippodraw::ViewBase class interface
virtual bool xError() const
Returns true if the point representation displays error on the X axis.
float size() const
Returns the size of the representation.
hippodraw::NTupleProjector class interface
double c_gamma
Cached yOffset of PeriodBinaryTransform.
bool m_y_flag
The y error flag.
The base class for the point representation hierarchy.
The base class for the point representation hierarchy.
Base class for DataSource.