]> Creatis software - bbtkGEditor.git/commitdiff
Ports updated when connected and the properties panel will be changed ...
authorcorredor <>
Tue, 27 Apr 2010 12:54:21 +0000 (12:54 +0000)
committercorredor <>
Tue, 27 Apr 2010 12:54:21 +0000 (12:54 +0000)
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GConnectorModel.cxx
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GPortModel.cxx
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GPortModel.h
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGPortView.cxx
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGPortView.h
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx

index eed5e18f79db27d5790590b90934da68a59a666e..95f1b15e8d0bc96e3cef9cce381f4e8ee66f9f48 100644 (file)
@@ -43,8 +43,8 @@ namespace bbtk
 
        GConnectorModel::GConnectorModel()
        {               
-               //_startPort = NULL;
-               //_endPort = NULL;
+               _startPort = NULL;
+               _endPort = NULL;
        }
 
        //=========================================================================
@@ -58,6 +58,7 @@ namespace bbtk
        void GConnectorModel::setStartPort(GPortModel* startPort)
        {
                _startPort = startPort;
+               startPort->setConnected(true);
                
                double xCenter,yCenter,zCenter;
                startPort->getCenter(xCenter,yCenter,zCenter);
@@ -72,6 +73,7 @@ namespace bbtk
        void GConnectorModel::setEndPort(GPortModel* endPort)
        {
                _endPort = endPort;
+               endPort->setConnected(true);
 
                double xCenter,yCenter,zCenter;         
                endPort->getCenter(xCenter,yCenter,zCenter);
index 5a31568bb1aef6ec1664f3a2a9b92025fb6536e7..161efa7cc303f5f6df0f4e7e632c77c6640fc508 100644 (file)
@@ -46,6 +46,7 @@ namespace bbtk
                _parentBox = NULL;
                _portType=-1;
                _posInBox=0;
+               _isConnected=false;
        }
 
        //=========================================================================
@@ -133,6 +134,18 @@ namespace bbtk
 
        //=========================================================================
 
+       bool GPortModel::isConnected()
+       {
+               return _isConnected;
+       }
+
+       //=========================================================================
+       
+       void GPortModel::setConnected(bool value)
+       {
+               _isConnected=value;
+       }
+
 }  // EO namespace bbtk
 
 // EOF
index fd455719a09f25244cf8f200bcbd1b27714cf69c..0ee17f14891610a88348a3bd73475aadeadf0b6a 100644 (file)
@@ -74,6 +74,8 @@ namespace bbtk
                int getPortType();
                GBlackBoxModel* getParentBox();
                virtual std::string getStatusText();
+               bool isConnected();
+               void setConnected(bool value);
 
        private:
 
@@ -83,6 +85,7 @@ namespace bbtk
 
                int _portType;
                int _posInBox;
+               bool _isConnected;
 
                //Private Methods
 
index a21ba849c2e44a5c14a7d58d977406ec16a066b4..97a89586b32ac5bbb75ecd7bba22a2c1ec7cff9e 100644 (file)
@@ -69,6 +69,7 @@ namespace bbtk
                _pts->SetPoint(2, xFin, yInic, zFin );
 
                _borderObjectActor->Modified();
+               _fillPolyMapper->Modified();
                
                setRefreshWaiting();
        }
@@ -109,7 +110,31 @@ namespace bbtk
 
                _borderPolyMapper->SetInput(_pd);
                _borderObjectActor->SetMapper(_borderPolyMapper);
-               _borderObjectActor->Modified();
+               _borderPolyMapper->Modified();
+
+               
+               ///************************* FILL *************************
+
+               vtkCellArray *strip = vtkCellArray::New();
+               vtkPolyData *pdFill = vtkPolyData::New();
+               _fillPolyMapper=vtkPolyDataMapper::New();
+               _fillObjectActor=vtkActor::New();
+
+               // RaC In the actual version, zInic=zFin=900
+
+               strip->InsertNextCell(3);
+               strip->InsertCellPoint(0);
+               strip->InsertCellPoint(1);
+               strip->InsertCellPoint(2);
+                       
+               pdFill->SetPoints( _pts );
+               pdFill->SetStrips( strip );
+
+               _fillPolyMapper->SetInput(pdFill);
+               _fillObjectActor->SetMapper(_fillPolyMapper);
+               _fillPolyMapper->Modified();
+
+               ///************************* FILL *************************
 
                updateColors();
 
@@ -121,14 +146,25 @@ 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);
 
                if(_state==HIGHLIGHTED)
                {
-                       _borderObjectActor->GetProperty()->SetColor(0.8,0.2,0.5);
+                       _borderObjectActor->GetProperty()->SetColor(0.35,0.15,0.1);
+                       _fillObjectActor->GetProperty()->SetColor(0.8,0.8,0.8);
                }
                else
                {
-                       _borderObjectActor->GetProperty()->SetColor(0.3,0.2,0.2);
+                       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);
+                       }
+                       else
+                       {
+                               _fillObjectActor->GetProperty()->SetColor(0.6,0.6,0.6);
+                       }
                }
        }
 
index 7f94560985082ee0b496c2e157e2210427d86afe..2c854c6eddbf0becabe68aa89e2b4dd59e438aef 100644 (file)
@@ -46,6 +46,7 @@ Version:   $Revision$
 //Includes same project
 #include "GlobalConstants.h"
 #include "vtkGObjectView.h"
+#include "GPortModel.h"
 
 //Includes creaMaracasVisu
 #include "vtkInteractorStyleBaseView.h"
index 9c63350ffa8a46baedc00a0693f337a46ef478ca..bea7df0f96c42e0b36e4405c92f0b3e81192ab22 100644 (file)
@@ -156,7 +156,7 @@ namespace bbtk
        void wxGUIEditorGraphicBBS::initPropertiesPanel()
        {
                _propertiesPanel = new wxPropertiesPanel(this);
-               _frameAUIMgr->AddPane(_propertiesPanel,wxAuiPaneInfo().Right().MinSize(200,200).CloseButton(false).Floatable(false));
+               //_frameAUIMgr->AddPane(_propertiesPanel,wxAuiPaneInfo().Right().MinSize(200,200).CloseButton(false).Floatable(false));
        }
 
        //================================================================