]> Creatis software - bbtkGEditor.git/commitdiff
Changes in information presented in status bar, inside the box, and the editing dialo...
authorcorredor <>
Wed, 5 May 2010 14:19:41 +0000 (14:19 +0000)
committercorredor <>
Wed, 5 May 2010 14:19:41 +0000 (14:19 +0000)
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBlackBoxModel.cxx
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GPortModel.cxx
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GlobalConstants.h
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGBlackBoxView.cxx
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGBlackBoxView.h
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGObjectView.cxx
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGPortView.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxBlackBoxEditionDialog.cxx

index f35cda172d483c4e08a45fe2fae2e09c065fccfb..c7778f3667705f21563641cc50a613daae6e6aeb 100644 (file)
@@ -142,9 +142,12 @@ namespace bbtk
        std::string GBlackBoxModel::getStatusText()
        {
                std::string temp = "";
+               temp+=_bbtkPackage;
+               temp+=":";
                temp+=_bbtkType;
                temp+=":";
-               temp+=_bbtkPackage;
+               temp+=_bbtkName;
+               
                return temp;
        }
 
index fa208106e601938876cc21b4f7fb467c6fb7dec3..326cbe2975f159b6d5c3f2d58ca0136da5065000 100644 (file)
@@ -108,26 +108,17 @@ namespace bbtk
        
        std::string GPortModel::getStatusText()
        {
-               std::string temp = "Name:";
+               std::string temp = "";
                
                temp+=_bbtkName;
-               temp+=" Type:";
-               temp+=_bbtkType;
-               temp+=" Box:";
-               temp+=_parentBox->getBBTKType();
-               if(_portType==GOUTPUTPORT)
-               {
-                       temp+=" [Output Port]";
-               }
-               else if(_portType==GINPUTPORT)
+               if(isValueSet())
                {
-                       if(isValueSet())
-                       {
-                               temp+=" Value:";
-                               temp+=_value;
-                       }
-                       temp+=" [Input Port]";
+                       temp+="(";
+                       temp+=_value;
+                       temp+=")";
                }
+               temp+=" ";
+               temp+=_bbtkType;
 
                return temp;
        }
index 0494e705b1c4868e5ef6b227dc08f939132439ee..f9319af848bf0a5e6ab194cc7ae375436217f85d 100644 (file)
@@ -59,10 +59,10 @@ namespace bbtk
        const int CREATING_CONTOUR=106;
 
        // Object dimensions
-       const double BOX_HEIGHT         =       15;
+       const double BOX_HEIGHT         =       10;
        const double BOX_WIDTH          =       100;
-       const double PORT_HEIGHT        =       2.5;
-       const double PORT_WIDTH         =       2.5;
+       const double PORT_HEIGHT        =       2.8;
+       const double PORT_WIDTH         =       2.8;
 
        // Commands
        const int NO_COMMAND = 201;
index a4f6965e6cb9485084bac36b4361c6fb548767a7..9d24f21b9db030a5ba788f45c0e7509bff7ee425 100644 (file)
@@ -71,7 +71,7 @@ namespace bbtk
                _fillPolyMapper->Modified();
                //-----------
 
-               updatePositionTextActors(xInic, yInic,zInic);
+               updatePositionTextActor(xInic, yInic,zInic);
 
                //-----------
                setRefreshWaiting();
@@ -144,31 +144,25 @@ namespace bbtk
 
                //------------
 
-               _nameActor = vtkTextActor3D::New();
-               std::string temp = _model->getBBTKName();
-               _nameActor->GetTextProperty()->SetFontSize(80);
-               _nameActor->GetTextProperty()->BoldOn();
-               _nameActor->SetInput(temp.c_str());
+               _boxTextActor = vtkTextActor3D::New();
+               std::string temp = _model->getBBTKType();
+               temp+=":";
+               temp+=_model->getBBTKName();
+               _boxTextActor->GetTextProperty()->SetFontSize(80);
+               _boxTextActor->GetTextProperty()->BoldOn();
+               _boxTextActor->SetInput(temp.c_str());
 
                //------------
 
-               _typeActor = vtkTextActor3D::New();
-               temp = _model->getBBTKType();
-               _typeActor->GetTextProperty()->SetFontSize(80);
-               _typeActor->GetTextProperty()->BoldOn();
-               _typeActor->SetInput(temp.c_str());
-
-               //------------
-
-               updatePositionTextActors( xInic,  yInic,  zInic);
+               updatePositionTextActor( xInic,  yInic,  zInic);
        }
 
        //=========================================================================
 
        void vtkGBlackBoxView::addVtkActors()//virtual
        {
-               _baseView->GetRenderer()->AddActor(_nameActor);
-               _baseView->GetRenderer()->AddActor(_typeActor);
+               _baseView->GetRenderer()->AddActor(_borderObjectActor);
+               _baseView->GetRenderer()->AddActor(_boxTextActor);
                vtkGObjectView::addVtkActors();
        }
 
@@ -176,20 +170,17 @@ namespace bbtk
 
        void vtkGBlackBoxView::removeVtkActors()//virtual
        {
-               _baseView->GetRenderer()->RemoveActor(_nameActor);
-               _baseView->GetRenderer()->RemoveActor(_typeActor);
+               _baseView->GetRenderer()->RemoveActor(_borderObjectActor);
+               _baseView->GetRenderer()->RemoveActor(_boxTextActor);
                vtkGObjectView::removeVtkActors();
        }
 
        //=========================================================================
 
-       void vtkGBlackBoxView::updatePositionTextActors(double xInic, double yInic, double zInic)
+       void vtkGBlackBoxView::updatePositionTextActor(double xInic, double yInic, double zInic)
        {
-               _nameActor->SetPosition(xInic+4,yInic-5,zInic);
-               _nameActor->SetScale(0.04,0.04,1);
-                                       
-               _typeActor->SetPosition(xInic+4,yInic-10,zInic);
-               _typeActor->SetScale(0.04,0.04,1);
+               _boxTextActor->SetPosition(xInic+4,yInic-7,zInic);
+               _boxTextActor->SetScale(0.05,0.05,1);
        }
 
        //=========================================================================
@@ -203,8 +194,7 @@ namespace bbtk
                        _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);
-                       _nameActor->GetTextProperty()->SetColor(BOXTEXT_NH_R,BOXTEXT_NH_G,BOXTEXT_NH_B);
-                       _typeActor->GetTextProperty()->SetColor(BOXTEXT_NH_R,BOXTEXT_NH_G,BOXTEXT_NH_B);
+                       _boxTextActor->GetTextProperty()->SetColor(BOXTEXT_NH_R,BOXTEXT_NH_G,BOXTEXT_NH_B);
 
                        GBlackBoxModel *bbmodel = (GBlackBoxModel*)_model;
                        if(bbmodel->isExecutable())
@@ -220,24 +210,21 @@ namespace bbtk
                        
                        _borderObjectActor->GetProperty()->SetColor(BOXBORDER_HIGHLIGHTED_R,BOXBORDER_HIGHLIGHTED_G,BOXBORDER_HIGHLIGHTED_B);
                        _fillObjectActor->GetProperty()->SetColor(BOXFILL_HIGHLIGHTED_R,BOXFILL_HIGHLIGHTED_G,BOXFILL_HIGHLIGHTED_B);
-                       _nameActor->GetTextProperty()->SetColor(BOXTEXT_HIGHLIGHTED_R,BOXTEXT_HIGHLIGHTED_G,BOXTEXT_HIGHLIGHTED_B);
-                       _typeActor->GetTextProperty()->SetColor(BOXTEXT_HIGHLIGHTED_R,BOXTEXT_HIGHLIGHTED_G,BOXTEXT_HIGHLIGHTED_B);
+                       _boxTextActor->GetTextProperty()->SetColor(BOXTEXT_HIGHLIGHTED_R,BOXTEXT_HIGHLIGHTED_G,BOXTEXT_HIGHLIGHTED_B);
                }
                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);
-                       _nameActor->GetTextProperty()->SetColor(BOXTEXT_DRAG_R,BOXTEXT_DRAG_G,BOXTEXT_DRAG_B);
-                       _typeActor->GetTextProperty()->SetColor(BOXTEXT_DRAG_R,BOXTEXT_DRAG_G,BOXTEXT_DRAG_B);
+                       _boxTextActor->GetTextProperty()->SetColor(BOXTEXT_DRAG_R,BOXTEXT_DRAG_G,BOXTEXT_DRAG_B);
                }
                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);
-                       _nameActor->GetTextProperty()->SetColor(BOXTEXT_SELECTED_R,BOXTEXT_SELECTED_G,BOXTEXT_SELECTED_B);
-                       _typeActor->GetTextProperty()->SetColor(BOXTEXT_SELECTED_R,BOXTEXT_SELECTED_G,BOXTEXT_SELECTED_B);
+                       _boxTextActor->GetTextProperty()->SetColor(BOXTEXT_SELECTED_R,BOXTEXT_SELECTED_G,BOXTEXT_SELECTED_B);
                }
        }
 
index 466fb002cbbfd1c837ab9ed47d26f6539dd36b0d..5eee4e1775d0603cb25adfeb91db7f60d0e744fd 100644 (file)
@@ -85,11 +85,10 @@ namespace bbtk
        private:
 
                //Private Attributes
-               vtkTextActor3D* _nameActor;
-               vtkTextActor3D* _typeActor;
+               vtkTextActor3D* _boxTextActor;
 
                //Private Methods
-               void updatePositionTextActors(double xInic, double yInic, double zInic);
+               void updatePositionTextActor(double xInic, double yInic, double zInic);
 
        protected:
 
index 964c38825ef73075dfd98672338904c0c4a778e2..79026ba73c1b7d1aea6d60a8da0d51441460a497 100644 (file)
@@ -101,8 +101,7 @@ namespace bbtk
        //=========================================================================
 
        void vtkGObjectView::addVtkActors()//virtual
-       {
-               _baseView->GetRenderer()->AddActor(_borderObjectActor);
+       {               
                _baseView->GetRenderer()->AddActor(_fillObjectActor);
                _baseView->GetRenderer()->Render();
        }
@@ -111,7 +110,6 @@ namespace bbtk
 
        void vtkGObjectView::removeVtkActors()//virtual
        {
-               _baseView->GetRenderer()->RemoveActor(_borderObjectActor);
                _baseView->GetRenderer()->RemoveActor(_fillObjectActor);
                _baseView->GetRenderer()->Render();
        }
index 6633e1fe3bcff3c876dd21532838958ca049de83..a56cd3b7eae38be363a6681d9e6cc5de77409301 100644 (file)
@@ -68,7 +68,6 @@ namespace bbtk
                _pts->SetPoint(1, mid, yFin, zInic );
                _pts->SetPoint(2, xFin, yInic, zFin );
 
-               _borderObjectActor->Modified();
                _fillPolyMapper->Modified();
                
                setRefreshWaiting();
@@ -79,11 +78,6 @@ namespace bbtk
        void vtkGPortView::createVtkObjects() //virtual
        {
                _pts = vtkPoints::New();        
-               vtkCellArray *lines = vtkCellArray::New();
-               vtkPolyData *_pd = vtkPolyData::New();
-               _borderPolyMapper=vtkPolyDataMapper::New();
-               _borderObjectActor=vtkActor::New();
-               
                _pts->SetNumberOfPoints(3);
 
                double xInic, yInic,zInic,xFin, yFin,zFin;
@@ -97,22 +91,8 @@ namespace bbtk
 
                _pts->SetPoint(0, xInic, yInic, zInic );
                _pts->SetPoint(1, mid, yFin, zInic );
-               _pts->SetPoint(2, xFin, yInic, zFin );
-                               
-               lines->InsertNextCell(4);
-               lines->InsertCellPoint(0);
-               lines->InsertCellPoint(1);
-               lines->InsertCellPoint(2);
-               lines->InsertCellPoint(0);
+               _pts->SetPoint(2, xFin, yInic, zFin );                          
                        
-               _pd->SetPoints( _pts );
-               _pd->SetLines( lines );
-
-               _borderPolyMapper->SetInput(_pd);
-               _borderObjectActor->SetMapper(_borderPolyMapper);
-               _borderPolyMapper->Modified();
-
-               
                ///************************* FILL *************************
 
                vtkCellArray *strip = vtkCellArray::New();
@@ -145,29 +125,26 @@ namespace bbtk
 
        void vtkGPortView::updateColors()
        {
-               _borderObjectActor->GetProperty()->SetColor(BOXBORDER_NH_R,BOXBORDER_NH_G,BOXBORDER_NH_B);
-               _fillObjectActor->GetProperty()->SetColor(0.6,0.6,0.6);
+               _fillObjectActor->GetProperty()->SetColor(0.5,0.45,0.45);
 
                if(_state==HIGHLIGHTED)
                {
-                       _borderObjectActor->GetProperty()->SetColor(0.35,0.15,0.1);
                        _fillObjectActor->GetProperty()->SetColor(0.8,0.8,0.8);
                }
                else
                {
                        GPortModel* portm = (GPortModel*)_model;
-                       _borderObjectActor->GetProperty()->SetColor(0.15,0.15,0.15);
                        if(portm->isConnected())
                        {
-                               _fillObjectActor->GetProperty()->SetColor(0.2,0.2,0.2);
+                               _fillObjectActor->GetProperty()->SetColor(0.15,0.15,0.15);
                        }
                        else if(portm->isValueSet())
                        {
-                               _fillObjectActor->GetProperty()->SetColor(0.5,0.2,0.2);
+                               _fillObjectActor->GetProperty()->SetColor(0.55,0.25,0.25);
                        }
                        else 
                        {
-                               _fillObjectActor->GetProperty()->SetColor(0.6,0.6,0.6);
+                               _fillObjectActor->GetProperty()->SetColor(0.5,0.45,0.45);
                        }
                }
        }
index a6af50463259997f3ff631769dc3c370e0983cec..fdde6ad262f97e498ac6892df30ddd81aaf52d3d 100644 (file)
@@ -43,10 +43,12 @@ namespace bbtk
        wxBlackBoxEditionDialog::wxBlackBoxEditionDialog(wxGUIEditorGraphicBBS *parent,GBlackBoxModel *model):wxDialog(parent,wxID_ANY,_T(""), wxDefaultPosition, wxSize(480, 640),wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
        {
                _model=model;
-               std::string title("BlackBox Editing - Name:");
-               title+=_model->getBBTKName();
-               title+=" Type:";
+               std::string title("BlackBox Editing - ");
+               title+=_model->getBBTKPackage();
+               title+=":";
                title+=_model->getBBTKType();
+               title+=":";
+               title+=_model->getBBTKName();
                SetTitle(std2wx(title));
 
                constructBlackBoxEditionDialog();
@@ -81,10 +83,11 @@ namespace bbtk
                for(int i = 0;i<lstInputs.size();i++)
                {
                        GPortModel* port = lstInputs[i];
+                       std::string type = port->getBBTKType();
                        wxStaticText *lblName = new wxStaticText(this, -1, std2wx(port->getBBTKName()),wxDefaultPosition,wxSize(100,25));
-                       wxStaticText *lblType = new wxStaticText(this, -1, std2wx(port->getBBTKType()),wxDefaultPosition,wxSize(250,25));
+                       wxStaticText *lblType = new wxStaticText(this, -1, std2wx(type),wxDefaultPosition,wxSize(250,25));
                        wxTextCtrl *txtValue = new wxTextCtrl(this, -1, _T(""),wxDefaultPosition,wxSize(90,25));
-
+                       
                        if(port->getValue()!="")
                        {
                                txtValue->SetLabel(crea::std2wx(port->getValue()));
@@ -97,13 +100,21 @@ namespace bbtk
                                txtValue->SetEditable(false);
                        }
 
-                       _lstNames.push_back(lblName);
-                       _lstTypes.push_back(lblType);
+                       char et = '*';
+                       if(type.find(et)!=-1)
+                       {
+                               std::string noEditable("--No editable--");
+                               txtValue->SetLabel(crea::std2wx(noEditable));
+                               txtValue->SetEditable(false);
+                       }
+
+                       _lstNames.push_back(lblName);                   
                        _lstValues.push_back(txtValue);
+                       _lstTypes.push_back(lblType);
                        
-                       sizer->Add(lblName,1,wxEXPAND,5);
-                       sizer->Add(lblType,1,wxCENTRE|wxEXPAND,5);
+                       sizer->Add(lblName,1,wxEXPAND,5);                       
                        sizer->Add(txtValue,1,wxEXPAND,5);
+                       sizer->Add(lblType,1,wxCENTRE|wxEXPAND,5);
                        
                }
                
@@ -122,6 +133,7 @@ namespace bbtk
                sizerDialog->Add(text,0,wxALIGN_TOP|wxALIGN_CENTER);
                sizerDialog->AddSpacer(15);
                sizerDialog->Add(sizer,0,wxALIGN_CENTER);
+               sizerDialog->AddSpacer(15);
                sizerDialog->Add(buts,0,wxALIGN_CENTER | wxTOP | wxBOTTOM);
 
                SetSizer(sizerDialog);