From 6bb706f241008994b08baa2e44fe414f2277c5ab Mon Sep 17 00:00:00 2001 From: davila <> Date: Wed, 22 Sep 2010 23:14:07 +0000 Subject: [PATCH] no message --- .../bbsVtkGUIEditorGraphic/vtkGObjectView.h | 19 +++--- .../wxVtkSceneManager.cxx | 60 ++++++++++++++----- .../bbsWxGUIEditorGraphic/wxVtkSceneManager.h | 4 +- 3 files changed, 55 insertions(+), 28 deletions(-) diff --git a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGObjectView.h b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGObjectView.h index f502df6..2f6e14d 100644 --- a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGObjectView.h +++ b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGObjectView.h @@ -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; diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx index f5313e7..2570305 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx @@ -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::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; } diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h index 436903a..6baf98c 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h @@ -74,7 +74,7 @@ Version: $Revision$ #include #include #include - +#include //Includes std #include @@ -218,6 +218,8 @@ namespace bbtk int _idConnectionInCreation; int _contLastId; + + vtkTextActor3D *_textActor; protected: -- 2.47.1