Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

BinToColorFactory.cxx

Go to the documentation of this file.
00001 
00014 #ifdef _MSC_VER
00015 // A long identifier warning.
00016 #include "msdevstudio/MSconfig.h"
00017 #endif
00018 
00019 
00020 
00021 
00022 #include "reps/BinToColorFactory.h"
00023 
00024 // A list of default BinToColors.
00025 #include "BinToColorScale.h"
00026 #include "BinToKamaeScale.h"
00027 #include "BinTo3ColorScale.h"
00028 #include "BinToGreyScale.h"
00029 #include "BinToMovingBrkPt.h"
00030 #include "BinToColorScaleMovingBrkPt.h"
00031 #include "BinToFullColorScale.h"
00032 #include "BinToUsrDefinedScale.h"
00033 
00034 
00035 
00036 BinToColorFactory * BinToColorFactory::s_instance = 0;
00037 
00038 BinToColorFactory::BinToColorFactory ()
00039 {
00040 }
00041 
00042 BinToColorFactory * BinToColorFactory::instance ()
00043 {
00044   if ( s_instance == 0 ) {
00045     s_instance = new BinToColorFactory ();
00046     s_instance->initialize ();
00047   }
00048   return s_instance;
00049 }
00050 
00051 
00052 void BinToColorFactory::initialize ()
00053 {
00054   numModels = 0;
00055   add ( new BinToColorScale ( "Rainbow" ) );
00056   add ( new BinToKamaeScale ( "Kamae" ) );
00057   add ( new BinTo3ColorScale ( "3 Color" ) );
00058   add ( new BinToGreyScale ( "Grey scale" ) );
00059   add ( new BinToColorScaleMovingBrkPt ( "Variable rainbow" ) );
00060   add ( new BinToMovingBrkPt ( "Variable 3 color" ) );
00061   add ( new BinToFullColorScale ( "Full Rainbow" ) );
00062  // change numModels whenever a new models is added/deleted here.
00063   numModels = 7;
00064 }
00065 
00066 int BinToColorFactory::get_num_models ()
00067 {
00068   return numModels;
00069 }
00070 
00071 void BinToColorFactory:: addModel ( const std::string & model_name)
00072 {
00073   add ( new BinToUsrDefinedScale ( model_name ) );
00074 }

Generated for HippoDraw-1.14.8.5 by doxygen 1.4.3