00001 00012 // for truncation warning in debug mode 00013 #ifdef _MSC_VER 00014 #include "msdevstudio/MSconfig.h" 00015 #endif 00016 00017 #include "FunctionRep2.h" 00018 00019 #include "functions/FunctionBase.h" 00020 #include "projectors/ProjectorBase.h" 00021 00022 #include "reps/ContourFunctionRep.h" 00023 00024 #include <cassert> 00025 00026 using namespace hippodraw; 00027 00028 FunctionRep2:: 00029 FunctionRep2 ( FunctionBase * function, DataRep * rep ) 00030 : FunctionRep ( function, rep ) 00031 { 00032 m_rep = new ContourFunctionRep(); 00033 // The above deleted in ~DataRep() 00034 } 00035 00036 FunctionRep2:: 00037 FunctionRep2 ( const FunctionRep2 & rep ) 00038 : FunctionRep ( rep ) 00039 { 00040 } 00041 00042 FunctionRep2:: 00043 ~FunctionRep2 () 00044 { 00045 } 00046 00047 DataRep * FunctionRep2::clone () 00048 { 00049 return new FunctionRep2 ( *this ); 00050 } 00051 00052 bool 00053 FunctionRep2:: 00054 hasAxis ( hippodraw::Axes::Type axis ) const 00055 { 00056 return axis == Axes::X || axis == Axes::Y || axis == Axes::Z; 00057 } 00058 00059 void 00060 FunctionRep2:: 00061 drawProjectedValues ( TransformBase * transform, 00062 ViewBase * view ) 00063 { 00064 drawCuts ( transform, view ); 00065 00066 const Range & x_range = m_projector -> getRange ( Axes::X ); 00067 const Range & y_range = m_projector -> getRange ( Axes::Y ); 00068 FunctionBase * function = getFunction (); 00069 ContourFunctionRep * rep = dynamic_cast < ContourFunctionRep * > ( m_rep ); 00070 assert ( rep != 0 ); 00071 00072 rep -> drawProjectedValues ( x_range, y_range, function, transform, view ); 00073 00074 setDirty ( false ); 00075 }