]> Creatis software - bbtkGEditor.git/commitdiff
no message
authordavila <>
Wed, 22 Sep 2010 23:14:07 +0000 (23:14 +0000)
committerdavila <>
Wed, 22 Sep 2010 23:14:07 +0000 (23:14 +0000)
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGObjectView.h
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h

index f502df6232e3f1c712fa439329de352c69b07f38..2f6e14ded6de95ef8ba5d200384951546a9581d9 100644 (file)
@@ -113,17 +113,14 @@ namespace bbtk
 
                //Protected Attributes
                
-               wxVtkBaseView *_baseView;
-
-               GObjectModel *_model;
-
-               vtkActor *_borderObjectActor;
-               vtkActor *_fillObjectActor;
-
-               vtkPolyDataMapper* _fillPolyMapper;
-               vtkPolyDataMapper* _borderPolyMapper;
-
-               vtkPoints *_pts;
+               wxVtkBaseView           * _baseView;
+               GObjectModel            * _model;
+               vtkActor                        * _borderObjectActor;
+               vtkActor                        * _fillObjectActor;
+               vtkPolyDataMapper       * _fillPolyMapper;
+               vtkPolyDataMapper       * _borderPolyMapper;
+
+               vtkPoints                       *_pts;
 
                // State of the object (See GlobalConstants.h)
                int  _state;
index f5313e7e7c7823f69ae07044082cda8831d188b3..2570305265dc8684aef498aa173f121eb32b6f5c 100644 (file)
@@ -43,12 +43,12 @@ namespace bbtk
        //=========================================================================
        wxVtkSceneManager::wxVtkSceneManager(wxGEditorTabPanel *parent, wxVtk3DBaseView *baseView,int idManager)
        {
-               _parent = parent;
-               _numBoxes=0;
-               _idManager=idManager;
-               _baseView=baseView;
-               _startDragging=false;
-               _isComplexBox=false;
+               _parent                 = parent;
+               _numBoxes               = 0;
+               _idManager              = idManager;
+               _baseView               = baseView;
+               _startDragging  = false;
+               _isComplexBox   = false;
 
                if( _baseView!=NULL )
                {
@@ -61,8 +61,8 @@ namespace bbtk
                        registerController(this);
                        
                }
-               _idConnectionInCreation=-1;
-               _contLastId=0;
+               _idConnectionInCreation = -1;
+               _contLastId                             = 0;
 
        }
 
@@ -103,6 +103,12 @@ namespace bbtk
                _baseView->GetRenderer()->SetBackground(0.9,0.9,0.9);
                _baseView->GetRenderer()->GradientBackgroundOff();
                _baseView->Refresh();
+               
+               _textActor = vtkTextActor3D::New();
+               _textActor->SetPosition(  100 , 100 , 900 );
+               _textActor->SetInput( "Ups EED" );
+               _baseView->GetRenderer()->AddActor( _textActor );
+               
        }
 
        //=========================================================================
@@ -135,7 +141,6 @@ namespace bbtk
        }
 
        //=========================================================================
-//ups1 eed
        void wxVtkSceneManager::configGBlackBox(int idBox, double xIn, double yIn, double zIn, std::string name, bool boxExecutable,double xEn,double yEn,double zEn)
        {
                GObjectController *cont = _controllers[idBox];
@@ -606,6 +611,8 @@ namespace bbtk
        bool wxVtkSceneManager::OnMouseMove()
        {
                int X,Y;
+               bool okStatusMessage    = false;
+               bool okPortMessage              = false;
                wxVTKRenderWindowInteractor *wxVTKiren;
                wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
                wxVTKiren->GetEventPosition(X,Y);
@@ -644,25 +651,46 @@ namespace bbtk
                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);
                                
                                if(state == HIGHLIGHTED){
-
+                                       okStatusMessage = true;
                                        updateStatusBar(desc->getStatusText());
                                        if(type==GBLACKBOX)
                                        {
                                                GBlackBoxModel *mod = (GBlackBoxModel*)desc->getModel();
                                                _parent->displayBlackBoxInfo(mod->getBBTKPackage(),mod->getBBTKType());
-                                       }
-                               }
-                       }
+                                       } // if GBLACKBOX
+                                       if(type==GPORT)
+                                       {
+                                               okPortMessage   =       true;
+                                               _textActor->SetInput( desc->getStatusText().c_str() );
+                                               _textActor->SetScale(1);
+//ups1 EED
+                                               _textActor->SetPosition(  px ,py , pz+1 );
+                                       } // if GPORT
+
+                               } // for controllers it
+                       } 
                }
                
+               if (okStatusMessage==false) 
+               {
+                       updateStatusBar("");
+               }
+               
+               if (okPortMessage==false) 
+               {
+                       _textActor->SetScale(0.0001);
+               }
+               
+
                return true;
        }
 
index 436903a3ed893a36cd11df5049735aec72e80a05..6baf98c4b342bd0cf2e78b846a54fb8719f3565c 100644 (file)
@@ -74,7 +74,7 @@ Version:   $Revision$
 #include <vtkRenderWindowInteractor.h>
 #include <vtkRenderer.h>
 #include <vtkInteractorStyleImage.h>
-
+#include <vtkTextActor3D.h>
 
 //Includes std
 #include <iostream>
@@ -218,6 +218,8 @@ namespace bbtk
                int _idConnectionInCreation;
 
                int _contLastId;
+               
+               vtkTextActor3D *_textActor;
 
        protected: