//-------------------------------------------------------------
void bbwxMaracas_N_ViewersWidget::OnRefreshView(wxCommandEvent & event)
{
- if (mbbViewerNV->_onshowwidget==true)
+ //EED2024-12-23 Refresh syncronisation (maracasvisu and bbtk)
+ wxMaracas_N_ViewersWidget::OnRefreshView(event);
+ if ( (backX!=(int)GetX()) || (backY!=(int)GetY()) || (backZ!=(int)GetZ()) )
{
- //EED2024-12-23 Refresh syncronisation (maracasvisu and bbtk)
- wxMaracas_N_ViewersWidget::OnRefreshView(event);
- if ( (backX!=(int)GetX()) || (backY!=(int)GetY()) || (backZ!=(int)GetZ()) )
- {
- backX = GetX();
- backY = GetY();
- backZ = GetZ();
- mbbViewerNV->_point.clear();
- mbbViewerNV->_point.push_back( (int)GetX() );
- mbbViewerNV->_point.push_back( (int)GetY() );
- mbbViewerNV->_point.push_back( (int)GetZ() );
- mbbViewerNV->bbSetOutputPoint( mbbViewerNV->_point );
-
- //ED2024-11-01
- bool ok=true;
- if (mbbViewerNV->bbGetInputReactivityType()==0) { ok=false; }
- mbbViewerNV->bbSignalOutputModification(std::string("Point"),ok);
- // if (mbbViewerNV->bbGetInputReactivityType()==1)
- // {
- // mbbViewerNV->bbSignalOutputModification(std::string("Point"),true);
- // } // if type
- } // if X Y Z
- } // if _onshowwidget
+ backX = GetX();
+ backY = GetY();
+ backZ = GetZ();
+ mbbViewerNV->_point.clear();
+ mbbViewerNV->_point.push_back( (int)GetX() );
+ mbbViewerNV->_point.push_back( (int)GetY() );
+ mbbViewerNV->_point.push_back( (int)GetZ() );
+ mbbViewerNV->bbSetOutputPoint( mbbViewerNV->_point );
+
+ //ED2024-11-01
+ bool ok=true;
+ if (mbbViewerNV->bbGetInputReactivityType()==0) { ok=false; }
+ mbbViewerNV->bbSignalOutputModification(std::string("Point"),ok);
+ // if (mbbViewerNV->bbGetInputReactivityType()==1)
+ // {
+ // mbbViewerNV->bbSignalOutputModification(std::string("Point"),true);
+ // } // if type
+ } // if X Y Z
}
//-------------------------------------------------------------
//-------------------------------------------------------------
void ViewerNV::Process()
{
- vtkImageData* img = bbGetInputIn();
- std::vector<int> type = bbGetInputnTypeView();
- if(img != NULL && _mwxwidget != NULL)
- {
- if(!compareVectors(type, _currenttype))
- {
- _mwxwidget->SetType(&type);
+ vtkImageData* img = bbGetInputIn();
+ std::vector<int> type = bbGetInputnTypeView();
+ if(img != NULL && _mwxwidget != NULL)
+ {
+ if(!compareVectors(type, _currenttype))
+ {
+ _mwxwidget->SetType(&type);
_mwxwidget->SetTDxWindow( bbGetInputTDxWindow() );
- _mwxwidget->UpdateLayout(img);
- }else if (img != _currentimg){
- _mwxwidget->SetImage(img);
- }
-// _mwxwidget->RefreshView();
- _currenttype = type;
- _currentimg = img;
- _point.clear();
- _point.push_back( (int)_mwxwidget->GetX() );
- _point.push_back( (int)_mwxwidget->GetY() );
- _point.push_back( (int)_mwxwidget->GetZ() );
- bbSetOutputPoint( _point );
-
- wxVtkBaseView *wvbv1 = _mwxwidget->GetwxVtkBaseView( 1 );
- wxVtkBaseView *wvbv2 = _mwxwidget->GetwxVtkBaseView( 2 );
- wxVtkBaseView *wvbv3 = _mwxwidget->GetwxVtkBaseView( 3 );
- wxVtkBaseView *wvbv4 = _mwxwidget->GetwxVtkBaseView( 4 );
- //wxwidget->RefreshView();
- bbSetOutputwxVtkBaseView1( wvbv1 );
- bbSetOutputwxVtkBaseView2( wvbv2 );
- bbSetOutputwxVtkBaseView3( wvbv3 );
- bbSetOutputwxVtkBaseView4( wvbv4 );
- if (wvbv1!=NULL) { bbSetOutputRenderer1( wvbv1->GetRenderer() ); }
- if (wvbv2!=NULL) { bbSetOutputRenderer2( wvbv2->GetRenderer() ); }
- if (wvbv3!=NULL) { bbSetOutputRenderer3( wvbv3->GetRenderer() ); }
- if (wvbv4!=NULL) { bbSetOutputRenderer4( wvbv4->GetRenderer() ); }
- if (wvbv1!=NULL)
- {
- bbSetOutputInteractor1( wvbv1->GetWxVTKRenderWindowInteractor() );
- updateObservers();
- }
- if(bbGetInputColorFunction()!=NULL)
- {
- _mwxwidget->setColorTransferFunction(bbGetInputColorFunction());
- }
- if( (bbGetInputColorLevel()!=-1) && (bbGetInputWindowLevel()!=-1))
- {
- if(bbGetInputColorLevel() == 0)
- {
- _mwxwidget->SetColorWindowLevel( bbGetInputWindowLevel() , 0.1 );
- }else{
- _mwxwidget->SetColorWindowLevel( bbGetInputWindowLevel() , bbGetInputColorLevel() );
- }
- }
- _mwxwidget->SetInterpolate( bbGetInputInterpolate() );
-/* Borrame
- if (wvbv1!=NULL)
- {
- wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
- //EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
- #if wxMAJOR_VERSION <= 2
- wvbv1->GetWxVTKRenderWindowInteractor ()->GetParent()->ProcessEvent( newevent );
- #else
- wvbv1->GetWxVTKRenderWindowInteractor ()->GetParent()->ProcessWindowEvent( newevent );
- #endif
- }
-*/
- }// mwxwidget != NULL
+ _mwxwidget->UpdateLayout(img);
+ }else if (img != _currentimg){
+ _mwxwidget->SetImage(img);
+ }
+ // _mwxwidget->RefreshView();
+ _currenttype = type;
+ _currentimg = img;
+ _point.clear();
+ _point.push_back( (int)_mwxwidget->GetX() );
+ _point.push_back( (int)_mwxwidget->GetY() );
+ _point.push_back( (int)_mwxwidget->GetZ() );
+ bbSetOutputPoint( _point );
+
+ wxVtkBaseView *wvbv1 = _mwxwidget->GetwxVtkBaseView( 1 );
+ wxVtkBaseView *wvbv2 = _mwxwidget->GetwxVtkBaseView( 2 );
+ wxVtkBaseView *wvbv3 = _mwxwidget->GetwxVtkBaseView( 3 );
+ wxVtkBaseView *wvbv4 = _mwxwidget->GetwxVtkBaseView( 4 );
+ //wxwidget->RefreshView();
+ bbSetOutputwxVtkBaseView1( wvbv1 );
+ bbSetOutputwxVtkBaseView2( wvbv2 );
+ bbSetOutputwxVtkBaseView3( wvbv3 );
+ bbSetOutputwxVtkBaseView4( wvbv4 );
+ if (wvbv1!=NULL) { bbSetOutputRenderer1( wvbv1->GetRenderer() ); }
+ if (wvbv2!=NULL) { bbSetOutputRenderer2( wvbv2->GetRenderer() ); }
+ if (wvbv3!=NULL) { bbSetOutputRenderer3( wvbv3->GetRenderer() ); }
+ if (wvbv4!=NULL) { bbSetOutputRenderer4( wvbv4->GetRenderer() ); }
+ if (wvbv1!=NULL)
+ {
+ bbSetOutputInteractor1( wvbv1->GetWxVTKRenderWindowInteractor() );
+ updateObservers();
+ }
+ if(bbGetInputColorFunction()!=NULL)
+ {
+ _mwxwidget->setColorTransferFunction(bbGetInputColorFunction());
+ }
+ if( (bbGetInputColorLevel()!=-1) && (bbGetInputWindowLevel()!=-1))
+ {
+ if(bbGetInputColorLevel() == 0)
+ {
+ _mwxwidget->SetColorWindowLevel( bbGetInputWindowLevel() , 0.1 );
+ }else{
+ _mwxwidget->SetColorWindowLevel( bbGetInputWindowLevel() , bbGetInputColorLevel() );
+ }
+ }
+ _mwxwidget->SetInterpolate( bbGetInputInterpolate() );
+ /* Borrame
+ if (wvbv1!=NULL)
+ {
+ wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+ //EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+ #if wxMAJOR_VERSION <= 2
+ wvbv1->GetWxVTKRenderWindowInteractor ()->GetParent()->ProcessEvent( newevent );
+ #else
+ wvbv1->GetWxVTKRenderWindowInteractor ()->GetParent()->ProcessWindowEvent( newevent );
+ #endif
+ }
+ */
+ }// mwxwidget != NULL
}
//-------------------------------------------------------------
{
if (_mwxwidget!=NULL)
{
- _onshowwidget = true;
_mwxwidget->Layout();
} // if bbGetOutputWidget
}
void ViewerNV::bbUserSetDefaultValues()
{
_onshowwidget = false;
+ _onshowwidget2 = false;
_currentimg = NULL;
_mwxwidget = NULL;
bbSetInputIn(NULL);