]> Creatis software - bbtkGEditor.git/commitdiff
*** empty log message ***
authordavila <>
Sun, 5 Sep 2010 09:21:34 +0000 (09:21 +0000)
committerdavila <>
Sun, 5 Sep 2010 09:21:34 +0000 (09:21 +0000)
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx

index 0b97c8d07c933d3dcc6740989f4615531f33fc4c..83db82fb31b6627cd8b873d1d6a2d18197f4709f 100644 (file)
@@ -562,6 +562,7 @@ namespace bbtk
                wxFileDialog * openFileDialog = new wxFileDialog(this,wxT("Open diagram"),wxEmptyString,wxT(""),wxT("*.bbg"),wxOPEN|wxFILE_MUST_EXIST);
                if (openFileDialog->ShowModal() == wxID_OK)
                {
+printf("EED %p wxGUIEditorGraphicBBS::OnOpenDiagram 1\n", this);
                        wxString fileName = openFileDialog->GetPath();
                        
                        ifstream inputStream;
@@ -575,6 +576,7 @@ namespace bbtk
                        _tabsMgr->loadDiagram(inputStream);
                        
                        inputStream.close();
+printf("EED %p wxGUIEditorGraphicBBS::OnOpenDiagram 2\n", this);
                }
                refreshGUIControls();
        }
index dc1ad5a483bb4dc8c2fe8b3fb565e58dae90e615..dbd299cbb2adf6799062798f62901d476a52b4f5 100644 (file)
@@ -56,6 +56,7 @@ namespace bbtk
 //EED02JUIN2010        
                        printf ("RaC-EED 21-06-2010 %p wxVtkSceneManager::wxVtkSceneManager If you comment this line, the drag and drop functionnality is not initialized.\n" , this );
                        _baseView->GetWxVTKRenderWindowInteractor()->SetDropTarget((wxDropTarget*)parent);                      
+
                        configureBaseView();
                        _worldState=NOTHING_HAPPENS;
                        registerController(this);
@@ -109,23 +110,32 @@ namespace bbtk
 
        int wxVtkSceneManager::createGBlackBox(int x, int y, std::string packageName, std::string boxType)
        {
+printf("EED %p wxVtkSceneManager::createGBlackBox 1\n",this);
+
                _worldState = NOTHING_HAPPENS;
+printf("EED %p wxVtkSceneManager::createGBlackBox 1.1\n",this);
                int windowWidth=_baseView->GetRenWin()->GetSize()[0];
+printf("EED %p wxVtkSceneManager::createGBlackBox 1.2\n",this);
                int windowHeight=_baseView->GetRenWin()->GetSize()[1];
+printf("EED %p wxVtkSceneManager::createGBlackBox 1.3\n",this);
 
                int type = GBLACKBOX;
 
                //Create the MVC Objects
                
                GBlackBoxModel *model = (GBlackBoxModel*)GObjectsMVCFactory::getInstance()->createGObjectModel(type);
+printf("EED %p wxVtkSceneManager::createGBlackBox 1.4\n",this);
                vtkGObjectView *view = GObjectsMVCFactory::getInstance()->createGObjectView(type);
+printf("EED %p wxVtkSceneManager::createGBlackBox 1.5\n",this);
                GObjectController* controller = GObjectsMVCFactory::getInstance()->createGObjectController(type);
+printf("EED %p wxVtkSceneManager::createGBlackBox 1.6 >%s<  >%s<\n",this, packageName.c_str(), boxType.c_str() );
                
                BlackBoxDescriptor::Pointer descriptor = GObjectsMVCFactory::getInstance()->getBlackBoxDescriptor(packageName, boxType);
                
                //Prepares the initial model
                //The coordinates obtained are the following. Top-Left:x=0,y=0 Bottom-Right:x=width,y=height  
 
+printf("EED %p wxVtkSceneManager::createGBlackBox 2\n",this);
                double xx = x;
                double yy = windowHeight-y;
                
@@ -138,6 +148,7 @@ namespace bbtk
                _numBoxes++;
                std::stringstream stream;
                
+printf("EED %p wxVtkSceneManager::createGBlackBox 3\n",this);
                if(_numBoxes<10)
                {
                        stream << "Box0" << _numBoxes;
@@ -167,6 +178,7 @@ namespace bbtk
                        i++;
                }
 
+printf("EED %p wxVtkSceneManager::createGBlackBox 4\n",this);
                //Iterate and create the output ports
                std::map<std::string, BlackBoxOutputDescriptor*> descriptorOutMap = descriptor->GetOutputDescriptorMap();
                std::map<std::string, BlackBoxOutputDescriptor*>::iterator itOutput;
@@ -185,6 +197,7 @@ namespace bbtk
                view->setModel(model);
                view->setBaseView(_baseView);
                view->initVtkObjects();
+printf("EED %p wxVtkSceneManager::createGBlackBox 5\n",this);
                
                //Associates the controller with the correspondent model and view
                controller->setModelAndView(model,view);
@@ -193,6 +206,7 @@ namespace bbtk
                model->notifyObservers(_idManager);
                
                int newId = addObjectController(controller);
+printf("EED %p wxVtkSceneManager::createGBlackBox 6\n",this);
                return newId;
 
        }
@@ -1275,13 +1289,15 @@ namespace bbtk
        //=========================================================================
 
        void wxVtkSceneManager::saveDiagram(std::string &content)
-       {               
+       {
+printf("EED %p wxVtkSceneManager::saveDiagram 1\n",this);
                char buffer [50];
 
                //Print info IF COMPLEX BOX
                content+="COMPLEXBOX:";
                if(_isComplexBox)
                {
+printf("EED %p wxVtkSceneManager::saveDiagram 2\n",this);
                        content+="TRUE\n";
 
                        //Print info complex input ports
@@ -1313,7 +1329,7 @@ namespace bbtk
                                GObjectController *cont = _controllers[id];
                                cont->getModel()->save(content);
                        }
-               }
+               } // _isComplexBox
                else
                {
                        content+="FALSE\n";
@@ -1327,6 +1343,7 @@ namespace bbtk
                content+=buffer;
                content+="\n";
                
+printf("EED %p wxVtkSceneManager::saveDiagram 3\n",this);
                for(int i = 0;i<bsize;i++)
                {
                        int id = boxes[i];
@@ -1342,6 +1359,7 @@ namespace bbtk
                content+=buffer;
                content+="\n";
                
+printf("EED %p wxVtkSceneManager::saveDiagram 4\n",this);
                for(int i = 0;i<csize;i++)
                {
                        int id = connections[i];
@@ -1355,6 +1373,7 @@ namespace bbtk
 
        void wxVtkSceneManager::loadDiagram(ifstream &inputStream)
        {
+printf("EED %p wxVtkSceneManager::loadDiagram 1\n",this);
 
                std::string line="";    
                char delims[] = ":";
@@ -1370,6 +1389,7 @@ namespace bbtk
                        }
                        else if(line=="APP_START")
                        {
+printf("EED %p wxVtkSceneManager::loadDiagram 2\n",this);
                                start = true;
                                break;
                        }
@@ -1378,9 +1398,10 @@ namespace bbtk
                if(start)
                {
 
+printf("EED %p wxVtkSceneManager::loadDiagram 3\n",this);
                        //----------
                        getline(inputStream,line);//COMPLEX_BOX:TRUE|FALSE
-                       char complex[15];
+                       char complex[20];
                        strcpy( complex, line.c_str() );
                        result = strtok( complex, delims );
                        result = strtok( NULL, delims );
@@ -1388,6 +1409,7 @@ namespace bbtk
 
                        if(isComplexBox=="TRUE")
                        {
+printf("EED %p wxVtkSceneManager::loadDiagram 4\n",this);
                                _isComplexBox=true;
 
                                //-----------------------
@@ -1436,7 +1458,7 @@ namespace bbtk
                                        GBoxModel *cbmod = (GBoxModel*)cont->getModel();
                                        cbmod->setInicPoint(xIn,yIn,zIn);
                                        cbmod->notifyObservers(_idManager);
-                               }
+                               } // for input complex box
 
 
                                //-----------------------
@@ -1486,21 +1508,30 @@ namespace bbtk
                                        GBoxModel *cbmod = (GBoxModel*)cont->getModel();
                                        cbmod->setInicPoint(xIn,yIn,zIn);
                                        cbmod->notifyObservers(_idManager);
-                               }
+                               } // for output complex box
 
-                       }
+                       } // complex box
 
                        //----------
+printf("EED %p wxVtkSceneManager::loadDiagram 4.1\n",this);
                        getline(inputStream,line);//BOXES:num
+printf("EED %p wxVtkSceneManager::loadDiagram 4.2\n",this);
                        char boxes[9];
+printf("EED %p wxVtkSceneManager::loadDiagram 4.3\n",this);
                        strcpy( boxes, line.c_str() );
+printf("EED %p wxVtkSceneManager::loadDiagram 4.4\n",this);
                        result = strtok( boxes, delims );
+printf("EED %p wxVtkSceneManager::loadDiagram 4.5\n",this);
                        result = strtok( NULL, delims );
+printf("EED %p wxVtkSceneManager::loadDiagram 4.6\n",this);
                                        
                        int numBoxes;
+printf("EED %p wxVtkSceneManager::loadDiagram 4.7\n",this);
                        std::istringstream is(result);
+printf("EED %p wxVtkSceneManager::loadDiagram 4.8\n",this);
                        is >> numBoxes;
                        
+printf("EED %p wxVtkSceneManager::loadDiagram 5\n",this);
                        for(int i = 0;i<numBoxes;i++)
                        {
                                //----------
@@ -1540,6 +1571,7 @@ namespace bbtk
                                ySt >> yIn;
                                std::istringstream zSt(zInic);
                                zSt >> zIn;
+printf("EED %p wxVtkSceneManager::loadDiagram 6\n",this);
                                                
                                //----------
                                getline(inputStream,line);//xEnd:yEnd:zEnd
@@ -1550,6 +1582,7 @@ namespace bbtk
                                std::string yEnd(result);
                                result = strtok( NULL, delims );//zEnd
                                std::string zEnd(result);
+printf("EED %p wxVtkSceneManager::loadDiagram 6.1\n",this);
 
                                double xEn, yEn, zEn;
                                std::istringstream xEt(xEnd);
@@ -1559,12 +1592,19 @@ namespace bbtk
                                std::istringstream zEt(zEnd);
                                zEt >> zEn;
 
+printf("EED %p wxVtkSceneManager::loadDiagram 6.2\n",this);
                                int idBox = createGBlackBox(0,0,package,type);
+printf("EED %p wxVtkSceneManager::loadDiagram 6.2\n",this);
                                GObjectController *cont = _controllers[idBox];
+printf("EED %p wxVtkSceneManager::loadDiagram 6.2\n",this);
                                GBlackBoxModel *bbmod = (GBlackBoxModel*)cont->getModel();
+printf("EED %p wxVtkSceneManager::loadDiagram 6.2\n",this);
                                bbmod->setBBTKName(name);
+printf("EED %p wxVtkSceneManager::loadDiagram 6.2\n",this);
                                bbmod->setInicPoint(xIn,yIn,zIn);
+printf("EED %p wxVtkSceneManager::loadDiagram 6.2\n",this);
                                bbmod->setFinalPoint(xEn,yEn,zEn);
+printf("EED %p wxVtkSceneManager::loadDiagram 6.2\n",this);
                                if(isExec=="TRUE")
                                {
                                        bbmod->setExecutable(true);
@@ -1579,6 +1619,7 @@ namespace bbtk
                                std::string port=line.substr(0,4);
                                while(port=="PORT")
                                {
+printf("EED %p wxVtkSceneManager::loadDiagram 7\n",this);
                                        getline(inputStream,line);//name:value
                                        char poort[20];
                                        strcpy( poort, line.c_str() );
@@ -1591,15 +1632,15 @@ namespace bbtk
 
                                        getline(inputStream,line);//PORT o FIN_BOX
                                        port=line.substr(0,4);
-                               }               
+                               } // while              
 
                                bbmod->notifyObservers(_idManager);
-                       }
+                       } // boxes
 
                        /// CONNECTIONS
                        //----------
                        getline(inputStream,line);//CONNECTIONS:num
-                       char conns[15];
+                       char conns[20];
                        strcpy( conns, line.c_str() );
                        result = strtok( conns, delims );
                        result = strtok( NULL, delims );
@@ -1608,8 +1649,10 @@ namespace bbtk
                        std::istringstream isCons(result);
                        isCons >> numConns;
                                        
+printf("EED %p wxVtkSceneManager::loadDiagram 8\n",this);
                        for(int i = 0;i<numConns;i++)
                        {
+printf("EED %p wxVtkSceneManager::loadDiagram 9\n",this);
                                //----------
                                getline(inputStream,line);//CONNECTION
                                getline(inputStream,line);//Startbox.PortName:EndBox.PortName
@@ -1641,7 +1684,7 @@ namespace bbtk
                                        {
                                                endP = bbMod->getInputPort(nameEndPort);
                                        }
-                               }
+                               } // for
 
                                if(_isComplexBox)
                                {
@@ -1672,7 +1715,7 @@ namespace bbtk
                                                        }
                                                }
                                        }
-                               }
+                               } // complex box
                                                                
                                int idCon = createGConnector(startP);
                                _worldState = NOTHING_HAPPENS;
@@ -1684,8 +1727,9 @@ namespace bbtk
                                conMod->setEndPort(endP);                                       
                                conView->updateStartEndPoints();
 
-                       }
-        }
+                       } // for numConns
+        } // start
+printf("EED %p wxVtkSceneManager::loadDiagram 10\n",this);
 
        }