00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "xymk.h"
00012
00013 const char* xy_id_xymk_cpp="$Id: xymk.cpp,v 1.8 1999/12/09 21:47:46 rborges Exp $";
00014
00015 XYMarker::XYMarker (const XYAxis* axis,
00016 double pos,
00017 long color,
00018 int width,
00019 LineStyle style,
00020 xybool visible)
00021 : XYObject(0, 0, visible),
00022 _axis(axis),
00023 _pos(pos),
00024 _color(color),
00025 _width(width),
00026 _style(style)
00027 {
00028 double xb, yb;
00029 _axis -> pointInValue(_pos, xb, yb);
00030
00031 position(xb, yb);
00032 }
00033
00034 void XYMarker::axis (const XYAxis* ax)
00035 {
00036 _axis = ax;
00037 }
00038
00039 const XYAxis* XYMarker::axis (void) const
00040 {
00041 return _axis;
00042 }
00043
00044 void XYMarker::pos (double ps)
00045 {
00046 _pos = ps;
00047 }
00048
00049 double XYMarker::pos (void) const
00050 {
00051 return _pos;
00052 }
00053
00054 void XYMarker::color (long c)
00055 {
00056 _color = c;
00057 }
00058
00059 long XYMarker::color (void) const
00060 {
00061 return _color;
00062 }
00063
00064 void XYMarker::width (int w)
00065 {
00066 _width = w;
00067 }
00068
00069 int XYMarker::width (void) const
00070 {
00071 return _width;
00072 }
00073
00074 void XYMarker::style (XYObject::LineStyle st)
00075 {
00076 _style = st;
00077 }
00078
00079 int XYMarker::style (void) const
00080 {
00081 return _style;
00082 }
00083
00084 void XYMarker::limit (double h)
00085 {
00086 _limit = h;
00087 }
00088
00089 double XYMarker::limit (void) const
00090 {
00091 return _limit;
00092 }
00093
00094 void XYMarker::scaleValue(double x1, double y1, double* pos)
00095 {
00096 const XYAxis* acont = axis();
00097
00098
00099 double x0, y0;
00100 acont -> position (&x0, &y0);
00101
00102 double f;
00103
00104
00105 if (acont -> rotation() == 0.0)
00106 f = x1 - x0;
00107 else
00108 f = y1 - y0;
00109
00110
00111 *pos = f * (acont -> max() - acont -> min())
00112 / acont -> size() + acont -> min();
00113 }
00114
00115
00116 void XYMarker::insertAction (XYGraph * )
00117 {
00118 }
00119
00120
00121 void XYMarker::removeAction (XYGraph * )
00122 {
00123 }