00001 00012 #include "LineDataRep.h" 00013 00014 #include "projectors/LineProjector.h" 00015 #include "reps/LinePointRep.h" 00016 00017 using namespace hippodraw; 00018 00019 LineDataRep:: 00020 LineDataRep ( hippodraw::Axes::Type axis, double value ) 00021 { 00022 m_name = "Static Line"; 00023 m_projector = new LineProjector ( axis, value ); 00024 m_rep = new LinePointRep ( ); 00025 // The above deleted in ~DataRep() 00026 00027 m_rep->setColor ( Color::red ); 00028 } 00029 00030 LineDataRep:: 00031 LineDataRep () 00032 { 00033 m_name = "Static Line"; 00034 } 00035 00036 DataRep * LineDataRep::clone () 00037 { 00038 return new LineDataRep ( *this ); 00039 } 00040 00041 /* virtual */ 00042 bool LineDataRep::hasNTupleBindings () const 00043 { 00044 return false; 00045 } 00046 00047 void 00048 LineDataRep:: 00049 setValue ( double value ) 00050 { 00051 LineProjector * projector 00052 = dynamic_cast < LineProjector * > ( m_projector ); 00053 projector -> setValue ( value ); 00054 } 00055 00056 bool 00057 LineDataRep:: 00058 hasAxis ( hippodraw::Axes::Type axis ) const 00059 { 00060 return axis == Axes::X || axis == Axes::Y; 00061 } 00062