1 /*=========================================================================
7 =========================================================================*/
9 /* ---------------------------------------------------------------------
11 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
12 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
14 * This software is governed by the CeCILL-B license under French law and
15 * abiding by the rules of distribution of free software. You can use,
16 * modify and/ or redistribute the software under the terms of the CeCILL-B
17 * license as circulated by CEA, CNRS and INRIA at the following URL
18 * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
19 * or in the file LICENSE.txt.
21 * As a counterpart to the access to the source code and rights to copy,
22 * modify and redistribute granted by the license, users are provided only
23 * with a limited warranty and the software's author, the holder of the
24 * economic rights, and the successive licensors have only limited
27 * The fact that you are presently reading this means that you have had
28 * knowledge of the CeCILL-B license and that you accept its terms.
29 * ------------------------------------------------------------------------ */
33 * \brief Class bbtk::wxVtkSceneManager .
37 #include "wxVtkSceneManager.h"
43 //=========================================================================
44 wxVtkSceneManager::wxVtkSceneManager(wxGEditorTabPanel *parent, wxVtk3DBaseView *baseView,int idManager)
54 _baseView->GetWxVTKRenderWindowInteractor()->SetDropTarget((wxDropTarget*)parent);
56 _worldState=NOTHING_HAPPENS;
57 registerController(this);
63 //=========================================================================
65 void wxVtkSceneManager::disconnectDrop()
67 _baseView->GetWxVTKRenderWindowInteractor()->SetDropTarget(NULL);
70 //=========================================================================
72 wxVtkSceneManager::~wxVtkSceneManager()
76 //=========================================================================
78 void wxVtkSceneManager::configureBaseView()
80 vtkInteractorStyleBaseView2D *interactorstylebaseview = vtkInteractorStyleBaseView2D::New();
82 _baseView->SetInteractorStyleBaseView(interactorstylebaseview);
84 // Important to activate the 2D interaction system
85 wxVTKRenderWindowInteractor *iren = _baseView->GetWxVTKRenderWindowInteractor();
86 interactorstylebaseview->SetInteractor ( iren );
87 iren->SetInteractorStyle(interactorstylebaseview);
88 interactorstylebaseview->SetwxVtkBaseView(_baseView);
90 _baseView->GetRenderer()->GetActiveCamera()->ParallelProjectionOn();
91 _baseView->GetRenderer()->ResetCamera(-100,100,-100,100,900,1000);
93 _baseView->GetRenderer()->SetBackground(0.9,0.9,0.9);
94 _baseView->GetRenderer()->GradientBackgroundOff();
98 //=========================================================================
100 void wxVtkSceneManager::createGBlackBox(int x, int y, std::string packageName, std::string boxType)
103 int windowWidth=_baseView->GetRenWin()->GetSize()[0];
104 int windowHeight=_baseView->GetRenWin()->GetSize()[1];
106 int type = GBLACKBOX;
108 //Create the MVC Objects
110 GBlackBoxModel *model = (GBlackBoxModel*)GObjectsMVCFactory::getInstance()->createGObjectModel(type);
111 vtkGObjectView *view = GObjectsMVCFactory::getInstance()->createGObjectView(type);
112 GObjectController* controller = GObjectsMVCFactory::getInstance()->createGObjectController(type);
114 BlackBoxDescriptor::Pointer descriptor = GObjectsMVCFactory::getInstance()->getBlackBoxDescriptor(packageName, boxType);
116 //Prepares the initial model
117 //The coordinates obtained are the following. Top-Left:x=0,y=0 Bottom-Right:x=width,y=height
120 double yy = windowHeight-y;
122 //z value is not important yet, because it is only used a parallel projection
125 _baseView->TransCoordScreenToWorld(xx,yy,zz);
126 model->setInicPoint(xx,yy,zz);
129 std::stringstream stream;
133 stream << "Box0" << _numBoxes;
137 stream << "Box" << _numBoxes;
139 std::string arraystring = stream.str();
141 model->setBBTKName(arraystring);
142 model->setBBTKType(boxType);
143 model->setBBTKPackage(packageName);
145 model->addObserver(view);
146 model->addObserver(this);
148 //Iterate and create the input ports
149 std::map<std::string, BlackBoxInputDescriptor*> descriptorInMap = descriptor->GetInputDescriptorMap();
150 std::map<std::string, BlackBoxInputDescriptor*>::iterator itInput;
153 for(itInput = descriptorInMap.begin(); itInput != descriptorInMap.end(); ++itInput)
155 BlackBoxInputDescriptor *desc = itInput->second;
156 createGInputPort(GINPUTPORT,i,model,desc);
160 //Iterate and create the output ports
161 std::map<std::string, BlackBoxOutputDescriptor*> descriptorOutMap = descriptor->GetOutputDescriptorMap();
162 std::map<std::string, BlackBoxOutputDescriptor*>::iterator itOutput;
165 for(itOutput = descriptorOutMap.begin();itOutput != descriptorOutMap.end(); ++itOutput)
167 BlackBoxOutputDescriptor *desc = itOutput->second;
168 createGOutputPort(GOUTPUTPORT,i,model,desc);
173 //Associates the view with the correspondent renderer and the model.
174 //(NOTE: Refresh is only made by the view)
175 view->setModel(model);
176 view->setBaseView(_baseView);
177 view->initVtkObjects();
179 //Associates the controller with the correspondent model and view
180 controller->setModelAndView(model,view);
182 //Resgiter change to the observers of the actual model
183 model->notifyObservers(_idManager);
185 //Register the controller of the new object
186 registerController((InteractorStyleMaracas*) controller);
188 //Add the object to the objects list
189 int newId = _controllers.size();
190 controller->setId(newId);
191 _controllers[newId] = controller;
195 //=========================================================================
197 void wxVtkSceneManager::createGInputPort(int portType, int posinBox,GBlackBoxModel *blackBox, BlackBoxInputDescriptor *desc)
199 GPortController* portController = createGPort(portType,desc->GetName(),desc->GetTypeName(),posinBox,blackBox);
200 blackBox->addInputPort((GPortModel*)portController->getModel());
203 //=========================================================================
205 void wxVtkSceneManager::createGOutputPort(int portType, int posinBox,GBlackBoxModel *blackBox, BlackBoxOutputDescriptor *desc)
207 GPortController* portController = createGPort(portType,desc->GetName(),desc->GetTypeName(),posinBox,blackBox);
208 blackBox->addOutputPort((GPortModel*)portController->getModel());
211 //=========================================================================
213 GPortController* wxVtkSceneManager::createGPort(int portType,std::string bbtkName, std::string bbtkType, int posInBox,GBlackBoxModel *blackBox)
217 //Create the MVC Objects
218 GPortModel *model = (GPortModel*)GObjectsMVCFactory::getInstance()->createGObjectModel(type);
219 vtkGObjectView *view = GObjectsMVCFactory::getInstance()->createGObjectView(type);
220 GObjectController* controller = GObjectsMVCFactory::getInstance()->createGObjectController(type);
222 model->registerInBox(blackBox,portType, posInBox);
224 model->setBBTKType(bbtkType);
225 model->setBBTKName(bbtkName);
227 model->addObserver(view);
228 model->addObserver(this);
230 //Associates the view with the correspondent renderer and the model.
231 //(NOTE: Refresh is only made by the view)
232 view->setModel(model);
233 view->setBaseView(_baseView);
234 view->initVtkObjects();
236 //Associates the controller with the correspondent model and view
237 controller->setModelAndView(model,view);
239 model->notifyObservers(_idManager);
241 //Register the controller of the new object
242 registerController((InteractorStyleMaracas*) controller);
244 int newId = _controllers.size();
245 controller->setId(newId);
246 _controllers[newId] = controller;
248 return (GPortController*)controller;
251 //=========================================================================
253 void wxVtkSceneManager::createGConnector(GPortModel* startPort)
255 int type = GCONNECTOR;
257 manualConnectorContourController* manContourControl = new manualConnectorContourController();
258 manualConnectorContourView* manContourView = new manualConnectorContourView();
259 manualContourModel* manContourModel = new manualContourModel();
261 GConnectorController* connectorcontroller = new GConnectorController();
262 GConnectorModel* connectorModel = new GConnectorModel();
263 GConnectorView* connectorView = new GConnectorView();
264 connectorModel->setGObjectType(type);
266 manContourModel->SetCloseContour(false);
267 connectorModel->setStartPort(startPort);
269 manContourView->SetModel( manContourModel );
270 manContourView->SetWxVtkBaseView( _baseView );
271 manContourView->SetRange( 0.5 );
272 manContourView->SetZ( 900 );
274 manContourView->SetColorNormalContour(0, 0, 1);
275 manContourView->SetColorEditContour(0.5, 0.5, 0.5);
276 manContourView->SetColorSelectContour(1, 0.8, 0);
277 manContourView->SetWidthLine(1);
279 manContourControl->SetModelView( manContourModel , manContourView );
281 manContourControl->CreateNewManualContour();
283 manContourView->RefreshContour();
287 connectorModel->getInicPoint(x,y,z);
289 manContourControl->SetState(1);
290 manContourModel->SetCloseContour(false);
292 manContourModel->AddPoint(x,y,z);
293 manContourView->AddPoint();
295 manContourModel->AddPoint(x,y,z);
296 manContourView->AddPoint();
298 int bak= manContourControl->GetNumberOfPointsManualContour() - 1;
299 manContourControl->_bakIdPoint=bak;
300 manContourView->Refresh();
302 manContourControl->SetMoving( false );
304 registerController((InteractorStyleMaracas*) connectorcontroller);
306 connectorcontroller->setManualContourController(manContourControl);
307 connectorModel->setManualContourModel(manContourModel);
308 connectorView->setManualContourView(manContourView);
309 connectorView->setModel(connectorModel);
310 connectorView->setBaseView(_baseView);
311 connectorcontroller->setModelAndView(connectorModel,connectorView);
313 int newId = _controllers.size();
314 connectorcontroller->setId(newId);
315 _controllers[newId] = connectorcontroller;
319 //=========================================================================
321 void wxVtkSceneManager::registerController(InteractorStyleMaracas *param)
323 vtkInteractorStyleBaseView* baseViewControlManager = (vtkInteractorStyleBaseView*)_baseView->GetInteractorStyleBaseView();
324 baseViewControlManager->AddInteractorStyleMaracas( param );
327 //=========================================================================
329 void wxVtkSceneManager::unregisterController(InteractorStyleMaracas *param)
331 vtkInteractorStyleBaseView* baseViewControlManager = (vtkInteractorStyleBaseView*)_baseView->GetInteractorStyleBaseView();
332 baseViewControlManager->RemoveInteractorStyleMaracas( param );
335 //=========================================================================
337 vtkRenderer* wxVtkSceneManager::getRenderer()
339 return _baseView->GetRenderer();
342 //=========================================================================
344 vtkRenderWindow* wxVtkSceneManager::getRenderWindow()
346 return _baseView->GetRenWin();
348 //=========================================================================
351 void wxVtkSceneManager::update(int idController,int command)
353 if(command != NO_COMMAND)
355 if(command == ADD_TO_SELECTED)
357 GObjectController* cont = _controllers[idController];
360 for (int i=0; i<_selectedObjects.size() && foundID==false; i++)
362 int id = _selectedObjects[i];
370 int id = idController;
371 _selectedObjects.push_back(id);
375 else if(command == INIT_CREATION_CONTOUR)
377 _worldState = INIT_CREATION_CONTOUR;
378 GObjectController* cont = _controllers[idController];
379 GPortModel* startOutputPort = (GPortModel*)cont->getModel();
382 // The last one is the controller of the connector
383 for(int i=0;i<_controllers.size();i++)
385 GObjectController* cont = _controllers[i];
386 if(cont->getGObjectType() == GPORT )
388 GPortModel* port = (GPortModel*)cont->getModel();
389 if(port->getPortType()==GINPUTPORT)
391 cont->SetActive(true);
395 cont->getView()->setState(NOTHING_HAPPENS);
396 cont->getModel()->notifyObservers(_idManager);
397 cont->SetActive(false);
402 cont->getView()->setState(NOTHING_HAPPENS);
403 cont->getModel()->notifyObservers(_idManager);
404 cont->SetActive(false);
408 _selectedObjects.clear();
410 createGConnector(startOutputPort);
413 else if(command == FIN_CREATION_CONTOUR && _worldState == INIT_CREATION_CONTOUR)
415 _worldState = NOTHING_HAPPENS;
416 int id = _controllers.size()-1;
417 GObjectController* cont = _controllers[id];
418 GConnectorModel* modelContour = (GConnectorModel*)cont->getModel();
420 GObjectController* finPort = _controllers[idController];
421 if(finPort->getGObjectType() == GPORT)
423 GPortModel* modelPort = (GPortModel*)finPort->getModel();
424 modelContour->setEndPort(modelPort);
427 manualConnectorContourController* manCont = ((GConnectorController*)cont)->getManualContourController();
428 manualConnectorContourView* connView = (manualConnectorContourView*)manCont->GetManualViewBaseContour();
431 for(int i=0;i<_controllers.size();i++)
433 GObjectController* cont = _controllers[i];
434 if(cont->getView()!=NULL)
436 cont->getView()->setState(NOTHING_HAPPENS);
437 cont->getModel()->notifyObservers(_idManager);
439 cont->SetActive(true);
446 //=========================================================================
448 bool wxVtkSceneManager::OnMouseMove()
451 wxVTKRenderWindowInteractor *wxVTKiren;
452 wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
453 wxVTKiren->GetEventPosition(X,Y);
456 if(_worldState == DRAG_OBJECTS)
458 for (int i=0; i<_selectedObjects.size(); i++)
460 int id = _selectedObjects[i];
461 GObjectController* cont = _controllers[id];
464 cont->getView()->setStartDragging(true);
466 cont->getView()->moveObject(X,Y);
467 cont->getView()->setState(DRAG);
468 cont->getModel()->notifyObservers(_idManager);
471 std::map<int, GObjectController*>::iterator it;
473 for(it = _controllers.begin(); it != _controllers.end(); ++it)
475 GObjectController *desc = it->second;
476 if(desc->getGObjectType()==GCONNECTOR)
478 GConnectorView* vconn = (GConnectorView*)desc->getView();
479 vconn->updateStartEndPoints();
483 _startDragging=false;
486 else if(_worldState == NOTHING_HAPPENS || _worldState == INIT_CREATION_CONTOUR)
488 std::map<int, GObjectController*>::iterator it;
490 for(it = _controllers.begin(); it != _controllers.end(); ++it)
492 GObjectController *desc = it->second;
493 int type = desc->getGObjectType();
494 int state = desc->getView()->getState();
496 if(state == HIGHLIGHTED){
498 updateStatusBar(desc->getStatusText());
501 GBlackBoxModel *mod = (GBlackBoxModel*)desc->getModel();
502 _parent->displayBlackBoxInfo(mod->getBBTKPackage(),mod->getBBTKType());
514 //=========================================================================
516 bool wxVtkSceneManager::OnLeftButtonDown()
518 if(_worldState==INIT_CREATION_CONTOUR)
520 bool isOverPort=false;
521 std::map<int, GObjectController*>::iterator it;
522 for(it = _controllers.begin(); it != _controllers.end() && isOverPort==false; ++it)
524 GObjectController *desc = it->second;
525 if(desc->getGObjectType()==GPORT)
527 GPortModel* portmod=(GPortModel*)desc->getModel();
528 vtkGObjectView* portView=desc->getView();
529 if(portmod->getPortType()==GINPUTPORT && portView->getState()==HIGHLIGHTED)
536 if(isOverPort==false)
538 _worldState=NOTHING_HAPPENS;
539 int lastId = _controllers.size()-1;
540 GConnectorController *connector = (GConnectorController*)_controllers[lastId];
541 connector->removeFromScene();
542 unregisterController(connector);
543 _controllers.erase(lastId);
545 for(it = _controllers.begin(); it != _controllers.end(); ++it)
547 GObjectController *desc = it->second;
548 desc->SetActive(true);
549 desc->getView()->setState(NOTHING_HAPPENS);
550 desc->getModel()->notifyObservers(_idManager);
555 if(_selectedObjects.size()!=0)
557 _worldState = DRAG_OBJECTS;
558 _startDragging = true;
560 for (int i = 0; i < _selectedObjects.size(); i++)
562 int id = _selectedObjects[i];
563 GObjectController* cont = _controllers[id];
564 cont->getView()->setState(DRAG);
565 cont->getModel()->notifyObservers(_idManager);
574 //=========================================================================
576 bool wxVtkSceneManager::OnLeftButtonUp()
578 if(_worldState == DRAG_OBJECTS)
580 _worldState = NOTHING_HAPPENS;
582 for (int i = 0; i < _selectedObjects.size(); i++)
584 int id = _selectedObjects[i];
585 GObjectController* cont = _controllers[id];
586 cont->getView()->setState(SELECTED);
587 cont->getModel()->notifyObservers(_idManager);
593 //=========================================================================
595 bool wxVtkSceneManager::OnRightButtonUp()
597 if(_worldState==INIT_CREATION_CONTOUR)
599 _worldState=NOTHING_HAPPENS;
600 int lastId = _controllers.size()-1;
601 GConnectorController *connector = (GConnectorController*)_controllers[lastId];
602 connector->removeFromScene();
603 unregisterController(connector);
604 _controllers.erase(lastId);
606 std::map<int, GObjectController*>::iterator it;
607 for(it = _controllers.begin(); it != _controllers.end(); ++it)
609 GObjectController *desc = it->second;
610 desc->SetActive(true);
611 desc->getView()->setState(NOTHING_HAPPENS);
612 desc->getModel()->notifyObservers(_idManager);
617 for (int i = 0; i < _selectedObjects.size(); i++)
619 int id = _selectedObjects[i];
620 GObjectController* cont = _controllers[id];
621 cont->SetActive(true);
622 cont->getView()->setState(NOTHING_HAPPENS);
623 cont->getModel()->notifyObservers(_idManager);
626 _selectedObjects.clear();
631 //=========================================================================
633 bool wxVtkSceneManager::OnLeftDClick()
636 wxVTKRenderWindowInteractor *wxVTKiren;
637 wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
638 wxVTKiren->GetEventPosition(X,Y);
640 std::map<int, GObjectController*>::iterator it;
642 bool clickOnObject = false;
644 for(it = _controllers.begin(); it != _controllers.end() && clickOnObject==false; ++it)
646 GObjectController *cont = it->second;
647 int type = cont->getGObjectType();
649 if(cont->getView()->isPointInside(X,Y))
653 for (int i=0; i<_selectedObjects.size(); i++)
655 int id = _selectedObjects[i];
656 GObjectController* control = _controllers[id];
657 control->getView()->setState(NOTHING_HAPPENS);
659 _selectedObjects.clear();
661 GBlackBoxModel *bbmodel = (GBlackBoxModel*)cont->getModel();
662 _parent->editBlackBox(bbmodel);
664 clickOnObject = true;
668 if(clickOnObject==false)
670 //_parent->editDiagramParameters(this);
676 //=========================================================================
678 bool wxVtkSceneManager::OnChar()
680 char keyCode = _vtkInteractorStyleBaseView->GetInteractor()-> GetKeyCode();
682 // KeyCode 127 : Delete Key
683 // KeyCode 8 : Backspace Key
684 if(keyCode == 8 || keyCode == 127)
686 if(_selectedObjects.size()>0)
688 for(int i=0;i<_selectedObjects.size();i++)
690 int id = _selectedObjects[i];
693 _selectedObjects.clear();
700 //=========================================================================
702 void wxVtkSceneManager::deleteObject(int id)
704 GObjectController *control = _controllers[id];
705 std::vector<int> controllersToRemove;
707 if(control->getGObjectType()==GBLACKBOX)
709 GBlackBoxModel *bbmod = (GBlackBoxModel*)control->getModel();
710 std::vector<GPortModel*> inputs = bbmod->getInputPorts();
712 bool boxConnected = false;
714 // Add box input controllers to be removed
715 for(int i = 0;i<inputs.size();i++)
717 controllersToRemove.push_back(inputs[i]->getObjectId());
718 if(inputs[i]->isConnected())
724 std::vector<GPortModel*> outputs = bbmod->getOutputPorts();
726 // Add box output controllers to be removed
727 for(int i = 0;i<outputs.size();i++)
729 controllersToRemove.push_back(outputs[i]->getObjectId());
730 if(outputs[i]->isConnected())
736 // Add connection controllers to be removed
737 std::map<int, GObjectController*>::iterator it;
738 for(it = _controllers.begin(); it != _controllers.end(); ++it)
740 GObjectController *cont = it->second;
741 int type = cont->getGObjectType();
744 GConnectorModel *conMod = (GConnectorModel*)cont->getModel();
745 if(conMod->getStartPort()!=NULL && conMod->getStartPort()->getParentBox()->getObjectId() == bbmod->getObjectId())
747 controllersToRemove.push_back(conMod->getObjectId());
749 if(conMod->getEndPort()!=NULL && conMod->getEndPort()->getParentBox()->getObjectId() == bbmod->getObjectId())
751 controllersToRemove.push_back(conMod->getObjectId());
756 // Add box controller to be removed
757 controllersToRemove.push_back(bbmod->getObjectId());
760 for(int i = 0;i<controllersToRemove.size();i++)
762 int id = controllersToRemove[i];
763 GObjectController *cont = _controllers[id];
764 cont->removeFromScene();
765 unregisterController((InteractorStyleMaracas*)cont);
766 _controllers.erase(id);
772 //=========================================================================
774 void wxVtkSceneManager::displayBlackBoxInfo(std::string packageName, std::string boxName)
776 _parent->displayBlackBoxInfo(packageName,boxName);
779 //=========================================================================
781 void wxVtkSceneManager::updateStatusBar(std::string textStatus)
783 _parent->updateStatusBar(textStatus);
786 //=========================================================================
788 std::string wxVtkSceneManager::getDiagramScript()
790 bool existsExec=false;
792 std::vector<std::string> packages;
793 std::vector<int> boxes;
794 std::vector<int> connections;
795 std::vector<int> execBoxes;
797 std::map<int, GObjectController*>::iterator it;
799 for(it = _controllers.begin(); it != _controllers.end(); ++it)
801 GObjectController *desc = it->second;
802 int type = desc->getGObjectType();
806 GBlackBoxModel *mod = (GBlackBoxModel*)desc->getModel();
808 std::string pkg = mod->getBBTKPackage();
809 bool existsPkg = false;
810 for(int t = 0;t<packages.size() && existsPkg == false;t++)
819 packages.push_back(pkg);
823 boxes.push_back(it->first);
824 if(mod->isExecutable())
826 execBoxes.push_back(it->first);
830 else if(type==GCONNECTOR)
832 connections.push_back(it->first);
836 std::string script = "";
837 script+="# BBTK GEditor Script\n";
838 script+="# ----------------------\n";
842 for(i = 0; i<packages.size();i++)
849 script+="include std\n";
851 for(i = 0; i<boxes.size();i++)
855 GObjectController *control = _controllers[id];
856 GBlackBoxModel *model = (GBlackBoxModel*)control->getModel();
858 script+=model->getBBTKType();
860 script+=model->getBBTKName();
863 std::vector<GPortModel*> inputs = model->getInputPorts();
864 for(int j = 0; j<inputs.size();j++)
866 GPortModel* inputPort = inputs[j];
867 if(inputPort->isValueSet())
870 script+=model->getBBTKName();
872 script+=inputPort->getBBTKName();
874 script+=inputPort->getValue();
881 for(i = 0; i<connections.size();i++)
884 int id = connections[i];
885 GObjectController *control = _controllers[id];
886 GConnectorModel *model = (GConnectorModel*)control->getModel();
888 //Start Connection info
889 GPortModel *start = model->getStartPort();
890 script+=start->getParentBox()->getBBTKName();
892 script+=start->getBBTKName();
896 //End Connection info
897 GPortModel *end = model->getEndPort();
898 script+=end->getParentBox()->getBBTKName();
900 script+=end->getBBTKName();
905 for(i = 0; i<execBoxes.size();i++)
908 int id = execBoxes[i];
909 GObjectController *control = _controllers[id];
910 GBlackBoxModel *model = (GBlackBoxModel*)control->getModel();
912 script+=model->getBBTKName();
921 //=========================================================================
923 void wxVtkSceneManager::deleteAllBoxes()
925 std::map<int, GObjectController*>::iterator it;
926 for(it = _controllers.begin(); it != _controllers.end(); ++it)
928 GObjectController *cont = it->second;
929 cont->removeFromScene();
930 unregisterController((InteractorStyleMaracas*)cont);
932 _selectedObjects.clear();
933 _controllers.clear();
937 //=========================================================================
939 void wxVtkSceneManager::refreshScene()
941 _baseView->RefreshView();
944 //=========================================================================
946 void wxVtkSceneManager::centerView()
949 _baseView->GetRenderer()->GetActiveCamera()->GetFocalPoint(temp);
950 _baseView->GetRenderer()->GetActiveCamera()->SetFocalPoint(0,0,temp[2]);
951 _baseView->GetRenderer()->GetActiveCamera()->GetPosition(temp);
952 _baseView->GetRenderer()->GetActiveCamera()->SetPosition(0,0,temp[2]);
953 _baseView->RefreshView();
957 //=========================================================================
959 } // EO namespace bbtk