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