int wxVtkSceneManager::createGBlackBox(int x, int y, std::string packageName, std::string boxType)
{
-
int windowWidth=_baseView->GetRenWin()->GetSize()[0];
int windowHeight=_baseView->GetRenWin()->GetSize()[1];
//=========================================================================
- int wxVtkSceneManager::createGInputPort(int portType, int posinBox,GBlackBoxModel *blackBox, BlackBoxInputDescriptor *desc)
+ int wxVtkSceneManager::createGComplexBoxInputPort(std::string inputName)
+ {
+ int windowWidth=_baseView->GetRenWin()->GetSize()[0];
+ int windowHeight=_baseView->GetRenWin()->GetSize()[1];
+
+ int type = GCOMPLEXINPUTPORT;
+
+ //Create the MVC Objects
+
+ GComplexBoxPortModel *model = (GComplexBoxPortModel*)GObjectsMVCFactory::getInstance()->createGObjectModel(type);
+ vtkGObjectView *view = GObjectsMVCFactory::getInstance()->createGObjectView(type);
+ GObjectController* controller = GObjectsMVCFactory::getInstance()->createGObjectController(type);
+
+ //Prepares the initial model
+
+ double xx = 5;
+ double yy = windowHeight-5;
+
+ //z value is not important yet, because it is only used a parallel projection
+ double zz = 900;
+
+ _baseView->TransCoordScreenToWorld(xx,yy,zz);
+ model->setInicPoint(xx,yy,zz);
+
+ model->setBBTKName(inputName);
+ model->setBBTKType("ComplexInputPort");
+ model->setComplexPortType(type);
+
+ model->addObserver(view);
+ model->addObserver(this);
+
+ //create the output port
+ GPortController* portController = createGPort(GOUTPUTPORT,inputName,"ComplexInputPort",0,model);
+ model->addOutputPort((GPortModel*)portController->getModel());
+
+ //Associates the view with the correspondent renderer and the model.
+ //(NOTE: Refresh is only made by the view)
+ view->setModel(model);
+ view->setBaseView(_baseView);
+ view->initVtkObjects();
+
+ //Associates the controller with the correspondent model and view
+ controller->setModelAndView(model,view);
+
+ //Resgiter change to the observers of the actual model
+ model->notifyObservers(_idManager);
+
+ //Register the controller of the new object
+ registerController((InteractorStyleMaracas*) controller);
+
+ //Add the object to the objects list
+ int newId = _controllers.size();
+ controller->setId(newId);
+ _controllers[newId] = controller;
+ return newId;
+ }
+
+ //=========================================================================
+
+ int wxVtkSceneManager::createGComplexBoxOutputPort(std::string outputName)
+ {
+ int windowWidth=_baseView->GetRenWin()->GetSize()[0];
+ int windowHeight=_baseView->GetRenWin()->GetSize()[1];
+
+ int type = GCOMPLEXOUTPUTPORT;
+
+ //Create the MVC Objects
+
+ GComplexBoxPortModel *model = (GComplexBoxPortModel*)GObjectsMVCFactory::getInstance()->createGObjectModel(type);
+ vtkGObjectView *view = GObjectsMVCFactory::getInstance()->createGObjectView(type);
+ GObjectController* controller = GObjectsMVCFactory::getInstance()->createGObjectController(type);
+
+ //Prepares the initial model
+
+ double xx = 5;
+ double yy = windowHeight-5;
+
+ //z value is not important yet, because it is only used a parallel projection
+ double zz = 900;
+
+ _baseView->TransCoordScreenToWorld(xx,yy,zz);
+ model->setInicPoint(xx,yy,zz);
+
+ model->setBBTKName(outputName);
+ model->setBBTKType("ComplexOutputPort");
+ model->setComplexPortType(type);
+
+ model->addObserver(view);
+ model->addObserver(this);
+
+ //create the output port
+ GPortController* portController = createGPort(GINPUTPORT,outputName,"ComplexInputPort",0,model);
+ model->addInputPort((GPortModel*)portController->getModel());
+
+ //Associates the view with the correspondent renderer and the model.
+ //(NOTE: Refresh is only made by the view)
+ view->setModel(model);
+ view->setBaseView(_baseView);
+ view->initVtkObjects();
+
+ //Associates the controller with the correspondent model and view
+ controller->setModelAndView(model,view);
+
+ //Resgiter change to the observers of the actual model
+ model->notifyObservers(_idManager);
+
+ //Register the controller of the new object
+ registerController((InteractorStyleMaracas*) controller);
+
+ //Add the object to the objects list
+ int newId = _controllers.size();
+ controller->setId(newId);
+ _controllers[newId] = controller;
+ return newId;
+ }
+
+ //=========================================================================
+
+ int wxVtkSceneManager::createGInputPort(int portType, int posinBox,GBoxModel *blackBox, BlackBoxInputDescriptor *desc)
{
GPortController* portController = createGPort(portType,desc->GetName(),desc->GetTypeName(),posinBox,blackBox);
blackBox->addInputPort((GPortModel*)portController->getModel());
//=========================================================================
- int wxVtkSceneManager::createGOutputPort(int portType, int posinBox,GBlackBoxModel *blackBox, BlackBoxOutputDescriptor *desc)
+ int wxVtkSceneManager::createGOutputPort(int portType, int posinBox,GBoxModel *blackBox, BlackBoxOutputDescriptor *desc)
{
GPortController* portController = createGPort(portType,desc->GetName(),desc->GetTypeName(),posinBox,blackBox);
blackBox->addOutputPort((GPortModel*)portController->getModel());
//=========================================================================
- GPortController* wxVtkSceneManager::createGPort(int portType,std::string bbtkName, std::string bbtkType, int posInBox,GBlackBoxModel *blackBox)
+ GPortController* wxVtkSceneManager::createGPort(int portType,std::string bbtkName, std::string bbtkType, int posInBox,GBoxModel *blackBox)
{
int type = GPORT;