]> Creatis software - bbtkGEditor.git/commitdiff
#3263 Show principal connections vtk9itk5wx3-macos
authoreduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Fri, 12 Dec 2025 13:52:36 +0000 (14:52 +0100)
committereduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Fri, 12 Dec 2025 13:52:36 +0000 (14:52 +0100)
20 files changed:
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBoxModel.cxx
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GPortModel.h
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GlobalConstants.h
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectController.cxx
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectController.h
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/manualConnectorContourController.cxx
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/manualConnectorContourView.cxx
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGBlackBoxView.cxx
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGBoxView.cxx
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGConnectorView.cxx
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGConnectorView.h
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGObjectView.h
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGPortView.cxx
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGPortView.h
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.h
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h

index b8c4e4eae69d8dcf7d128cc1225a2c1a23c3bd3d..762c89b1b63286330d896d3cee327606eb2ed642 100644 (file)
@@ -114,19 +114,18 @@ namespace bbtk
                for(i=0;i<(int)_inputs.size();i++)
                {
                        _inputs[i]->updatePortPosition();
-               }
+               } // for i
                //Refresh outputs position
                for(i=0;i<(int)_outputs.size();i++)
                {
                        _outputs[i]->updatePortPosition();
-               }
+               }// for i
        }
        
        //=========================================================================
        std::string GBoxModel::getStatusText()
        {
                std::string temp = "";
-               
                return temp;
        }
 
@@ -196,7 +195,6 @@ namespace bbtk
                        _inputs[i]->updatePortPosition();
                        _inputs[i]->notifyObservers(_objectId);
                }
-
                for(int i = 0; i<_outputs.size();i++)
                {
                        _outputs[i]->updatePortPosition();
@@ -235,10 +233,6 @@ namespace bbtk
                        }
        }
 
-       //=========================================================================
-
-
 }  // EO namespace bbtk
-
 // EOF
 
index ed995fc94d71b75384b3b556cd37048a34de4385..e4456702ed5710cc733314ff0b4e88b84fe98f3c 100644 (file)
@@ -124,14 +124,14 @@ namespace bbtk
                
        private:
                //Private Attributes
-               GBoxModel *_parentBox;
+               GBoxModel   *_parentBox;
                // Port type (INPUT/OUTPUT)
-               int _portType;
+               int         _portType;
                // The position of the port in the box
-               int _posInBox;
-               bool _isConnected;
+               int         _posInBox;
+               bool        _isConnected;
                std::string _value;
-               bool _isValueSet;
+               bool        _isValueSet;
                //Private Methods
        protected:
                //Protected methods
index 42228af6939c8ab6f8f12108a3ae29f759cecf34..fa3823ae9d116636369df0e701bb8b0a8f0b6088 100644 (file)
@@ -106,14 +106,20 @@ namespace bbtk {
     const double COMPLEXPORT_WIDTH      =   3.3;   //  BOX_HEIGHT + PORT_HEIGHT
 
        // Commands
-       const int NO_COMMAND                            =       201;
-       const int INIT_CREATION_CONTOUR         =       202;
-       const int FIN_CREATION_CONTOUR          =       203;
-       const int ADD_TO_SELECTED                       =       204;
-       const int DRAG_OBJECTS                          =       205;
-       const int EDIT_BLACKBOX                         =       206;
-       const int REMOVE_FROM_SELECTED          =       207;
-    const int SELECTING_BOXES           =   208;
+       const int NO_COMMAND                                    =       201;
+       const int INIT_CREATION_CONTOUR                 =       202;
+       const int FIN_CREATION_CONTOUR                  =       203;
+       const int ADD_TO_SELECTED                           =   204;
+       const int DRAG_OBJECTS                                  =       205;
+       const int EDIT_BLACKBOX                                 =       206;
+       const int REMOVE_FROM_SELECTED                  =       207;
+    const int SELECTING_BOXES                   =   208;
+
+    const int COMMAND_CONNECTION_HIGHLIGHTED    =   220;
+    const int STATE_CONNECTION_HIGHLIGHTED      =   221;
+    const int STATE_CONNECTION_NORMAL           =   222;
+    const double CONNECTION_HIGHLIGHTED         =   1;
+    const double CONNECTION_NORMAL              =   0.1;
 
 
        //// COLORS (object_state_(R|G|B))
@@ -171,10 +177,7 @@ namespace bbtk {
        const double BOXFILL_SELECTED_G                 =       0.65;
        const double BOXFILL_SELECTED_B                 =       0.05;
 
-
        //Object Text colors
-
-
        const double PORTFILL_NH_R                              =       0.0;
        const double PORTFILL_NH_G                              =       0.0;
        const double PORTFILL_NH_B                              =       0.0;
@@ -222,7 +225,7 @@ namespace bbtk {
        
        const int wxID_NOTEBOOK                                 =       1018;  // EED updated
        
-       const int ID_bbEditor_Tool_Menu_CreatePackage   =       1019;  // EED
+       const int ID_bbEditor_Tool_Menu_CreatePackage       =   1019;  // EED
        const int ID_bbEditor_Tool_Menu_CreateBlackBox          =       1020;  // EED
        const int ID_bbEditor_Tool_Menu_PlugPackage                     =       1021;  // EED
        const int ID_bbEditor_Tool_Menu_EditConfig                      =       1022;  // EED
@@ -233,14 +236,12 @@ namespace bbtk {
        const int ID_REDO                                                                       =       1026;  // FCY
        const int ID_CHANGENAME                                                         =   1027;
 
-       const int ID_EDITPROPERTIES                                                                     =       1028;  // RaC 2nd HackFest
-       const int ID_SHOWTREE                                                                   =       1029;  // CFT
+       const int ID_EDITPROPERTIES                                                     =       1028;  // RaC 2nd HackFest
+       const int ID_SHOWTREE                                                           =       1029;  // CFT
 
     //EED 2022-10-28
-    const int ID_BTNSELETBOXES              =   1032;
-
+    const int ID_BTNSELETBOXES                          =   1032;
 
-}
-// namespace bbtk
+}// namespace bbtk
 #endif
 
index 55f011ce6d6e3f53d0db611446b373154e1ad93a..08837b061eb94711525ce1b436559c73fe324108 100644 (file)
@@ -58,40 +58,36 @@ Version:   $Revision$
  *  \brief Class bbtk::GObjectController
  */
 
-
 #include "GObjectController.h"
 
-
 #ifdef _DEBUG
 #define new DEBUG_NEW
 #endif
 namespace bbtk
 {
     //=========================================================================
-
-    GObjectController::GObjectController( ) {
-
+    GObjectController::GObjectController( ) 
+    {
     }
 
     //=========================================================================
-
-    GObjectController::~GObjectController( ) {
+    GObjectController::~GObjectController( ) 
+    {
     }
 
     //=========================================================================
-
-    void GObjectController::setModelAndView( GObjectModel* model , vtkGObjectView* view ) {
+    void GObjectController::setModelAndView( GObjectModel* model , vtkGObjectView* view ) 
+    {
         _model = model ;
         _view = view ;
     }
 
     //=========================================================================
-
     bool GObjectController::OnMouseMove( )
     {
         int X , Y ;
         crea::wxVTKRenderWindowInteractor *_wxVTKiren ;
-        _wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView( )->GetWxVTKRenderWindowInteractor( ) ;
+        _wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView( )->GetWxVTKRenderWindowInteractor( );
         _wxVTKiren->GetEventPosition( X , Y ) ;
         int state = _view->getState( ) ;
 
@@ -132,17 +128,13 @@ namespace bbtk
         // EO JGRR & CM WH
 
         _model->notifyObservers( getId( ) ) ;
-
-
         return true ;
     }
 
     //=========================================================================
-
     bool GObjectController::OnLeftButtonDown( )//virtual
     {
         int state = _view->getState( ) ;
-
         //Evaluate new state
         if ( state == HIGHLIGHTED ) {
             _isLeftClickDown = true ;
@@ -152,17 +144,14 @@ namespace bbtk
     }
 
     //=========================================================================
-
     bool GObjectController::OnLeftButtonUp( )//virtual
     {
         return true ;
     }
 
     //=========================================================================
-
     bool GObjectController::OnLeftDClick( )//virtual
     {
-
         return true ;
     }
 
@@ -174,56 +163,53 @@ namespace bbtk
     }
 
     //=========================================================================
-
-    void GObjectController::moveObject( int X , int Y ) {
+    void GObjectController::moveObject( int X , int Y ) 
+    {
         _view->moveObject( X , Y ) ;
     }
 
     //=========================================================================
-
-    int GObjectController::getGObjectType( ) {
+    int GObjectController::getGObjectType( ) 
+    {
         return _model->getGObjectType( ) ;
     }
 
     //=========================================================================
-
-    GObjectModel* GObjectController::getModel( ) {
+    GObjectModel* GObjectController::getModel( ) 
+    {
         return _model ;
     }
 
     //=========================================================================
-
-    vtkGObjectView* GObjectController::getView( ) {
+    vtkGObjectView* GObjectController::getView( ) 
+    {
         return _view ;
     }
 
     //=========================================================================
-
-    int GObjectController::getId( ) {
+    int GObjectController::getId( ) 
+    {
         return _model->getObjectId( ) ;
     }
 
     //=========================================================================
-
-    void GObjectController::setId( int id ) {
+    void GObjectController::setId( int id ) 
+    {
         _model->setObjectId( id ) ;
     }
 
     //=========================================================================
-
-    std::string GObjectController::getStatusText( ) {
+    std::string GObjectController::getStatusText( ) 
+    {
         return _model->getStatusText( ) ;
     }
 
     //=========================================================================
-
-    void GObjectController::removeFromScene( ) {
+    void GObjectController::removeFromScene( ) 
+    {
         _view->removeFromScene( ) ;
     }
 
-    //=========================================================================
-
 } // EO namespace bbtk
-
 // EOF
 
index ff37a2f7e8d641b5ae1eaa633cfe12f0a1a4e005..1403bc189c9cf58e31825278c45857659b98d974 100644 (file)
@@ -104,7 +104,7 @@ namespace bbtk {
         //Protected Attributes
         GObjectModel   *_model;
         vtkGObjectView         *_view;
-        bool _isLeftClickDown;
+        bool            _isLeftClickDown;
         //Protected Methods
         // Methods from InteractorStyleMaracas
         virtual bool OnMouseMove( );
index 361c899ba30f2e10779cd347e289cfaa2ce6e1d9..1f7e9c0758130ad82659b6841513e77cc4fea8f7 100644 (file)
@@ -71,18 +71,14 @@ namespace bbtk
        }
 
        //=========================================================================
-       
        manualConnectorContourController::~manualConnectorContourController()
        {
        }
 
        //=========================================================================
-
        void manualConnectorContourController::MouseMove(int x, int y) // virtual
        {
-               
                int z=GetZ();
-               
                GetManualViewBaseContour()->SelectPossiblePoint(x,y,z);
                GetManualViewBaseContour()->SelectPossibleContour(x,y,z);
                if (GetState()==1){     SetPoint( _bakIdPoint , x , y ,z); }
@@ -101,33 +97,25 @@ namespace bbtk
                        GetManualViewBaseContour()->Refresh();
                        this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
                }
-
        }
 
        //=========================================================================
-
        void manualConnectorContourController::MouseClickRight(int x, int y)
        {
                SetCompleteCreation( true );
                SetKeyBoardMoving( false );
                GetManualContourModel()->SetCloseContour(false);
-
                SetEditable( false );
                SetPossibleToMove( false );
                SetState(0);
-               
        }
 
        //=========================================================================
-
        void manualConnectorContourController::MouseClickLeft(int x, int y)
        {
-
-               bool ok = false;
-               int z=GetZ();
-               int size= GetManualViewBaseContour()->GetNumberOfPoints();
-
-               
+               bool    ok          = false;
+               int     z       = GetZ();
+               int     size    = GetManualViewBaseContour()->GetNumberOfPoints();
                // Insert a Control Point with shift+ClickLeft
                vtkRenderWindowInteractor *vtkrenderwindowinteractor = _vtkInteractorStyleBaseView->GetInteractor();
                if( IsEditable() )
@@ -204,26 +192,19 @@ namespace bbtk
                {
                        GetManualViewBaseContour()->Refresh();
                }// ok
-               
        }
        
        //=========================================================================
-       
        void manualConnectorContourController::endContourCreation()
        {
                SetCompleteCreation( true );
                SetKeyBoardMoving( false );
                GetManualContourModel()->SetCloseContour(false);
-
                SetEditable( false );
                SetPossibleToMove( false );
                SetState(0);
        }
 
-
-       //=========================================================================
-
 }  // EO namespace bbtk
-
 // EOF
 
index e88a5d7709b6c8d31f754c827b5ea29870252962..9e071ed6baa2109aa7f4e3b78b1fc8e317beab80 100644 (file)
@@ -58,27 +58,22 @@ Version:   $Revision$
 *  \brief Class bbtk::manualConnectorContourView 
 */
 
-
 #include "manualConnectorContourView.h"
 
 namespace bbtk
 {
 
-
        //=========================================================================
-
        manualConnectorContourView::manualConnectorContourView()
        {
        }
 
        //=========================================================================
-
        manualConnectorContourView::~manualConnectorContourView()
        {
        }
 
        //=========================================================================
-
        void manualConnectorContourView::TransfromCoordViewWorld(double &X, double &Y, double &Z, int type)
        {
                // Make the conversion using the system of creaMaracasVisu
@@ -86,7 +81,6 @@ namespace bbtk
        }
 
        //=========================================================================
-
        void manualConnectorContourView::updateStartAndEnd(double* start , double* end)
        {
                // Update contour first and last point
@@ -97,7 +91,6 @@ namespace bbtk
        }
 
        //=========================================================================
-
        void manualConnectorContourView::AddControlPoints()
        {
                vtkRenderer * theRenderer = _wxvtkbaseview->GetRenderer();
@@ -115,14 +108,11 @@ namespace bbtk
        }
        
        //=========================================================================
-
        void manualConnectorContourView::RefreshText()  // virtual
        {
                // The text that goes with the contour is not shown
        }
 
-
 }  // EO namespace bbtk
-
 // EOF
 
index 36800fbc11e7d5f6af3d2a72f54ae434efebae1c..ab79bfd5a7631eb060fa6fddd80bcffa72c00e0c 100644 (file)
@@ -170,7 +170,6 @@ namespace bbtk
 //             _borderObjectActor->SetMapper(_borderPolyMapper);
 //             _borderPolyMapper->Modified();
 
-
                ///************************* FILL *************************
                vtkCellArray *strip = vtkCellArray::New();
                vtkPolyData *pdFill = vtkPolyData::New();
@@ -185,28 +184,17 @@ namespace bbtk
                strip->InsertCellPoint(3);
                pdFill->SetPoints( _pts );
                pdFill->SetStrips( strip );
-
-
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
                _fillPolyMapper->SetInput(pdFill);
 #else
                _fillPolyMapper->SetInputData(pdFill);
 #endif
-
-
                _fillObjectActor->SetMapper(_fillPolyMapper);
                _fillPolyMapper->Modified();
                ///************************* FILL *************************
-
-
-
                createVtkInputOutputPorts();
-
-
-
                //------------
-
 //        _boxTextActor            = vtkTextActor::New();  // for actor 2D
                _boxTextActor                   = vtkTextActor3D::New();
                vtkTextProperty *prop   =  vtkTextProperty::New();
@@ -219,23 +207,18 @@ namespace bbtk
         prop->SetFontSize(40);
                _boxTextActor->SetTextProperty(prop);
                //------------
-
                updatePositionTextActor( xInic,  yInic,  zInic);
        }
 
        //===============BoundaryEdgesOn==========================================================
-
        void vtkGBlackBoxView::addVtkActors()//virtual
        {
-               
 //             _baseView->GetRenderer()->AddActor(_borderObjectActor);
                vtkGBoxView::addVtkActors();
                _baseView->GetRenderer()->AddActor(_boxTextActor);
-
        }
 
        //=========================================================================
-
        void vtkGBlackBoxView::removeVtkActors()//virtual
        {
                _baseView->GetRenderer()->RemoveActor(_boxTextActor);
@@ -244,7 +227,6 @@ namespace bbtk
        }
 
        //=========================================================================
-
        void vtkGBlackBoxView::updatePositionTextActor(double xInic, double yInic, double zInic)
        {
                std::string temp        = _model->getBBTKType();
@@ -259,25 +241,21 @@ namespace bbtk
        }
 
        //=========================================================================
-
        void vtkGBlackBoxView::updateColors()
        {
                _fillObjectActor->GetProperty()->SetAmbient(0.6);
-
                if(_state==NOTHING_HAPPENS)
                {
 //                     _borderObjectActor->GetProperty()->SetLineWidth(1);
 ///                    _borderObjectActor->GetProperty()->SetColor(BOXBORDER_NH_R,BOXBORDER_NH_G,BOXBORDER_NH_B);
                        _fillObjectActor->GetProperty()->SetColor(BOXFILL_NH_R,BOXFILL_NH_G,BOXFILL_NH_B);
                        _boxTextActor->GetTextProperty()->SetColor(BOXTEXT_NH_R,BOXTEXT_NH_G,BOXTEXT_NH_B);
-
                        GBlackBoxModel *bbmodel = (GBlackBoxModel*)_model;
                        if(bbmodel->isExecutable())
                        {
 //                             _borderObjectActor->GetProperty()->SetColor(BOXBORDER_NH_R,0.9,BOXBORDER_HIGHLIGHTED_B);
                                _fillObjectActor->GetProperty()->SetColor(BOXFILL_NH_R,0.9,BOXFILL_HIGHLIGHTED_B);
                        }
-
                }
                else if(_state==HIGHLIGHTED)
                {
@@ -300,14 +278,9 @@ namespace bbtk
                        _fillObjectActor->GetProperty()->SetColor(BOXFILL_SELECTED_R,BOXFILL_SELECTED_G,BOXFILL_SELECTED_B);
                        _boxTextActor->GetTextProperty()->SetColor(BOXTEXT_SELECTED_R,BOXTEXT_SELECTED_G,BOXTEXT_SELECTED_B);
                }
-
                updateColorsPorts();
-
        }
 
-       //=========================================================================
-
-
 }  // EO namespace bbtk
 
 // EOF
index 4c6c7ee6d00d2f5ffc7b9096cc47112f017179d2..1bd0fe15faced38b389499d621ed5422a7bfa8d6 100644 (file)
@@ -58,15 +58,12 @@ Version:   $Revision$
 *  \brief Class bbtk::vtkGBoxView 
 */
 
-
 #include "vtkGBoxView.h"
 #include "vtkUnsignedCharArray.h"
 #include "vtkCellData.h"
 
 namespace bbtk
 {
-
-
        //=========================================================================
        vtkGBoxView::vtkGBoxView()
        {                       
@@ -80,7 +77,7 @@ namespace bbtk
        //=========================================================================
        void vtkGBoxView::update(int idController,int command)
        {
-               updateColors();         
+               updateColors();
                double xInic, yInic,zInic,xFin, yFin,zFin;
                _model->getInicPoint(xInic,yInic,zInic);
                _model->getFinalPoint(xFin, yFin,zFin);
@@ -96,7 +93,6 @@ namespace bbtk
                setRefreshWaiting();
        }
 
-
        //=========================================================================
 //EED2017
        void vtkGBoxView::createVtkInputOutputPorts()
@@ -147,7 +143,6 @@ namespace bbtk
                _TrianglesInputsActor->SetMapper(_TrianglesInputsPolyMapper);
                _TrianglesInputsPolyMapper->Modified();
 
-
                ///************************* Inputs Fill (triangles) *************************
 
                ///************************* Outputs Fill (triangles) *************************
@@ -194,9 +189,7 @@ namespace bbtk
                ///************************* Inputs Fill (triangles) *************************
        }
 
-
        //=========================================================================
-
        void vtkGBoxView::createVtkObjects() //virtual
        {
                //------------
@@ -205,9 +198,7 @@ namespace bbtk
 //             vtkPolyData *_pd        = vtkPolyData::New();
 //             _borderPolyMapper       = vtkPolyDataMapper::New();
 //             _borderObjectActor      = vtkActor::New();
-                               
                _pts->SetNumberOfPoints(4);
-
                double xInic, yInic,zInic,xFin, yFin,zFin;
                _model->getInicPoint(xInic,yInic,zInic);
                _model->getFinalPoint(xFin, yFin,zFin);
@@ -237,7 +228,6 @@ namespace bbtk
 //             _borderObjectActor->SetMapper(_borderPolyMapper);
 //             _borderPolyMapper->Modified();
 
-               
                ///************************* FILL *************************
 
                vtkCellArray *strip             = vtkCellArray::New();
@@ -270,7 +260,6 @@ namespace bbtk
        }
 
        //=========================================================================
-
        void vtkGBoxView::addVtkActors()//virtual
        {
 //             _baseView->GetRenderer()->AddActor(_borderObjectActor);
@@ -280,7 +269,6 @@ namespace bbtk
        }
 
        //=========================================================================
-
        void vtkGBoxView::removeVtkActors()//virtual
        {
 //             _baseView->GetRenderer()->RemoveActor(_borderObjectActor);
@@ -290,42 +278,31 @@ namespace bbtk
        }
 
        //=========================================================================
-
        void vtkGBoxView::updateColors()
        {
                printf("EED vtkGBoxView::updateColors\n");
                _fillObjectActor->GetProperty()->SetAmbient(0.6);
-
                if(_state==NOTHING_HAPPENS)
                {
 //                     _borderObjectActor->GetProperty()->SetLineWidth(1);
 //                     _borderObjectActor->GetProperty()->SetColor(BOXBORDER_NH_R,BOXBORDER_NH_G,BOXBORDER_NH_B);
                        _fillObjectActor->GetProperty()->SetColor(BOXFILL_NH_R,BOXFILL_NH_G,BOXFILL_NH_B);
-                       
-               }
-               else if(_state==HIGHLIGHTED)
-               {
-//                     _borderObjectActor->GetProperty()->SetLineWidth(2);                     
+               } else if(_state==HIGHLIGHTED) {
+//                     _borderObjectActor->GetProperty()->SetLineWidth(2);
 //                     _borderObjectActor->GetProperty()->SetColor(BOXBORDER_HIGHLIGHTED_R,BOXBORDER_HIGHLIGHTED_G,BOXBORDER_HIGHLIGHTED_B);
                        _fillObjectActor->GetProperty()->SetColor(BOXFILL_HIGHLIGHTED_R,BOXFILL_HIGHLIGHTED_G,BOXFILL_HIGHLIGHTED_B);
-               }
-               else if(_state==DRAG)
-               {
+               } else if(_state==DRAG) {
 //                     _borderObjectActor->GetProperty()->SetLineWidth(1.2);
 //                     _borderObjectActor->GetProperty()->SetColor(BOXBORDER_DRAG_R,BOXBORDER_DRAG_G,BOXBORDER_DRAG_B);
                        _fillObjectActor->GetProperty()->SetColor(BOXFILL_DRAG_R,BOXFILL_DRAG_G,BOXFILL_DRAG_B);
-               }
-               else if(_state==SELECTED)
-               {
+               } else if(_state==SELECTED) {
 //                     _borderObjectActor->GetProperty()->SetLineWidth(2);
 //                     _borderObjectActor->GetProperty()->SetColor(BOXBORDER_SELECTED_R,BOXBORDER_SELECTED_G,BOXBORDER_SELECTED_B);
                        _fillObjectActor->GetProperty()->SetColor(BOXFILL_SELECTED_R,BOXFILL_SELECTED_G,BOXFILL_SELECTED_B);
                } // if state box
-
                updateColorsPorts();
        }
 
-
        //=========================================================================
        void vtkGBoxView::updateColorsPorts()
        {
@@ -356,15 +333,12 @@ namespace bbtk
                } // for
        }
 
-
        //=========================================================================
        void vtkGBoxView::updatePorts()
        {
                double xInic, yInic,zInic,xFin, yFin,zFin;
-
                GBoxModel* boxModel = (GBoxModel*)_model;
                boxModel->updatePorts();
-
 // update position for one Actor that represents all InputPorts
                GPortModel              *portModel;
                int numberOfTriangles                   = boxModel->getNumInputPorts();
@@ -376,7 +350,7 @@ namespace bbtk
                // RaC In the actual version, zInic=zFin=GPOSITION_Z
                        _TrianglesInputsPts->SetPoint(i*3+0, xInic                                      , yInic , zInic );
                        _TrianglesInputsPts->SetPoint(i*3+1, ( xInic + xFin ) / 2       , yFin  , zInic );
-                       _TrianglesInputsPts->SetPoint(i*3+2, xFin                                       , yInic , zFin );
+                       _TrianglesInputsPts->SetPoint(i*3+2, xFin                                       , yInic , zFin  );
                }
                _TrianglesInputsPts->Modified();
         _TrianglesInputsPolyMapper->Modified( ) ;
@@ -391,13 +365,10 @@ namespace bbtk
                // RaC In the actual version, zInic=zFin=GPOSITION_Z
                        _TrianglesOutputsPts->SetPoint(i*3+0, xInic                                     , yInic , zInic );
                        _TrianglesOutputsPts->SetPoint(i*3+1, ( xInic + xFin ) / 2      , yFin  , zInic );
-                       _TrianglesOutputsPts->SetPoint(i*3+2, xFin                                      , yInic , zFin );
+                       _TrianglesOutputsPts->SetPoint(i*3+2, xFin                                      , yInic , zFin  );
                }
                _TrianglesOutputsPts->Modified();
         _TrianglesOutputsPolyMapper->Modified( ) ;
-
-
-
        }
 
        //=========================================================================
@@ -412,8 +383,6 @@ namespace bbtk
                _outputsG.push_back(outputport);
        }
 
-
 }  // EO namespace bbtk
-
 // EOF
 
index 44ef0b640ba22b1c265c3c3e0397429dfecb1899..1de29a891cad1b26300cc09d36656634c9f61b73 100644 (file)
@@ -64,45 +64,54 @@ Version:   $Revision$
 
 namespace bbtk
 {
-
-
        //=========================================================================
-       
        vtkGConnectorView::vtkGConnectorView()
        {               
        }
 
        //=========================================================================
-       
        vtkGConnectorView::~vtkGConnectorView()
        {
        }
        
        //=========================================================================
-       
        void vtkGConnectorView::setManualContourView(manualViewContour *viewContour)
        {
                manViewContour = viewContour;
        }
 
        //=========================================================================
-       
        manualViewContour* vtkGConnectorView::getManualContourView()
        {
                return manViewContour;
        }
 
        //=========================================================================
-       
        void vtkGConnectorView::updateStartEndPoints()
        {               
                GConnectorModel* mod=(GConnectorModel*)_model;
                mod->updateStartEndPoints();
                manViewContour->RefreshContour();
        }
-               
 
-}  // EO namespace bbtk
 
+//=========================================================================
+void vtkGConnectorView::update(int idController,int command)
+{
+    if ( command == COMMAND_CONNECTION_HIGHLIGHTED )
+    {
+        if (_state==STATE_CONNECTION_HIGHLIGHTED )
+        {
+            getManualContourView()->SetOpacity( CONNECTION_HIGHLIGHTED );
+        }
+        if (_state==STATE_CONNECTION_NORMAL )
+        {
+            getManualContourView()->SetOpacity( CONNECTION_NORMAL );
+        }
+    } // if command
+    getManualContourView()->UpdateColorActor();
+}
+
+}  // EO namespace bbtk
 // EOF
 
index 7a86b3decc2da763d4ae84e9dd952dbc1ab41eb3..5461887164e39d9bbecd95aa30d21664cb112446 100644 (file)
@@ -92,6 +92,7 @@ namespace bbtk
                void setManualContourView(manualViewContour* viewContour);
                manualViewContour* getManualContourView();
                void updateStartEndPoints();
+        void update(int idController,int command);
        private:
                //Attributes
                manualViewContour* manViewContour;
index 0ad49766d67aa04c6e9e3504e3d422085bba7500..32229b3d27581aad3ce9b39e654f1d9f7fd1fca1 100644 (file)
@@ -129,9 +129,9 @@ namespace bbtk
                vtkActor                        * _fillObjectActor;
                vtkPolyDataMapper       * _fillPolyMapper;
 //             vtkPolyDataMapper       * _borderPolyMapper;
-               vtkPoints                       *_pts;
+               vtkPoints                       * _pts;
                // State of the object (See GlobalConstants.h)
-               int  _state;    
+               int                 _state;     
                //Protected Methods
                virtual void removeVtkActors();
                virtual void updateColors();
index 9376a6710e1a4bd1f6920469db53a0184de15feb..962b7607d683b152fd1515567f1e4ed0e19a5507 100644 (file)
@@ -67,18 +67,20 @@ namespace bbtk {
 
     //=========================================================================
 
-    vtkGPortView::vtkGPortView( ) {
+    vtkGPortView::vtkGPortView( ) 
+    {
     }
 
     //=========================================================================
 
-    vtkGPortView::~vtkGPortView( ) {
+    vtkGPortView::~vtkGPortView( ) 
+    {
     }
 
     //=========================================================================
 
     void vtkGPortView::update( int idController , int command ) 
-{
+    {
         updateColors( ) ;
 
         double xInic , yInic , zInic , xFin , yFin , zFin ;
@@ -149,10 +151,8 @@ namespace bbtk {
         _fillPolyMapper->Modified( ) ;
 
         ///************************* FILL *************************
-
+        ///
         updateColors( ) ;
-
-
     }
 
     //=========================================================================
@@ -190,6 +190,5 @@ namespace bbtk {
        }
 
 } // EO namespace bbtk
-
 // EOF
 
index f24c8a53ec00455e00513944019915ef795df5e2..ed1b9a9ee6c96549e34e4b77cbdb42f178e4a9a4 100644 (file)
@@ -99,7 +99,7 @@ namespace bbtk
                ~vtkGPortView();        
                //Public methods
                virtual void update(int idController,int command);
-                       void getColors(float* rgb);
+                           void getColors(float* rgb);
 
        private:
                //Private Attributes
index 468c1be271cbd3d41e67f2dc22bb67db8b807ed9..fd3bc0e4911a5bb553d5be108f4e10041217abb5 100644 (file)
@@ -1597,7 +1597,6 @@ bool wxGUIEditorGraphicBBS::TryToOpenScript(std::string packageName ,std::string
        k                       = GetBBTKFactory()->GetPackage(packageName);
        mapDesc         = k->GetDescriptorMap();
        descriptor      = mapDesc[boxType];
-
        bool result=false;
     descriptor->IsTypeOfScript_Application();  
        if (descriptor!=NULL)
@@ -1614,11 +1613,9 @@ bool wxGUIEditorGraphicBBS::TryToOpenScript(std::string packageName ,std::string
        } else {
                printf("EED ERROR wxGUIEditorGraphicBBS::TryToOpenScript >> The descriptor of this box not exists (packageName:%s  boxType:%s) this is not normal\n",packageName.c_str(), boxType.c_str() );
        }  // if descriptor NULL
-       
        return result;
 }      
        
 } // EO namespace bbtk
-
 // EOF
 
index ee1aec3cab94e154b19d8ff915a00f47cdb0c73e..8d3ba3b179e162afa51152a64ef01eac0652bd7d 100644 (file)
@@ -58,13 +58,11 @@ Version:   $Revision$
 *  \brief Class bbtk::wxGEditorTabPanel .
 */
 
-
 #include "wxGEditorTabPanel.h"
 #include "creaWx.h"
 
 namespace bbtk
 {
-
        //=========================================================================
        wxGEditorTabPanel::wxGEditorTabPanel()
        {
@@ -88,7 +86,6 @@ namespace bbtk
        wxGEditorTabPanel::~wxGEditorTabPanel()
        {
 //ED02JUIN2010         _sceneManager->disconnectDrop();
-
       _panelsManager->VerifyLastTabPanel();
                //FCY memory leaks
                delete _panelAUIMgr;
@@ -120,7 +117,6 @@ namespace bbtk
 
        bool wxGEditorTabPanel::OnDropText(wxCoord x, wxCoord y, const wxString& data)
        {
-
          /*
           * DFGO
           * To handle bbs and bbg:
@@ -130,11 +126,7 @@ namespace bbtk
           * For a drag and drop tutorial read:
           * http://zetcode.com/gui/wxwidgets/dragdrop/
           */
-
           //wxMessageBox(data);
-
-
-
                int posEndEED=data.find("<EndEED>");
                wxString data2( data.substr(0,posEndEED) );
                std::string stdData = crea::wx2std(data2);
@@ -615,7 +607,6 @@ printf("EED wxGEditorTabPanel::getUndoState This mecanisme is not working  ?????
     {
                return( this->_fileName );
        }
-
     //=========================================================================
     // EED 2022-10-28
     void wxGEditorTabPanel::SelectBoxWithPossibleName(std::string nameFilter )
@@ -623,9 +614,6 @@ printf("EED wxGEditorTabPanel::getUndoState This mecanisme is not working  ?????
         getSceneManager()->SelectBoxWithPossibleName( nameFilter );
     }
 
-
-
-
 }  // EO namespace bbtk
 
 // EOF
index 8d2bbf59a4b35ec0d3ede92b6d06d02731fc8ba3..372abfa75c2c0b50582816e6efed0e3a49cff9ae 100644 (file)
@@ -53,8 +53,6 @@ Version:   $Revision$
 *  knowledge of the CeCILL-B license and that you accept its terms.
 * ------------------------------------------------------------------------ */
 
-
-
 /**
 *  \file
 *  \brief Class bbtk::BlackBox : abstract black-box interface.
@@ -137,7 +135,7 @@ namespace bbtk
                void saveStringAction(const std::string &action);
 
                // Load temporary diagram as BBG
-               void  loadTempDiagram(unsigned short un);
+               void loadTempDiagram(unsigned short un);
 
                // evaluate the position in the undo actions list
                unsigned short getUndoState(std::string &);
@@ -161,7 +159,7 @@ namespace bbtk
                void displayBlackBoxInfo(std::string packageName, std::string boxName);
                void updateStatusBar(std::string textStatus);
 
-               int getPanelId();
+               int  getPanelId();
                bool isComplexBox();
                void setComplexBox(bool val);
 
@@ -169,7 +167,7 @@ namespace bbtk
                std::map<int,GObjectController*> getSelectedObjects();
 
                void addObjects(std::map<int,GObjectController*> objectsMap);
-               int getNumSelectedObjects();
+               int  getNumSelectedObjects();
 
                // Receives the string from a drag and drop source as for example the BBTK Package Browser
                virtual bool OnDropText(wxCoord x, wxCoord y, const wxString& data);
@@ -192,7 +190,7 @@ namespace bbtk
         std::string GetCbName();
         std::string GetCbPackageName();
         std::string GetAuthor();
-        int GetExportFormat();
+        int         GetExportFormat();
         std::string GetDescription();
         std::string GetCategory();
                std::string GetMessageKind();
@@ -215,11 +213,8 @@ namespace bbtk
                std::string                             _fileName;
        protected:
                Factory::Pointer                _bbtkfactory;
-
        };
 
-
-}
-// namespace bbtk
+}// namespace bbtk
 #endif
 
index 6618b14448e994dcffb48a8be4061103194c6805..17f6174e6bade8e77680ae38cc63a1b95df7e41f 100644 (file)
@@ -63,8 +63,6 @@ Version:   $Revision$
 
 namespace bbtk
 {
-
-
        //=========================================================================
        wxTabPanelsManager::wxTabPanelsManager(wxGUIEditorGraphicBBS *parent)
        {
@@ -74,7 +72,6 @@ namespace bbtk
                addNewTab();
                _notebook->Connect(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED,wxAuiNotebookEventHandler(wxTabPanelsManager::OnTabChanged),0,this);
                _notebook->Connect(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE,wxAuiNotebookEventHandler(wxTabPanelsManager::OnTabClose),0,this);
-
        }
 
        //=========================================================================
@@ -102,10 +99,6 @@ namespace bbtk
                _notebook->AddPage(newPanel, tabName  ,true);
        }
 
-
-
-
-
        //=========================================================================
        wxAuiNotebook* wxTabPanelsManager::getAuiNotebook()
        {
index d472336287a06625c3bccb07748cba88da2d7462..6f8e949cadad1549995edf5a32ca66324472dcac 100644 (file)
@@ -240,11 +240,9 @@ void wxVtkSceneManager::configureBaseView()
        _fillObjectActor->GetProperty()->SetOpacity(0);
        _aPolygonMapper->Modified();
        _baseView->GetRenderer()->AddActor(_fillObjectActor);
-    
 }
 
 //=========================================================================
-
 std::string wxVtkSceneManager::generateANewNameForABox() {
        std::stringstream boxname;
        if (_numBoxes < 10) {
@@ -257,7 +255,6 @@ std::string wxVtkSceneManager::generateANewNameForABox() {
 }
 
 //=========================================================================
-
 std::string wxVtkSceneManager::findANewNameForABox()
 {
        std::string boxname = generateANewNameForABox();
@@ -296,7 +293,6 @@ 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{
@@ -676,11 +672,9 @@ vtkRenderWindow* wxVtkSceneManager::getRenderWindow()
 {
        return _baseView->GetRenWin();
 }
-//=========================================================================
-
 
 //=========================================================================
-int wxVtkSceneManager::GetIndexInSelected(int idControler) 
+int wxVtkSceneManager::GetIndexInSelected(int idControler)
 {
        int index = -1;
        for (int i = 0; i < (int) _selectedObjects.size(); i++) 
@@ -693,10 +687,10 @@ int wxVtkSceneManager::GetIndexInSelected(int idControler)
        }
        return index;
 }
-//=========================================================================
-
-void wxVtkSceneManager::update(int idController, int command) {
 
+//=========================================================================
+void wxVtkSceneManager::update(int idController, int command)
+{
        if (command != NO_COMMAND) 
        {
                if (command == ADD_TO_SELECTED) 
@@ -826,13 +820,10 @@ void wxVtkSceneManager::update(int idController, int command) {
                        }
                        connView->Refresh();          
                }
-
        }
-        
 }
 
 //=========================================================================
-
 bool wxVtkSceneManager::OnMouseMove() 
 {
        int X, Y;
@@ -841,7 +832,6 @@ bool wxVtkSceneManager::OnMouseMove()
        crea::wxVTKRenderWindowInteractor *wxVTKiren;
        wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
        wxVTKiren->GetEventPosition(X, Y);
-
        if (_worldState == DRAG_OBJECTS)
     {
                for (int i = 0; i < (int) _selectedObjects.size(); i++)
@@ -928,8 +918,6 @@ bool wxVtkSceneManager::OnMouseMove()
             } // if  state
                } // for controllers it
     } else if (_worldState == SELECTING_BOXES ) {
-
-
         int sX1,sX2,sY1,sY2;
         if (X<selectRegionX1)
         {
@@ -957,7 +945,6 @@ bool wxVtkSceneManager::OnMouseMove()
             desc    = it->second;
             type    = desc->getGObjectType();
             state   = desc->getView()->getState();
-            
             if ( (type==GBLACKBOX) || (type==GCOMPLEXINPUTPORT) || (type==GCOMPLEXOUTPUTPORT) )
             {
                 if ( desc->getView()->isBoxInsideRectangle( sX1 , sY1,sX2 , sY2 ) )
@@ -965,10 +952,23 @@ bool wxVtkSceneManager::OnMouseMove()
                     desc->getView()->setState(SELECTED);
                     id = desc->getModel()->getObjectId();
                     desc->getModel()->notifyObservers( id , ADD_TO_SELECTED );
+                    
+//EED 2025-11-29
+                    // Aqui toca seleccionar los connector input y output de esta caja
+                    
                 }
             } // if type == 1
-        } // for
+        } // for it
         
+//EED 2025-11-29
+        for (int i = 0; i < (int) _selectedObjects.size(); i++)
+        {
+            int id = _selectedObjects[i];
+            GObjectController* cont = _controllers[id];
+            std::string name = cont->getModel()->getBBTKName();
+            printf("EED wxVtkSceneManager::OnMouseMove  %d  %s\n", id, name.c_str() );
+        }
+
         
     } //  if _worldState
     
@@ -1051,14 +1051,14 @@ bool wxVtkSceneManager::OnLeftButtonDown()
         {
             for (int i = 0; i < (int) _selectedObjects.size(); i++)
             {
-                int id = _selectedObjects[i];
-                GObjectController *cont = _controllers[id];
+                int                 id      = _selectedObjects[i];
+                GObjectController   *cont   = _controllers[id];
                 cont->getView()->setState(DRAG);
                 cont->getModel()->notifyObservers(_idManager);
             } // for
         } // if  _worldState DRAG_OBJECTS
 
-       } // if _selectedObjects.size
+       } // if NOT INIT_CREATION_CONTOUR
        return true;
 }
 
@@ -3184,7 +3184,6 @@ void wxVtkSceneManager::printAll(int com , int sta )
         if ( command == REMOVE_FROM_SELECTED ) {
             std::cout << "COMMAND ----> REMOVE_FROM_SELECTED \n" ;
         }
-        
     }
 
 //=========================================================================
@@ -3193,44 +3192,79 @@ void wxVtkSceneManager::SelectBoxWithPossibleName( std::string possibleName )
 { 
     UnSelectBlackBoxes();
     std::map<int, GObjectController*>::iterator it;
-    GObjectController                           *desc;
-    int                                         type;
     int                                         id;
-    int                                         pos;
-    std::string possibleNameAA = possibleName;
-    std::string boxNameBB;
-    int i,size;
-    size = possibleNameAA.length();
-    for (i=0;i<size;i++)
-    {
-        if ((possibleNameAA[i]>='A')&&(possibleNameAA[i]<='Z')) { possibleNameAA[i]=possibleNameAA[i]+32; }
-    } //for  i
+    int                                         type;
+    GObjectController                           *desc;
+    std::string                                 boxNameBB;
+    std::string                                 possibleNameAA = possibleName;
+    //
+    bool            ok;
+    GBoxModel       *modelBoxStart;
+    GBoxModel       *modelBoxEnd;
+    std:string      boxNameStart;
+    std::string     boxNameEnd;
+    std::transform( possibleNameAA.begin(),possibleNameAA.end(),possibleNameAA.begin(), ::toupper );
+    
     for (it = _controllers.begin(); it != _controllers.end(); ++it)
     {
         desc    = it->second;
         type    = desc->getGObjectType();
+        // Select Box
         if ( type==GBLACKBOX)
         {
             boxNameBB = desc->getModel()->getBBTKType() +":"+ desc->getModel()->getBBTKName();
-            size=boxNameBB.length();
-            for (i=0;i<size;i++)
-            {
-                if ((boxNameBB[i]>='A')&&(boxNameBB[i]<='Z')) { boxNameBB[i]=boxNameBB[i]+32; }
-            } // for  i
-
-            pos=boxNameBB.find( possibleNameAA );
-            if  (pos>=0)
+            std::transform( boxNameBB.begin(),boxNameBB.end(),boxNameBB.begin(),::toupper);
+            if  ( (int)(boxNameBB.find(possibleNameAA)) >= 0 )
             {
                 desc->getView()->setState(SELECTED);
                 id = desc->getModel()->getObjectId();
                 desc->getModel()->notifyObservers( id , ADD_TO_SELECTED );
             } // if pos
-        } // if type == 1
+        } // if type == 1  GBLACKBOX   //  GlobalConstants.h
+
+//EED 2025-11-29
+        // Select Connector
+        if ( type==GCONNECTOR)
+        {
+                                ok              = false;
+            GConnectorModel     *connectorModel = (GConnectorModel*) (desc->getModel());
+            vtkGConnectorView   *connectorView  = (vtkGConnectorView*) (desc->getView());
+            
+//            id = desc->getModel()->getObjectId();
+//            desc->getModel()->notifyObservers( id , COMMAND_CONNECTION_NORMAL );
+//connectorView->getManualContourView()->SetOpacity(0.1);
+            desc->getView()->setState(STATE_CONNECTION_NORMAL);
+
+            //start
+            modelBoxStart   = connectorModel->getStartPort()->getParentBox();
+            boxNameStart    = modelBoxStart->getBBTKType() +":"+ modelBoxStart->getBBTKName();
+            std::transform( boxNameStart.begin(),boxNameStart.end(),boxNameStart.begin(),::toupper);
+            if  ( (int)(boxNameStart.find(possibleNameAA)) >= 0 ) { ok= true;}
+            //end
+            modelBoxEnd     = connectorModel->getEndPort()->getParentBox();
+            boxNameEnd      = modelBoxEnd->getBBTKType() +":"+ modelBoxEnd->getBBTKName();
+            std::transform( boxNameEnd.begin(),boxNameEnd.end(),boxNameEnd.begin(),::toupper);
+            if  ( (int)(boxNameEnd.find(possibleNameAA)) >= 0 ) { ok= true; }
+            //
+            if (ok==true) 
+            {
+//              id = desc->getModel()->getObjectId();
+//              desc->getModel()->notifyObservers( id , COMMAND_CONNECTION_HIGHLIGHTED );
+                desc->getView()->setState(STATE_CONNECTION_HIGHLIGHTED);
+//              connectorView->getManualContourView()->SetOpacity(1);
+//              connectorView->getManualContourView()->UpdateColorActor();
+            } // if ok
+            
+            id = desc->getModel()->getObjectId();
+            desc->getModel()->notifyObservers( id , COMMAND_CONNECTION_HIGHLIGHTED );
+
+//            connectorView->getManualContourView()->UpdateColorActor();
+        } //if type== 2 GCONNECTOR   //  GlobalConstants.h
+        
     } // for it
     refresh(); 
 }
 
 } // EO namespace bbtk
-
 // EOF
 
index 0df261de6d2ca59c5a333425c0b6086375378707..cbd2138afcda13175ad43be1831c6d2605f12d29 100644 (file)
@@ -53,8 +53,6 @@ Version:   $Revision$
 *  knowledge of the CeCILL-B license and that you accept its terms.
 * ------------------------------------------------------------------------ */
 
-
-
 /**
 *  \file
 *  \brief Class bbtk::BlackBox : abstract black-box interface.
@@ -102,8 +100,7 @@ Version:   $Revision$
 #include <vtkActor.h>
 #include <vtkPoints.h>
 #include <vtkTextActor3D.h>
- #include <vtkDataSetMapper.h>
-
+#include <vtkDataSetMapper.h>
 
 //Includes std
 #include <iostream>
@@ -308,7 +305,6 @@ namespace bbtk
        protected:
        };
 
-
 }
 // namespace bbtk
 #endif