bbtk::GObjectsMVCFactory Class Reference

#include <GObjectsMVCFactory.h>

Collaboration diagram for bbtk::GObjectsMVCFactory:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 GObjectsMVCFactory ()
 ~GObjectsMVCFactory ()
BlackBoxDescriptor::Pointer getBlackBoxDescriptor (std::string packageName, std::string boxName)
vtkGObjectViewcreateGObjectView (int type)
GObjectControllercreateGObjectController (int type)
GObjectModelcreateGObjectModel (int type)

Static Public Member Functions

static GObjectsMVCFactorygetInstance ()
static void destroyInstance ()

Public Attributes

Interpreter::Pointer _interpreter

Static Private Attributes

static GObjectsMVCFactoryinstance = NULL


Detailed Description

Definition at line 79 of file GObjectsMVCFactory.h.


Constructor & Destructor Documentation

bbtk::GObjectsMVCFactory::GObjectsMVCFactory (  ) 

Definition at line 46 of file GObjectsMVCFactory.cxx.

References _interpreter.

Referenced by getInstance().

00047         {               
00048                 _interpreter =Interpreter::New();
00049                 _interpreter->SetCommandLine(true);
00050                 std::stringstream* buf = new std::stringstream;
00051                 *buf << "exec freeze_no_error" << std::endl;
00052                 *buf << "message max 0" << std::endl; 
00053                 *buf << "include *" << std::endl;
00054                 _interpreter->InterpretBuffer(buf);     
00055         }

Here is the caller graph for this function:

bbtk::GObjectsMVCFactory::~GObjectsMVCFactory (  ) 

Definition at line 58 of file GObjectsMVCFactory.cxx.

References destroyInstance().

00059         {
00060                 GObjectsMVCFactory::destroyInstance();
00061         }

Here is the call graph for this function:


Member Function Documentation

GObjectController * bbtk::GObjectsMVCFactory::createGObjectController ( int  type  ) 

Definition at line 122 of file GObjectsMVCFactory.cxx.

References bbtk::GBLACKBOX, bbtk::GCOMPLEXINPUTPORT, bbtk::GCOMPLEXOUTPUTPORT, and bbtk::GPORT.

Referenced by bbtk::wxVtkSceneManager::createGBlackBox(), bbtk::wxVtkSceneManager::createGComplexBoxInputPort(), bbtk::wxVtkSceneManager::createGComplexBoxOutputPort(), and bbtk::wxVtkSceneManager::createGPort().

00123         {
00124                 GObjectController *controller = NULL;
00125                 if (type == GBLACKBOX)
00126                 {
00127                         controller = new GBlackBoxController();
00128                 }
00129                 else if(type == GPORT)
00130                 {
00131                         controller = new GPortController();
00132                 }
00133                 else if(type == GCOMPLEXINPUTPORT || type == GCOMPLEXOUTPUTPORT)
00134                 {
00135                         controller = new GBoxController();
00136                 }
00137                 return controller;
00138         }

Here is the caller graph for this function:

GObjectModel * bbtk::GObjectsMVCFactory::createGObjectModel ( int  type  ) 

Definition at line 142 of file GObjectsMVCFactory.cxx.

References bbtk::GBLACKBOX, bbtk::GCOMPLEXINPUTPORT, bbtk::GCOMPLEXOUTPUTPORT, bbtk::GPORT, and bbtk::GObjectModel::setGObjectType().

Referenced by bbtk::wxVtkSceneManager::createGBlackBox(), bbtk::wxVtkSceneManager::createGComplexBoxInputPort(), bbtk::wxVtkSceneManager::createGComplexBoxOutputPort(), and bbtk::wxVtkSceneManager::createGPort().

00143         {
00144                 GObjectModel *model = NULL;
00145                 if (type == GBLACKBOX)
00146                 {
00147                         model = new GBlackBoxModel();
00148                 }
00149                 else if(type == GPORT)
00150                 {
00151                         model = new GPortModel();
00152                 }
00153                 else if(type == GCOMPLEXINPUTPORT || type == GCOMPLEXOUTPUTPORT)
00154                 {
00155                         model = new GComplexBoxPortModel();
00156                 }
00157 
00158                 model->setGObjectType(type);
00159 
00160                 return model;
00161         }

Here is the call graph for this function:

Here is the caller graph for this function:

vtkGObjectView * bbtk::GObjectsMVCFactory::createGObjectView ( int  type  ) 

Definition at line 102 of file GObjectsMVCFactory.cxx.

References bbtk::GBLACKBOX, bbtk::GCOMPLEXINPUTPORT, bbtk::GCOMPLEXOUTPUTPORT, and bbtk::GPORT.

Referenced by bbtk::wxVtkSceneManager::createGBlackBox(), bbtk::wxVtkSceneManager::createGComplexBoxInputPort(), bbtk::wxVtkSceneManager::createGComplexBoxOutputPort(), and bbtk::wxVtkSceneManager::createGPort().

00103         {
00104                 vtkGObjectView* view = NULL;
00105                 if (type == GBLACKBOX)
00106                 {
00107                         view = new vtkGBlackBoxView();
00108                 }
00109                 else if(type == GPORT)
00110                 {
00111                         view = new vtkGPortView();
00112                 }
00113                 else if(type == GCOMPLEXINPUTPORT || type == GCOMPLEXOUTPUTPORT)
00114                 {
00115                         view = new vtkGComplexBoxPortView();
00116                 }
00117                 return view;
00118         }

Here is the caller graph for this function:

void bbtk::GObjectsMVCFactory::destroyInstance (  )  [static]

Definition at line 93 of file GObjectsMVCFactory.cxx.

References instance.

Referenced by ~GObjectsMVCFactory().

00094         {
00095                 //FCY memory leaks
00096                 delete instance;
00097                 instance=NULL;
00098         }

Here is the caller graph for this function:

BlackBoxDescriptor::Pointer bbtk::GObjectsMVCFactory::getBlackBoxDescriptor ( std::string  packageName,
std::string  boxName 
)

Definition at line 64 of file GObjectsMVCFactory.cxx.

References _interpreter.

Referenced by bbtk::wxVtkSceneManager::createGBlackBox(), and bbtk::wxGUIEditorGraphicBBS::displayBlackBoxInfo().

00065         {       
00066                 Factory::Pointer factory;               
00067                 Package::Pointer k;
00068                 std::map< std::string, BlackBoxDescriptor::Pointer> mapDesc;
00069                 try{
00070                         factory = _interpreter->GetExecuter()->GetFactory();
00071                         k = factory->GetPackage(packageName);
00072                         mapDesc = k->GetDescriptorMap();
00073                 }catch(Exception e){
00074                         printf("SCP: Exception in BlackBoxDescriptor::Pointer GObjectsMVCFactory::getBlackBoxDescriptor for package %s\n", packageName.c_str());
00075                         printf("SCP: ERROR package %s probably does not exist\n", packageName.c_str());
00076                 }
00077 
00078 
00079                 return mapDesc[boxName];
00080         }

Here is the caller graph for this function:

GObjectsMVCFactory * bbtk::GObjectsMVCFactory::getInstance (  )  [static]

Definition at line 83 of file GObjectsMVCFactory.cxx.

References GObjectsMVCFactory(), and instance.

Referenced by bbtk::wxVtkSceneManager::createGBlackBox(), bbtk::wxVtkSceneManager::createGComplexBoxInputPort(), bbtk::wxVtkSceneManager::createGComplexBoxOutputPort(), bbtk::wxVtkSceneManager::createGPort(), and bbtk::wxGUIEditorGraphicBBS::displayBlackBoxInfo().

00084         {
00085                 if(instance == NULL){
00086                         instance = new GObjectsMVCFactory();
00087                 }
00088                 return instance;
00089         }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 103 of file GObjectsMVCFactory.h.

Referenced by getBlackBoxDescriptor(), and GObjectsMVCFactory().

Definition at line 110 of file GObjectsMVCFactory.h.

Referenced by destroyInstance(), and getInstance().


The documentation for this class was generated from the following files:

Generated on Thu May 31 15:14:14 2012 for bbtkGEditor by  doxygen 1.5.7.1