]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx
#3057 bbGEditor Feature New Normal - optimizing of vtk actors management (input...
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsWxGUIEditorGraphic / wxVtkSceneManager.cxx
index 599a26214478143bcc477bcf45d5b0cb87c0f804..95a2454c22ff447cf2ec8b5e21ee29bede39abf0 100644 (file)
@@ -280,6 +280,7 @@ int wxVtkSceneManager::createGBlackBox(int x, int y, std::string packageName,std
 
 //EED 15 oct 2012      BlackBoxDescriptor::Pointer descriptor = GObjectsMVCFactory::getInstance()->getBlackBoxDescriptor(packageName, boxType);
        
+
        Package::Pointer k;
        std::map< std::string, BlackBoxDescriptor::Pointer> mapDesc;
        try{
@@ -332,7 +333,6 @@ int wxVtkSceneManager::createGBlackBox(int x, int y, std::string packageName,std
        std::map<std::string, BlackBoxInputDescriptor*> descriptorInMap =
                        descriptor->GetInputDescriptorMap();
        std::map<std::string, BlackBoxInputDescriptor*>::iterator itInput;
-
        int i = 0;
        for (itInput = descriptorInMap.begin(); itInput != descriptorInMap.end(); ++itInput) {
                BlackBoxInputDescriptor *desc = itInput->second;
@@ -344,7 +344,6 @@ int wxVtkSceneManager::createGBlackBox(int x, int y, std::string packageName,std
        std::map<std::string, BlackBoxOutputDescriptor*> descriptorOutMap =
                        descriptor->GetOutputDescriptorMap();
        std::map<std::string, BlackBoxOutputDescriptor*>::iterator itOutput;
-
        i = 0;
        for (itOutput = descriptorOutMap.begin(); itOutput
                        != descriptorOutMap.end(); ++itOutput) {
@@ -357,6 +356,7 @@ int wxVtkSceneManager::createGBlackBox(int x, int y, std::string packageName,std
        //(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
@@ -526,7 +526,11 @@ GPortController* wxVtkSceneManager::createGPort(int portType,std::string bbtkNam
        //(NOTE: Refresh is only made by the view)
        view->setModel(model);
        view->setBaseView(_baseView);
-       view->initVtkObjects();
+
+//EED017       view->initVtkObjects();
+       view->createVtkObjects();
+//  view->addVtkActors();
+
 
        //Associates the controller with the correspondent model and view
        controller->setModelAndView(model, view);
@@ -536,6 +540,7 @@ GPortController* wxVtkSceneManager::createGPort(int portType,std::string bbtkNam
        addObjectController(controller);
 
        return (GPortController*) controller;
+
 }
 
 //=========================================================================
@@ -570,7 +575,8 @@ int wxVtkSceneManager::createGConnector(GPortModel* startPort)
          * JGRR AND CM
          * Width increased from 2 to 3, it simplifies line handling and spline control :P
          * @param WidthLine  
-         */ 
+         */
+ //EED2017
         manContourView->SetWidthLine( 3 ) ;
        manContourView->SetShowText(false);
 
@@ -2182,7 +2188,8 @@ void wxVtkSceneManager::loadDiagram(stringstream &inputStream)
                std::istringstream is(result);
                is >> numBoxes;
 
-               for (int i = 0; i < numBoxes; i++) {
+               for (int i = 0; i < numBoxes; i++) 
+               {
                        //----------
                        getCleanLine(inputStream, line);//BOX
                        getCleanLine(inputStream, line);//package:type:name
@@ -2254,7 +2261,8 @@ void wxVtkSceneManager::loadDiagram(stringstream &inputStream)
                        
                        
                        bool boxExecutable = false;
-                       if (isExec == "TRUE") {
+                       if (isExec == "TRUE") 
+                       {
                                boxExecutable = true;
                        }
 
@@ -2311,7 +2319,8 @@ void wxVtkSceneManager::loadDiagram(stringstream &inputStream)
                isCons >> numConns;
                
                
-               for (int i = 0; i < numConns; i++) {
+               for (int i = 0; i < numConns; i++) 
+               {
                        //----------
                        getCleanLine(inputStream, line);//CONNECTION
                        getCleanLine(inputStream, line);//Startbox.PortName:EndBox.PortName
@@ -2327,7 +2336,6 @@ void wxVtkSceneManager::loadDiagram(stringstream &inputStream)
                        result = strtok(NULL, delims);
                        std::string nameEndPort(result);
 
-
                        int idCon = configGConnetion(nameStartBox, nameStartPort,nameEndBox, nameEndPort);
 
                        if (version != "1.0") {