]> Creatis software - bbtkGEditor.git/commitdiff
v1.1.0 BUG 1400
authordavila <>
Sun, 3 Jun 2012 11:38:10 +0000 (11:38 +0000)
committerdavila <>
Sun, 3 Jun 2012 11:38:10 +0000 (11:38 +0000)
 - New version of file bbg bbs  v1.2 -> 1.3
 - New position of the graphical objects  -900
 - Reconfiguration of the camera BoxRenderRegion

16 files changed:
doc/UserDoxygen/DoxyMainPage.txt.in
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GConnectorModel.cxx
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.cxx
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GPortModel.cxx
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GlobalConstants.h
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GConnectorController.cxx
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/manualConnectorContourController.cxx
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGBlackBoxView.cxx
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGBoxView.cxx
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGComplexBoxPortView.cxx
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGObjectView.cxx
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGPortView.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/InterpreterBBS.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx

index 94c4c710011ea2337b41e4ac6aa1689c7c827192..87c756609b80f610c2e9e8bdc09b83d17946f0d0 100644 (file)
@@ -1,13 +1,10 @@
 /**
- * \mainpage bbtk documentation
+ * \mainpage bbtkGEditor documentation
 
 \htmlonly 
 
 "A black box is any system in which only the input and output characteristics are of interest - without regard to its internal mechanism or structure" (from <A href="http://en.wikipedia.org/wiki/Black_box_%28disambiguation%29" > wikipedia </A>)
 
-<li> 
-<A href="../CodingStyle.html"> Coding Style </A>
-</li>
 
 \endhtmlonly
 
index 2956f0dc383fc7ea07a17502f2a1d53488e839be..7be647f13f8797d20cb12d80de3a43e72434d3f6 100644 (file)
@@ -136,6 +136,7 @@ namespace bbtk
                // Refresh the position of the contourModel last point with the data of the connector model
                point = _model->GetManualPoint(_model->GetSizeLstPoints()-1);
                point->SetPoint(xCenter,yport,zCenter);
+               
        }
 
        //=========================================================================
index 41148af3db9acf02bf04752c096cc48da3e8fb31..386663f75b2f3b04e3e3ad05f3f03e9b5c958111 100644 (file)
@@ -46,10 +46,10 @@ namespace bbtk
 
                _xInic = 0;
                _yInic = 0;
-               _zInic = 900;
+               _zInic = GPOSITION_Z;
                _xFin = 0;
                _yFin = 0;
-               _zFin = 900;
+               _zFin = GPOSITION_Z;
        }
 
        //=========================================================================
index 5e307213c78ce2599e5a5b88bf38c9a1ad828528..2ca30ba2c5d4fc8f843b7c3e74b34df7bbf6698a 100644 (file)
@@ -46,12 +46,12 @@ namespace bbtk {
     //=========================================================================
 
     GPortModel::GPortModel( ) {
-        _parentBox = NULL ;
-        _portType = -1 ;
-        _posInBox = 0 ;
-        _isConnected = false ;
-        _value = "" ;
-        _isValueSet = false ;
+        _parentBox             = NULL ;
+        _portType              = -1 ;
+        _posInBox              = 0 ;
+        _isConnected   = false ;
+        _value                 = "" ;
+        _isValueSet            = false ;
     }
 
     //=========================================================================
@@ -61,12 +61,10 @@ namespace bbtk {
     //=========================================================================
 
     void GPortModel::registerInBox( GBoxModel *blackBox , int portType , int pos ) {
-        _parentBox = blackBox ;
-        _portType = portType ;
-        _posInBox = pos ;
-
+        _parentBox     = blackBox ;
+        _portType      = portType ;
+        _posInBox      = pos ;
         updatePortPosition( ) ;
-
     }
 
     //=========================================================================
@@ -127,7 +125,7 @@ namespace bbtk {
     //=========================================================================
 
     GBoxModel* GPortModel::getParentBox( ) {
-        return _parentBox ;
+        return _parentBox;
     }
 
     //=========================================================================
index d9c3742d91c86a1bef30e28c5308a95828a6a644..2cd1106b5c52ed706685b3b694e2f8f0192548ff 100644 (file)
@@ -49,6 +49,8 @@ namespace bbtk {
        const int GCOMPLEXINPUTPORT                     =       6;
        const int GCOMPLEXOUTPUTPORT            =       7;
 
+       const double GPOSITION_Z                        =       -900;
+       
        // Object states
        
        // JGRR
index 40a1a343548494603465d32d5e1a6575e8304c2e..924bd62fccad1a0204434ed2ff24203097e2b238 100644 (file)
@@ -166,7 +166,7 @@ namespace bbtk
        {
                if ( _vtkInteractorStyleBaseView!=NULL )
                {
-                       int X,Y,Z=900;
+                       int X, Y, Z=GPOSITION_Z;
                        wxVTKRenderWindowInteractor *wxVTKiren;
                        wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
                        wxVTKiren->GetEventPosition(X, Y);
index bc02755b508876a5ef62dbfedd2d30319617e943..1fb59cf3888a3bd1063c24d98aabe774e1920bab 100644 (file)
@@ -57,9 +57,6 @@ namespace bbtk
        {
                
                int z=GetZ();
-                               
-               printf("EED MACHETE con int z=-GetZ(); en manualConnectorContourController::MouseMove z=%d\n", z );
-               z=-z;
                
                GetManualViewBaseContour()->SelectPosiblePoint(x,y,z);
                GetManualViewBaseContour()->SelectPosibleContour(x,y,z);
@@ -102,27 +99,10 @@ namespace bbtk
        {
 
                bool ok = false;
-               int z   = -GetZ();
+               int z=GetZ();
                int size= GetManualViewBaseContour()->GetNumberOfPoints();
 
                
-               printf("\nEED manualConnectorContourController::MouseClickLeft   z=%d   estado=%d\n", z,GetState());
-               if (IsEditable())
-               {
-                       printf(" Editable\n");
-               } else          {
-                       printf(" NO Editable\n");
-               }
-               
-                
-               if (GetManualViewBaseContour()->GetPosibleSelected())
-               {
-                       printf(" PosibleSelected\n");
-               } else          {
-                       printf(" NO PosibleSelected\n");
-               }
-               
-               
                // Insert a Control Point with shift+ClickLeft
                vtkRenderWindowInteractor *vtkrenderwindowinteractor = _vtkInteractorStyleBaseView->GetInteractor();
                if( IsEditable() )
index 97c2605f7bbaefc5739dfe1e9bd53ccfdf5d1471..954f6811ea41699b1ff7ecafab3f5fbaba35b2e6 100644 (file)
@@ -98,7 +98,7 @@ namespace bbtk
         update_X_Fin();
                _model->getFinalPoint(xFin, yFin,zFin);
 
-               // RaC In the actual version, zInic=zFin=900
+               // RaC In the actual version, zInic=zFin=GPOSITION_Z
 
                _pts->SetPoint(0, xInic, yInic, zInic );
                _pts->SetPoint(1, xInic, yFin, zInic );
@@ -133,7 +133,7 @@ namespace bbtk
                _model->getInicPoint(xInic,yInic,zInic);
                _model->getFinalPoint(xFin, yFin,zFin);
 
-               // RaC In the actual version, zInic=zFin=900
+               // RaC In the actual version, zInic=zFin=GPOSITION_Z
 
 //EED          _pts->SetPoint(0, xInic, yInic, zInic );
 //EED          _pts->SetPoint(1, xInic, yFin, zInic );
@@ -169,7 +169,7 @@ namespace bbtk
                _fillPolyMapper         = vtkPolyDataMapper::New();
                _fillObjectActor        = vtkActor::New();
 
-               // RaC In the actual version, zInic=zFin=900
+               // RaC In the actual version, zInic=zFin=GPOSITION_Z
 
                strip->InsertNextCell(5);
                strip->InsertCellPoint(0);
index b95f204bf43278e3ef8f5b27ecd1a8dd8921bf1f..4ea328597c09e598c4362cbff7b9a56072dfebd2 100644 (file)
@@ -59,7 +59,7 @@ namespace bbtk
                _model->getInicPoint(xInic,yInic,zInic);
                _model->getFinalPoint(xFin, yFin,zFin);
 
-               // RaC In the actual version, zInic=zFin=900
+               // RaC In the actual version, zInic=zFin=GPOSITION_Z
 
                _pts->SetPoint(0, xInic, yInic, zInic );
                _pts->SetPoint(1, xInic, yFin, zInic );
@@ -94,7 +94,7 @@ namespace bbtk
                _model->getInicPoint(xInic,yInic,zInic);
                _model->getFinalPoint(xFin, yFin,zFin);
 
-               // RaC In the actual version, zInic=zFin=900
+               // RaC In the actual version, zInic=zFin=GPOSITION_Z
 
 //EED          _pts->SetPoint(0, xInic, yInic, zInic );
 //EED          _pts->SetPoint(1, xInic, yFin, zInic );
@@ -130,7 +130,7 @@ namespace bbtk
                _fillPolyMapper                 = vtkPolyDataMapper::New();
                _fillObjectActor                = vtkActor::New();
 
-               // RaC In the actual version, zInic=zFin=900
+               // RaC In the actual version, zInic=zFin=GPOSITION_Z
 
                strip->InsertNextCell(5);
                strip->InsertCellPoint(0);
index d9fd4572fe89b7dd927a990dce3c265245434e7a..37613747b0fc5fa9c26e93f746e167fdc1b5ef57 100644 (file)
@@ -58,7 +58,7 @@ namespace bbtk {
         _model->getInicPoint( xInic , yInic , zInic ) ;
         _model->getFinalPoint( xFin , yFin , zFin ) ;
 
-        // RaC In the actual version, zInic=zFin=900
+        // RaC In the actual version, zInic=zFin=GPOSITION_Z
 
         _pts->SetPoint( 0 , xInic , yInic , zInic ) ;
         _pts->SetPoint( 1 , xInic , yFin , zInic ) ;
@@ -93,7 +93,7 @@ namespace bbtk {
         _model->getInicPoint( xInic , yInic , zInic ) ;
         _model->getFinalPoint( xFin , yFin , zFin ) ;
 
-        // RaC In the actual version, zInic=zFin=900
+        // RaC In the actual version, zInic=zFin=GPOSITION_Z
 
         //EED          _pts->SetPoint(0, xInic, yInic, zInic );
         //EED          _pts->SetPoint(1, xInic, yFin, zInic );
@@ -129,7 +129,7 @@ namespace bbtk {
         _fillPolyMapper = vtkPolyDataMapper::New( ) ;
         _fillObjectActor = vtkActor::New( ) ;
 
-        // RaC In the actual version, zInic=zFin=900
+        // RaC In the actual version, zInic=zFin=GPOSITION_Z
 
         strip->InsertNextCell( 5 ) ;
         strip->InsertCellPoint( 0 ) ;
index 2466e2c62253a65f2e499cab03759ad4b806e405..405e5fe1265b3c6aaacb08db56cd5dd72aa7680e 100644 (file)
@@ -118,8 +118,8 @@ namespace bbtk
 
        bool vtkGObjectView::isPointInside(int X,int Y) //virtual
        {
-               // RaC In the actual version, always z=900
-               double xx=X,yy=Y,zz=900;
+               // RaC In the actual version, always z=GPOSITION_Z
+               double xx=X,yy=Y,zz=GPOSITION_Z;
                _baseView->TransCoordScreenToWorld(xx,yy,zz);
                return _model->isPointInside(xx,yy,zz);
        }
@@ -128,8 +128,8 @@ namespace bbtk
 
        void vtkGObjectView::moveObject(int X,int Y) //virtual
        {               
-               // RaC In the actual version, always z=900
-               double xx=X,yy=Y,zz=900;
+               // RaC In the actual version, always z=GPOSITION_Z
+               double xx=X,yy=Y,zz=GPOSITION_Z;
                _baseView->TransCoordScreenToWorld(xx,yy,zz);
 
                if(_isStartDragging)
index ba9a3d2ed2a0b37aebf64db9b081de64784a9d27..5cd33e0c081f08b1be0d49c45a5918bf49e22f0b 100644 (file)
@@ -60,7 +60,7 @@ namespace bbtk {
         _model->getInicPoint( xInic , yInic , zInic ) ;
         _model->getFinalPoint( xFin , yFin , zFin ) ;
 
-        // RaC In the actual version, zInic=zFin=900
+        // RaC In the actual version, zInic=zFin=GPOSITION_Z
 
         double mid = ( xInic + xFin ) / 2 ;
 
@@ -86,7 +86,7 @@ namespace bbtk {
         _model->getInicPoint( xInic , yInic , zInic ) ;
         _model->getFinalPoint( xFin , yFin , zFin ) ;
 
-        // RaC In the actual version, zInic=zFin=900
+        // RaC In the actual version, zInic=zFin=GPOSITION_Z
 
         double mid = ( xInic + xFin ) / 2 ;
 
@@ -106,7 +106,7 @@ namespace bbtk {
         _fillPolyMapper = vtkPolyDataMapper::New( ) ;
         _fillObjectActor = vtkActor::New( ) ;
 
-        // RaC In the actual version, zInic=zFin=900
+        // RaC In the actual version, zInic=zFin=GPOSITION_Z
 
         strip->InsertNextCell( 3 ) ;
         strip->InsertCellPoint( 0 ) ;
index 3bd1dcf6eeb4cbeca5419b6cac9cdbf1cd7c6100..e68430fab46c5f9659b20d7b8906da4afcbf10fe 100644 (file)
@@ -61,8 +61,7 @@ namespace bbtk
 
                _xGeneral               = -100;
                _yGeneral               = 100;
-               _zGeneral               = 900;   //  ?????
-printf("EED  InterpreterBBS::createGBlackBox 900-450\n");
+               _zGeneral               = GPOSITION_Z;   //  ?????
 
                _countBoxes             = 0;
                _countInputs    = 0;
@@ -114,7 +113,7 @@ printf("EED  InterpreterBBS::createGBlackBox 900-450\n");
        {
                double xIn      = -100+50+_countInputs*50;
                double yIn      = 100;
-               double zIn      = 900;
+               double zIn      = GPOSITION_Z;
                _sceneManager->configGComBoxInputOutputPort(true,name,xIn,yIn,zIn);
                _sceneManager->configGConnetion( name,name,box,input);
                _countInputs++;
@@ -129,7 +128,7 @@ printf("EED  InterpreterBBS::createGBlackBox 900-450\n");
                _yGeneral       = _yGeneral - 30;
                double xIn      = -100+_countOutputs*30;
                double yIn      = _yGeneral;
-               double zIn      = 900;
+               double zIn      = GPOSITION_Z;
                _sceneManager->configGComBoxInputOutputPort(false,name,xIn,yIn,zIn);
                _sceneManager->configGConnetion( box,output,name,name);
                _countOutputs++;
index eeb3afced317a52b9aed8cc4608850f5598873fa..73a0a9c14f903b70c28d9c72b51ed2ec59db5bb6 100644 (file)
@@ -577,7 +577,7 @@ void wxGUIEditorGraphicBBS::SaveActualBBS(std::string filename) {
        std::string content = "";
        // writing file header
        content += "# ----------------------------------\n";
-       content += "# - BBTKGEditor v 1.2 BBS BlackBox Script\n";
+       content += "# - BBTKGEditor v 1.3 BBS BlackBox Script\n";
        content += "# - ";
        content += filename;
        content += "\n";
@@ -637,7 +637,7 @@ void wxGUIEditorGraphicBBS::SaveActualComplexBox(std::string filename) {
 
        // writing file header
        content += "# ----------------------------------\n";
-       content += "# - BBTKGEditor v 1.2 BBS BlackBox Script (Complex Box)\n";
+       content += "# - BBTKGEditor v 1.3 BBS BlackBox Script (Complex Box)\n";
        content += "# - ";
        content += filename;
        content += "\n";
@@ -672,7 +672,7 @@ void wxGUIEditorGraphicBBS::SaveActualDiagram(std::string filename) {
 
        // writing file header
        content += "# ----------------------------------\n";
-       content += "# - BBTKGEditor v 1.2 BBG BlackBox Diagram file\n";
+       content += "# - BBTKGEditor v 1.3 BBG BlackBox Diagram file\n";
        content += "# - ";
 
        content += filename;
index b37e67d4b6b35cf0c13f3d04dd7c9b1d8485008e..0a7261beb6f51dacf2b3646e425e71af4ab6f638 100644 (file)
@@ -195,7 +195,7 @@ printf("EED wxGEditorTabPanel::initWxVtkCanvas 1\n");
                std::string content = "";
                // writing file header
                content += "# ----------------------------------\n";
-               content += "# - BBTKGEditor v 1.2 BBG BlackBox Diagram file\n";
+               content += "# - BBTKGEditor v 1.3 BBG BlackBox Diagram file\n";
                content += "# - ";
                content += "temp";
                content += "\n";
index dc5545af9ba4652599f22fd17aa1b2209c125b68..7d9da52b1a58b8aa451c7d207c9eba772fcfc9fb 100644 (file)
@@ -110,14 +110,16 @@ void wxVtkSceneManager::configureBaseView() {
        interactorstylebaseview->SetwxVtkBaseView(_baseView);
 
        _baseView->GetRenderer()->GetActiveCamera()->ParallelProjectionOn();
-       _baseView->GetRenderer()->ResetCamera(-100, 100, -100, 100, 800, 1100);
+       _baseView->GetRenderer()->ResetCamera(-100, 100, -100, 100, -1000, 1000);
+       _baseView->GetRenderer()->GetActiveCamera()->Zoom(10);
+
 
        _baseView->GetRenderer()->SetBackground(0.9, 0.9, 0.9);
        _baseView->GetRenderer()->GradientBackgroundOn();
 
        // Actos Port_Text
        _textActor = vtkTextActor3D::New();
-       _textActor->SetPosition(-9999, -9999, 900);
+       _textActor->SetPosition(-9999, -9999, GPOSITION_Z);
        _textActor->SetInput("<void>");
        _textActor->GetTextProperty()->SetFontSize(60);
        _textActor->GetTextProperty()->BoldOn();
@@ -131,7 +133,7 @@ void wxVtkSceneManager::configureBaseView() {
        //------------
        double xInic = 0;
        double yInic = 0;
-       double zInic = 900;
+       double zInic = GPOSITION_Z;
 
        vtkPolygon *aPolygon = vtkPolygon::New();
        _fillObjectActor = vtkActor::New();
@@ -262,7 +264,7 @@ int wxVtkSceneManager::createGBlackBox(int x, int y, std::string packageName,
        double yy = windowHeight - y;
 
        //z value is not important yet, because it is only used a parallel projection
-       double zz = 900;
+       double zz = GPOSITION_Z;
        _baseView->TransCoordScreenToWorld(xx, yy, zz);
        model->setInicPoint(xx, yy, zz);
 
@@ -350,8 +352,7 @@ int wxVtkSceneManager::createGComplexBoxInputPort(std::string inputName) {
        double yy = windowHeight - 5;
 
        //z value is not important yet, because it is only used a parallel projection
-       double zz = 900;
-       printf("EED  wxVtkSceneManager::createGComplexBoxInputPort 900-450\n");
+       double zz = GPOSITION_Z;
 
        _baseView->TransCoordScreenToWorld(xx, yy, zz);
        model->setInicPoint(xx, yy, zz);
@@ -409,9 +410,7 @@ int wxVtkSceneManager::createGComplexBoxOutputPort(std::string outputName) {
        double yy = windowHeight - 5;
 
        //z value is not important yet, because it is only used a parallel projection
-       double zz = 900;
-
-       printf("EED  wxVtkSceneManager::createGComplexBoxOutputPort 900-450\n");
+       double zz = GPOSITION_Z;
 
        _baseView->TransCoordScreenToWorld(xx, yy, zz);
        model->setInicPoint(xx, yy, zz);
@@ -510,15 +509,12 @@ GPortController* wxVtkSceneManager::createGPort(int portType,
 int wxVtkSceneManager::createGConnector(GPortModel* startPort) {
        int type = GCONNECTOR;
 
-       manualConnectorContourController* manContourControl =
-                       new manualConnectorContourController();
-       manualConnectorContourView* manContourView =
-                       new manualConnectorContourView();
-       manualContourModel* manContourModel = new manualContourModel();
-
-       GConnectorController* connectorcontroller = new GConnectorController();
-       GConnectorModel* connectorModel = new GConnectorModel();
-       vtkGConnectorView* connectorView = new vtkGConnectorView();
+       manualConnectorContourController        *manContourControl              = new manualConnectorContourController();
+       manualConnectorContourView                      *manContourView                 = new manualConnectorContourView();
+       manualContourModel                                      *manContourModel                = new manualContourModel();
+       GConnectorController                            *connectorcontroller    = new GConnectorController();
+       GConnectorModel                                         *connectorModel                 = new GConnectorModel();
+       vtkGConnectorView                                       *connectorView                  = new vtkGConnectorView();
        connectorModel->setGObjectType(type);
 
        manContourModel->SetCloseContour(false);
@@ -527,7 +523,7 @@ int wxVtkSceneManager::createGConnector(GPortModel* startPort) {
        manContourView->SetModel(manContourModel);
        manContourView->SetWxVtkBaseView(_baseView);
        manContourView->SetRange(0.5);
-       manContourView->SetZ(900);
+       manContourView->SetZ(GPOSITION_Z);
 
        manContourView->SetColorNormalContour(0, 0, 1);
        manContourView->SetColorEditContour(0.5, 0.5, 0.5);
@@ -535,7 +531,7 @@ int wxVtkSceneManager::createGConnector(GPortModel* startPort) {
         
         /**
          * JGRR AND CM
-         * Width increased from 2 to 5, it simplifies line handling and spline control :P
+         * Width increased from 2 to 3, it simplifies line handling and spline control :P
          * @param WidthLine  
          */ 
         manContourView->SetWidthLine( 3 ) ;
@@ -548,7 +544,8 @@ int wxVtkSceneManager::createGConnector(GPortModel* startPort) {
 
        double x, y, z;
        connectorModel->getInicPoint(x, y, z);
-
+       
+       
        manContourControl->SetState(1);
        manContourModel->SetCloseContour(false);
 
@@ -576,7 +573,8 @@ int wxVtkSceneManager::createGConnector(GPortModel* startPort) {
        connectorModel->addObserver(connectorView);
        connectorModel->addObserver(this);
 
-        manContourView->Refresh();
+//     manContourView->Refresh();
+       
        return newId;
 }
 
@@ -629,26 +627,9 @@ void wxVtkSceneManager::update(int idController, int command) {
 
        if (command != NO_COMMAND) {
                if (command == ADD_TO_SELECTED) {
-                       //EEDBorrame                            GObjectController* cont = _controllers[idController];
-
                        if (GetIndexInSelected(idController) == -1) {
                                _selectedObjects.push_back(idController);
                        }
-
-                       //EEDBorrame
-                       //                              bool foundID=false;
-                       //                              for (int i=0; i<(int)_selectedObjects.size() && foundID==false; i++)
-                       //                              {
-                       //                                      if(_selectedObjects[i]==idController)
-                       //                                      {
-                       //                                              foundID = true;
-                       //                                      }
-                       //                              }
-                       //                              if(!foundID)
-                       //                              {
-                       //                                      _selectedObjects.push_back(idController);
-                       //                              }
-
                } else if (command == REMOVE_FROM_SELECTED) {
                        int index = GetIndexInSelected(idController);
                        if (index >= 0) {
@@ -688,8 +669,8 @@ void wxVtkSceneManager::update(int idController, int command) {
 
                 // EO JGRR & CM WH  
                      
-                        _worldState = INIT_CREATION_CONTOUR;
-                       GObjectController* cont = _controllers[idController];
+                       _worldState                                     = INIT_CREATION_CONTOUR;
+                       GObjectController* cont         = _controllers[idController];
                        GPortModel* startOutputPort = (GPortModel*) cont->getModel();
 
                        // The last one is the controller of the connector
@@ -714,13 +695,12 @@ void wxVtkSceneManager::update(int idController, int command) {
                        }
                        _selectedObjects.clear();
                        _idConnectionInCreation = createGConnector(startOutputPort);
-               } else if (command == FIN_CREATION_CONTOUR && _worldState
-                               == INIT_CREATION_CONTOUR) {
+               } else if (command == FIN_CREATION_CONTOUR && _worldState == INIT_CREATION_CONTOUR) {
                        _worldState = NOTHING_HAPPENS;
                        //int id = _controllers.size()-1;
-                       GObjectController *cont = _controllers[_idConnectionInCreation];
-                       GConnectorModel *modelContour = (GConnectorModel*) cont->getModel();
-                       GObjectController *finPort = _controllers[idController];
+                       GObjectController       *cont                   = _controllers[_idConnectionInCreation];
+                       GConnectorModel         *modelContour   = (GConnectorModel*) cont->getModel();
+                       GObjectController       *finPort                = _controllers[idController];
 
                        if (finPort->getGObjectType() == GPORT) {
                                GPortModel* modelPort = (GPortModel*) finPort->getModel();
@@ -752,12 +732,8 @@ void wxVtkSceneManager::update(int idController, int command) {
                                                                _parent->saveTempandUpdate("create connection");
                        }
 
-                       manualConnectorContourController
-                                       * manCont =
-                                                       ((GConnectorController*) cont)->getManualContourController();
-                       manualConnectorContourView
-                                       * connView =
-                                                       (manualConnectorContourView*) manCont->GetManualViewBaseContour();
+                       manualConnectorContourController        *manCont        = ((GConnectorController*) cont)->getManualContourController();
+                       manualConnectorContourView                      *connView       = (manualConnectorContourView*) manCont->GetManualViewBaseContour();
                                      
                        std::map<int, GObjectController*>::iterator it2;
 
@@ -769,7 +745,7 @@ void wxVtkSceneManager::update(int idController, int command) {
                                }
                                cont->SetActive(true);
                        }
-                        connView->Refresh();          
+                       connView->Refresh();          
                }
 
        }
@@ -780,11 +756,10 @@ void wxVtkSceneManager::update(int idController, int command) {
 
 bool wxVtkSceneManager::OnMouseMove() {
        int X, Y;
-       bool okStatusMessage = false;
-       bool okPortMessage = false;
+       bool okStatusMessage    = false;
+       bool okPortMessage              = false;
        wxVTKRenderWindowInteractor *wxVTKiren;
-       wxVTKiren
-                       = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
+       wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
        wxVTKiren->GetEventPosition(X, Y);
 
        if (_worldState == DRAG_OBJECTS) {
@@ -811,14 +786,13 @@ bool wxVtkSceneManager::OnMouseMove() {
 
                _startDragging = false;
 
-       } else if (_worldState == NOTHING_HAPPENS || _worldState
-                       == INIT_CREATION_CONTOUR) {
+       } else if (_worldState == NOTHING_HAPPENS || _worldState == INIT_CREATION_CONTOUR) {
                std::map<int, GObjectController*>::iterator it;
                double px, py, pz;
                for (it = _controllers.begin(); it != _controllers.end(); ++it) {
                        GObjectController *desc = it->second;
-                       int type = desc->getGObjectType();
-                       int state = desc->getView()->getState();
+                       int type        = desc->getGObjectType();
+                       int state       = desc->getView()->getState();
                        desc->getModel()->getCenter(px, py, pz);
 
                         // JGRR & CM
@@ -897,14 +871,12 @@ bool wxVtkSceneManager::OnLeftButtonDown() {
 
        } else { //_worldState
 
-               _worldState = DRAG_OBJECTS;
-               _startDragging = true;
+               _worldState             = DRAG_OBJECTS;
+               _startDragging  = true;
 
-               int shiftkey =
-                               _vtkInteractorStyleBaseView->GetInteractor()->GetShiftKey();
-               int ctrlkey =
-                               _vtkInteractorStyleBaseView->GetInteractor()->GetControlKey();
-               ctrlkey = ctrlkey + shiftkey;
+               int shiftkey    = _vtkInteractorStyleBaseView->GetInteractor()->GetShiftKey();
+               int ctrlkey             = _vtkInteractorStyleBaseView->GetInteractor()->GetControlKey();
+               ctrlkey                 = ctrlkey + shiftkey;
 
                GObjectController *cont = GetGBlackBoxControlerPointedByMouse();
 
@@ -1180,17 +1152,13 @@ void wxVtkSceneManager::deleteObject(int id) {
                        int type = cont->getGObjectType();
                        if (type == GCONNECTOR) {
                                GConnectorModel *conMod = (GConnectorModel*) cont->getModel();
-                               if (conMod->getStartPort() != NULL
-                                               && conMod->getStartPort()->getParentBox()->getObjectId()
-                                                               == bbmod->getObjectId()) {
-                                       AddControlerToBeRemove(&controllersToRemove,
-                                                       conMod->getObjectId());
+                               if (conMod->getStartPort() != NULL && conMod->getStartPort()->getParentBox()->getObjectId() == bbmod->getObjectId()) 
+                               {
+                                       AddControlerToBeRemove(&controllersToRemove,conMod->getObjectId());
                                }
-                               if (conMod->getEndPort() != NULL
-                                               && conMod->getEndPort()->getParentBox()->getObjectId()
-                                                               == bbmod->getObjectId()) {
-                                       AddControlerToBeRemove(&controllersToRemove,
-                                                       conMod->getObjectId());
+                               if (conMod->getEndPort() != NULL && conMod->getEndPort()->getParentBox()->getObjectId() == bbmod->getObjectId()) 
+                               {
+                                       AddControlerToBeRemove(&controllersToRemove,conMod->getObjectId());
                                }
                        }
                }
@@ -1771,6 +1739,9 @@ void wxVtkSceneManager::loadDiagram(stringstream &inputStream) {
                        if (line == "# - BBTKGEditor v 1.2 BBG BlackBox Diagram file") {
                                version = line.substr(18, 3);
                        }
+                       if (line == "# - BBTKGEditor v 1.3 BBG BlackBox Diagram file") {
+                               version = line.substr(18, 3);
+                       }
                } else if (line == "APP_START") {
                        start = true;
                        break;
@@ -1869,6 +1840,11 @@ void wxVtkSceneManager::loadDiagram(stringstream &inputStream) {
                                std::istringstream zSt(zInic);
                                zSt >> zIn;
 
+                               if (version<="1.2")
+                               {
+                                       if (zIn==900) zIn=GPOSITION_Z;
+                               }
+                               
                                getline(inputStream, line);//FIN_COMPLEX_PORT
 
                                configGComBoxInputOutputPort(true, inputPortName, xIn, yIn, zIn);
@@ -1915,10 +1891,14 @@ void wxVtkSceneManager::loadDiagram(stringstream &inputStream) {
                                std::istringstream zSt(zInic);
                                zSt >> zIn;
 
+                               if (version<="1.2")
+                               {
+                                       if (zIn==900) zIn=GPOSITION_Z;
+                               }
+                               
                                getline(inputStream, line);//FIN_COMPLEX_PORT
 
-                               configGComBoxInputOutputPort(false, outputPortName, xIn, yIn,
-                                               zIn);
+                               configGComBoxInputOutputPort(false, outputPortName, xIn, yIn, zIn);
 
                        } // for output complex box
 
@@ -1974,6 +1954,13 @@ void wxVtkSceneManager::loadDiagram(stringstream &inputStream) {
                        std::istringstream zSt(zInic);
                        zSt >> zIn;
 
+                       
+                       if (version<="1.2")
+                       {
+                               if (zIn==900) zIn=GPOSITION_Z;
+                       }
+                       
+                       
                        //----------
                        getline(inputStream, line);//xEnd:yEnd:zEnd
                        strcpy(coord, line.c_str());
@@ -1992,14 +1979,19 @@ void wxVtkSceneManager::loadDiagram(stringstream &inputStream) {
                        std::istringstream zEt(zEnd);
                        zEt >> zEn;
 
+                       if (version<="1.2")
+                       {
+                               if (zEn==900) zEn=GPOSITION_Z;
+                       }
+                       
+                       
                        bool boxExecutable = false;
                        if (isExec == "TRUE") {
                                boxExecutable = true;
                        }
 
                        int idBox = createGBlackBox(xIn, yIn, package, type);
-                       configGBlackBox(idBox, xIn, yIn, zIn, name, boxExecutable, xEn,
-                                       yEn, zEn);
+                       configGBlackBox(idBox, xIn, yIn, zIn, name, boxExecutable, xEn, yEn, zEn);
 
                        GObjectController *cont = _controllers[idBox];
                        GBlackBoxModel *bbmod = (GBlackBoxModel*) cont->getModel();
@@ -2053,17 +2045,13 @@ void wxVtkSceneManager::loadDiagram(stringstream &inputStream) {
                        result = strtok(NULL, delims);
                        std::string nameEndPort(result);
 
-                       int idCon = configGConnetion(nameStartBox, nameStartPort,
-                                       nameEndBox, nameEndPort);
+                       int idCon = configGConnetion(nameStartBox, nameStartPort,nameEndBox, nameEndPort);
 
                        if (version != "1.0") {
                                //Readding control points of the manualContour
-                               //ups1
-                               GConnectorController *tempp =
-                                               (GConnectorController*) _controllers[idCon];
-                               GConnectorModel *conMod = (GConnectorModel*) tempp->getModel();
-                               vtkGConnectorView *conView =
-                                               (vtkGConnectorView*) tempp->getView();
+                               GConnectorController *tempp             = (GConnectorController*) _controllers[idCon];
+                               GConnectorModel *conMod                 = (GConnectorModel*) tempp->getModel();
+                               vtkGConnectorView *conView              = (vtkGConnectorView*) tempp->getView();
                                getline(inputStream, line); //NumberOfControlPoints:##
                                strcpy(conns, line.c_str());
                                result = strtok(conns, delims);
@@ -2088,9 +2076,13 @@ void wxVtkSceneManager::loadDiagram(stringstream &inputStream) {
                                        result = strtok(NULL, delims);
                                        std::istringstream isPointZ(result);
                                        isPointZ >> pz;
-
-                                       conMod->getManualContourModel()->InsertPoint_id(ii + 1, px,
-                                                       py, pz);
+               
+                                       if (version<="1.2")
+                                       {
+                                               if (pz==900) pz=GPOSITION_Z;
+                                       }
+                                       
+                                       conMod->getManualContourModel()->InsertPoint_id(ii + 1, px, py, pz);
                                        conView->getManualContourView()->AddPoint();
                                }
                        }// version !=1.0