Cut2DPlotter.cxx

Go to the documentation of this file.
00001 
00012 // for truncation warning
00013 #ifdef _MSC_VER
00014 #include "msdevstudio/MSconfig.h"
00015 #endif
00016 
00017 #include "Cut2DPlotter.h"
00018 
00019 #include "datareps/DataRep.h"
00020 #include "datasrcs/TupleCut.h"
00021 #include "reps/CutRangeRep.h"
00022 
00023 #include <cassert>
00024 
00025 using std::vector;
00026 
00027 namespace hippodraw {
00028 
00029 Cut2DPlotter::
00030 Cut2DPlotter ( )
00031   : CutPlotter ( "Cut2DPlotter" )
00032 {
00033   setEnableZ ( true );
00034 }
00035 
00036 Cut2DPlotter::Cut2DPlotter ( const Cut2DPlotter & plotter )
00037   : CutPlotter ( plotter )
00038 {
00039   setEnableZ ( true );
00040 }
00041 
00042 Cut2DPlotter::~Cut2DPlotter ()
00043 {
00044 }
00045 
00046 PlotterBase * Cut2DPlotter::clone()
00047 {
00048   return new Cut2DPlotter ( *this );
00049 }
00050 
00051 void
00052 Cut2DPlotter::
00053 addTupleCut ( DataRep * rep )
00054 {
00055   m_datarep = rep;
00056   m_datarep -> addCut ( TupleCut () );
00057   m_datarep -> addCut ( TupleCut () );
00058 }
00059 
00060 
00061 void
00062 Cut2DPlotter::
00063 addDataRep ( DataRep * rep )
00064 {
00065   XyPlotter::addDataRep ( rep );
00066 }
00067 
00068 void
00069 Cut2DPlotter::
00070 setAxisBinding ( const std::vector < std::string > & bindings )
00071 {
00072   assert ( bindings.size () == 2 );
00073 
00074   CutPlotter::setAxisBinding ( bindings );
00075 }
00076 
00077 void Cut2DPlotter::setCutRangeFull ( )
00078 {
00079   const Range & rangeX = getRange ( Axes::X, false );
00080   m_datarep -> setCutRangeAt (rangeX, 0 );
00081 
00082   const Range & rangeY = getRange ( Axes::Y, false );
00083   m_datarep -> setCutRangeAt ( rangeY, 1 );
00084   
00085   updateTargets ();
00086 }
00087 
00088 void Cut2DPlotter::toggleInverted ( )
00089 {
00090   m_datarep -> toggleInverted ( 0 );
00091   m_datarep -> toggleInverted ( 1 );
00092 
00093   updateTargets ();
00094 }
00095 
00096 Range Cut2DPlotter::getCutRangeY ( )
00097 {
00098   TupleCut * cut = getCutAt ( 1 );
00099   Range range = cut -> getRange ();
00100 
00101   return range;
00102 }
00103 
00104 } // namespace hippodraw

Generated for HippoDraw Class Library by doxygen