void ViewerNV::Process()
{
- vtkImageData* img = bbGetInputIn();
+ vtkImageData* img = bbGetInputIn();
/*
double spc[3];
img->GetSpacing(spc);
mwxwidget->SetType(&type);
mwxwidget->UpdateLayout(img);
}else if (img != currentimg){
- mwxwidget->SetImage(img);
+ mwxwidget->SetImage(img);
//mwxwidget->UpdateLayout(img);
}
if (wvbv3!=NULL) { bbSetOutputRenderer3( wvbv3->GetRenderer() ); }
if (wvbv4!=NULL) { bbSetOutputRenderer4( wvbv4->GetRenderer() ); }
- if (wvbv1!=NULL) { bbSetOutputInteractor1( wvbv1->GetWxVTKRenderWindowInteractor() ); }
+ if (wvbv1!=NULL) { bbSetOutputInteractor1( wvbv1->GetWxVTKRenderWindowInteractor() );
+ updateObservers();
+ }
if(bbGetInputColorFunction()!=NULL){
mwxwidget->setColorTransferFunction(bbGetInputColorFunction());
}
}
+
}// mwxwidget != NULL
}
mwxwidget = NULL;
bbSetInputIn(NULL);
+ bbSetInputObs1(NULL);
+ bbSetInputObs2(NULL);
+ bbSetInputObs3(NULL);
+ bbSetInputObs4(NULL);
+ bbSetInputObs5(NULL);
+
std::vector<int> vecNTypeViwer;
vecNTypeViwer.push_back(5);
vecNTypeViwer.push_back(0);
}
+void ViewerNV::updateObservers(){
+ vtkRenderWindowInteractor* interactor;
+ interactor = bbGetOutputInteractor1();
+ if(interactor){
+ if (bbGetInputObs1()!=NULL){
+ bbGetInputObs1()->SetInteractor(interactor);
+ bbGetInputObs1()->EnabledOn();
+ }
+ if (bbGetInputObs2()!=NULL)
+ {
+ bbGetInputObs2()->SetInteractor(interactor);
+ bbGetInputObs2()->EnabledOn();
+ }
+ if (bbGetInputObs3()!=NULL)
+ {
+ bbGetInputObs3()->SetInteractor(interactor);
+ bbGetInputObs3()->EnabledOn();
+ }
+ if (bbGetInputObs4()!=NULL)
+ {
+ bbGetInputObs4()->SetInteractor(interactor);
+ bbGetInputObs4()->EnabledOn();
+ }
+ if (bbGetInputObs5()!=NULL)
+ {
+ bbGetInputObs5()->SetInteractor(interactor);
+ bbGetInputObs5()->EnabledOn();
+ }
+ }
+}
+
}
// EO namespace bbcreaMaracasVisu
BBTK_DECLARE_INPUT(nTypeView, std::vector<int> );
BBTK_DECLARE_INPUT(ColorFunction, vtkColorTransferFunction* );
BBTK_DECLARE_INPUT(WindowLevel, int );
- BBTK_DECLARE_INPUT(ColorLevel, int );
+ BBTK_DECLARE_INPUT(ColorLevel, int );
+ BBTK_DECLARE_INPUT(Obs1, vtkInteractorObserver *);
+ BBTK_DECLARE_INPUT(Obs2, vtkInteractorObserver *);
+ BBTK_DECLARE_INPUT(Obs3, vtkInteractorObserver *);
+ BBTK_DECLARE_INPUT(Obs4, vtkInteractorObserver *);
+ BBTK_DECLARE_INPUT(Obs5, vtkInteractorObserver *);
BBTK_DECLARE_OUTPUT(wxVtkBaseView1,wxVtkBaseView*);
BBTK_DECLARE_OUTPUT(wxVtkBaseView2,wxVtkBaseView*);
BBTK_DECLARE_OUTPUT(wxVtkBaseView3,wxVtkBaseView*);
wxMaracas_N_ViewersWidget *mwxwidget;
bool compareVectors(std::vector<int> type,std::vector<int> currenttype);
+ void updateObservers();
};
BBTK_BEGIN_DESCRIBE_BLACK_BOX(ViewerNV,bbtk::WxBlackBox);
BBTK_INPUT(ViewerNV,ColorFunction,"Optional: set a different color for the viewers 2D",vtkColorTransferFunction*,"");
BBTK_INPUT(ViewerNV,WindowLevel,"Optional: set a different Window level by using an other widget",int,"");
BBTK_INPUT(ViewerNV,ColorLevel,"Optional: set a different Color level by using an other widget",int,"");
+ BBTK_INPUT(ViewerNV,Obs1,"Optional: set a different Color level by using an other widget",vtkInteractorObserver*,"");
+ BBTK_INPUT(ViewerNV,Obs2,"Optional: set a different Color level by using an other widget",vtkInteractorObserver*,"");
+ BBTK_INPUT(ViewerNV,Obs3,"Optional: set a different Color level by using an other widget",vtkInteractorObserver*,"");
+ BBTK_INPUT(ViewerNV,Obs4,"Optional: set a different Color level by using an other widget",vtkInteractorObserver*,"");
+ BBTK_INPUT(ViewerNV,Obs5,"Optional: set a different Color level by using an other widget",vtkInteractorObserver*,"");
BBTK_OUTPUT(ViewerNV,wxVtkBaseView1,"wxVtkBaseView 1",wxVtkBaseView *,"");
BBTK_OUTPUT(ViewerNV,wxVtkBaseView2,"wxVtkBaseView 2",wxVtkBaseView *,"");
BBTK_OUTPUT(ViewerNV,wxVtkBaseView3,"wxVtkBaseView 3",wxVtkBaseView *,"");
Program: wxMaracas
Module: $RCSfile: wxMaracasSurfaceRendering.cxx,v $
Language: C++
- Date: $Date: 2010/01/13 13:53:55 $
- Version: $Revision: 1.10 $
+ Date: $Date: 2010/01/21 13:54:15 $
+ Version: $Revision: 1.11 $
Copyright: (c) 2002, 2003
License:
}
}
+bool wxMaracasSurfaceRendering::interactorSet(){
+ return surrendmanager->interactorSet();
+}
+
/**
**
**/
Program: wxMaracas
Module: $RCSfile: wxMaracasSurfaceRendering.h,v $
Language: C++
- Date: $Date: 2009/11/13 11:47:41 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2010/01/21 13:54:15 $
+ Version: $Revision: 1.4 $
Copyright: (c) 2002, 2003
License:
std::string getPath();
void deleteActor(int propid);
+
+ bool interactorSet();
private:
static wxMaracasSurfaceRendering* instance;
Program: wxMaracas
Module: $RCSfile: wxMaracasSurfaceRenderingManager.cxx,v $
Language: C++
- Date: $Date: 2009/11/17 10:24:35 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2010/01/21 13:54:15 $
+ Version: $Revision: 1.7 $
Copyright: (c) 2002, 2003
License:
}
+bool wxMaracasSurfaceRenderingManager::interactorSet(){
+ return _interactor? true:false;
+}
\ No newline at end of file
Program: wxMaracas
Module: $RCSfile: wxMaracasSurfaceRenderingManager.h,v $
Language: C++
- Date: $Date: 2009/11/17 10:23:24 $
- Version: $Revision: 1.4 $
+ Date: $Date: 2010/01/21 13:54:15 $
+ Version: $Revision: 1.5 $
Copyright: (c) 2002, 2003
License:
void deleteActor(int propid)throw (char *);
void Transform(vtkMatrix4x4* tmatrix);
+
+ bool interactorSet();
private:
std::vector<wxMaracasSurfaceRenderingManagerData*> prop3Dvect;
_boxWidgetS1->SetInput( this->_imagedata );
_boxWidgetS1->PlaceWidget();
- boxSurfaceObserver* observer = boxSurfaceObserver::New();
-
- _boxWidgetS1->HandlesOn ();
- _boxWidgetS1->On();
+ boxSurfaceObserver* observer = boxSurfaceObserver::New();
vtkStripper* striper = vtkStripper::New();
striper->SetInput( _cleanFilter->GetOutput() );
_boxWidgetS1->AddObserver( vtkCommand::InteractionEvent , observer );
-
+ _boxWidgetS1->HandlesOn ();
+ _boxWidgetS1->On();
}else{
_dataMapper->SetInput(_cleanFilter->GetOutput());
}
Connect(checkbox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction)&wxMaracasSurfaceRenderingProp3D::onCheckBoxChange);
checkbox->SetValue(true);
checkboxsizer->Add(checkbox,wxFIXED_MINSIZE);
- /*
- checkboxsurface = new wxCheckBox(this,-1,wxString(_T("Surface Box")));
- Connect(checkboxsurface->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction)&wxMaracasSurfaceRenderingProp3D::onCheckBoxSurfaceChange);
- checkboxsurface->SetValue(true);
- checkboxsizer->Add(checkboxsurface,wxFIXED_MINSIZE);
- */
+
+
+ if(wxMaracasSurfaceRendering::getInstance()->interactorSet()){
+ checkboxsurface = new wxCheckBox(this,-1,wxString(_T("Surface Box")));
+ Connect(checkboxsurface->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction)&wxMaracasSurfaceRenderingProp3D::onCheckBoxSurfaceChange);
+ checkboxsurface->SetValue(true);
+ checkboxsizer->Add(checkboxsurface,wxFIXED_MINSIZE);
+ }
+
sizersurfprop->Add(checkboxsizer,wxFIXED_MINSIZE);
}
Program: wxMaracas
Module: $RCSfile: wxMaracas_ViewerWidget.cxx,v $
Language: C++
- Date: $Date: 2009/12/01 21:22:12 $
- Version: $Revision: 1.21 $
+ Date: $Date: 2010/01/21 13:54:15 $
+ Version: $Revision: 1.22 $
Copyright: (c) 2002, 2003
License:
: wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL)
{
wxPanel *panel = this;
- wxWindow *wxwindow = NULL;
+ wxWindow *wxwindow = NULL, *window3D = 0;
+ double xSpacing, ySpacing, zSpacing;
+ int xMin, xMax, yMin, yMax, zMin, zMax;
+ wxSplitterWindow *panelClipping3D = 0;
+ wxPanel *panelControl = 0, *controlPanelMPR3D = 0, *controlPanelClipping3D = 0;
+ wxFlexGridSizer *sizerCtrol = 0;
+ vtkCellPicker* picker = 0;
+ wxBoxSizer *sizer = 0;
+
mType = type;
mvtk2Dbaseview = new wxVtk2DBaseView(panel);
mvtk2Dbaseview->SetVtkBaseData(mvtkmprbasedata);
wxwindow = mvtk2Dbaseview->GetWxVTKRenderWindowInteractor();
- }
-
-
- if (type==0)
+ }else if (type==0)
{
mvtkmpr2Dview_Z = new wxVtkMPR2DView(panel,2);
mvtkmpr2Dview_Z->SetVtkBaseData(mvtkmprbasedata);
wxwindow = mvtkmpr2Dview_Z->GetWxVTKRenderWindowInteractor();
- }
- if (type==1)
+ }else if (type==1)
{
mvtkmpr2Dview_X = new wxVtkMPR2DView(panel,0);
mvtkmpr2Dview_X->SetVtkBaseData(mvtkmprbasedata);
wxwindow = mvtkmpr2Dview_X->GetWxVTKRenderWindowInteractor();
- }
-
- if (type==2)
+ }else if (type==2)
{
mvtkmpr2Dview_Y = new wxVtkMPR2DView(panel,1);
mvtkmpr2Dview_Y->SetVtkBaseData(mvtkmprbasedata);
wxwindow = mvtkmpr2Dview_Y->GetWxVTKRenderWindowInteractor();
- }
-
-
- if (type==3)
+ }else if (type==3)
{
mwidgetMesure = new wxWidgetMesure2D_Plane_in_MPR(panel);
mvtkplane2Dview = new vtkPlane2DView( mwidgetMesure->GetWindow2());
mvtkplane2Dview -> SetImgSize( 200 );
mvtkplane2Dview -> SetVtkBaseData(mvtkmprbasedata);
wxwindow = mwidgetMesure;
- }
- if (type==4)
+ }else if (type==4)
{
mwxsphereview = new wxSphereView( panel , mvtkmprbasedata, mvtkmprbasedata->GetImageData() );
wxwindow=mwxsphereview->GetWxVTKRenderWindowInteractor();
- }
-
-
- if (type==5)
+ }else if (type==5)
{
- wxSplitterWindow *panelClipping3D = new wxSplitterWindow( panel , -1);
+ panelClipping3D = new wxSplitterWindow( panel , -1);
mwxvtk3Dbaseview_Clipping3D = new wxVtk3DBaseView( panelClipping3D );
mwxvtkclipping3Dview = new wxVtkClipping3DView(mwxvtk3Dbaseview_Clipping3D);
vtkmpr3Ddataviewer->Configure();
mwxvtkmpr3Dview->SetVtkMPR3DDataViewer(vtkmpr3Ddataviewer);
- wxWindow *window3D = mwxvtk3Dbaseview_Clipping3D->GetWxVTKRenderWindowInteractor();
+ window3D = mwxvtk3Dbaseview_Clipping3D->GetWxVTKRenderWindowInteractor();
- wxPanel *panelControl = new wxPanel(panelClipping3D,-1);
- wxPanel *controlPanelMPR3D = mwxvtkmpr3Dview->CreateControlPanel(panelControl, false);
- wxPanel *controlPanelClipping3D = mwxvtkclipping3Dview->CreateControlPanel(panelControl);
+ panelControl = new wxPanel(panelClipping3D,-1);
+ controlPanelMPR3D = mwxvtkmpr3Dview->CreateControlPanel(panelControl, false);
+ controlPanelClipping3D = mwxvtkclipping3Dview->CreateControlPanel(panelControl);
// mbtnCutImageData = new wxCheckBox(panelControl,-1,_T("Cut Module"));
// Connect(_btnCutImageData->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &wxMPRWidget::OnCutImagaData );
- wxFlexGridSizer *sizerCtrol = new wxFlexGridSizer(1);
+ sizerCtrol = new wxFlexGridSizer(1);
sizerCtrol->Add(controlPanelMPR3D , 1, wxALL|wxEXPAND, 2);
sizerCtrol->Add(controlPanelClipping3D , 1, wxALL|wxEXPAND, 2);
// sizerCtrol->Add( mbtnCutImageData , 1, wxALL, 2);
panelClipping3D -> SetMinimumPaneSize( 5 );
panelClipping3D -> SplitHorizontally( panelControl , window3D , 10 );
wxwindow=panelClipping3D;
- }
-
- if (type==6)
+ }else if (type==6)
{
- wxSplitterWindow *panelClipping3D = new wxSplitterWindow( panel , -1);
+ panelClipping3D = new wxSplitterWindow( panel , -1);
mwxvtk3Dbaseview_Clipping3D = new wxVtk3DBaseView( panelClipping3D );
mwxvtkmpr3Dview = new wxVtkMPR3DView( mwxvtk3Dbaseview_Clipping3D );
vtkmpr3Ddataviewer = new vtkMPR3DDataViewer();
+
wxWindow *window3D = mwxvtk3Dbaseview_Clipping3D->GetWxVTKRenderWindowInteractor();
mwxvtkmpr3Dview->SetVtkMPR3DDataViewer(vtkmpr3Ddataviewer);
- }
-
- if (type==7)
- {
- mwxvtk3Dbaseview_Clipping3D = new wxVtk3DBaseView( panel );
- wxWindow *window3D = mwxvtk3Dbaseview_Clipping3D->GetWxVTKRenderWindowInteractor();
- wxwindow=window3D;
-
-/*Borrame
- wxSplitterWindow *panelClipping3D = new wxSplitterWindow( panel , -1);
- mwxvtk3Dbaseview_Clipping3D = new wxVtk3DBaseView( panelClipping3D );
- wxWindow *window3D = mwxvtk3Dbaseview_Clipping3D->GetWxVTKRenderWindowInteractor();
- panelClipping3D ->SetMinimumPaneSize( 5 );
- panelClipping3D ->SplitHorizontally( new wxPanel(panelClipping3D,-1) , window3D , 10 );
- wxwindow=panelClipping3D;
-*/
+ }else if (type==7)
+ {
+
+ mwxvtk3Dbaseview_Clipping3D = new wxVtk3DBaseView( panel );
+ wxwindow = (wxWindow*) mwxvtk3Dbaseview_Clipping3D->GetWxVTKRenderWindowInteractor();
+
-/*Borrame
- wxSplitterWindow *panelClipping3D = new wxSplitterWindow( panel , -1);
- mwxvtk3Dbaseview_Clipping3D = new wxVtk3DBaseView( panelClipping3D );
- mwxvtkmpr3Dview = new wxVtkMPR3DView( mwxvtk3Dbaseview_Clipping3D );
- vtkmpr3Ddataviewer = new vtkMPR3DDataViewer();
- wxWindow *window3D = mwxvtk3Dbaseview_Clipping3D->GetWxVTKRenderWindowInteractor();
- wxPanel *panelControl = new wxPanel(panelClipping3D,-1);
- wxPanel *controlPanelMPR3D = mwxvtkmpr3Dview->CreateControlPanel(panelControl);
- wxFlexGridSizer *sizerCtrol = new wxFlexGridSizer(1);
- sizerCtrol->Add(controlPanelMPR3D , 1, wxALL|wxEXPAND, 2);
- panelControl->SetAutoLayout(true);
- panelControl->SetSizer(sizerCtrol);
- panelControl->SetSize(400,350);
- panelControl->Layout();
- panelClipping3D -> SetMinimumPaneSize( 5 );
- panelClipping3D -> SplitHorizontally( panelControl , window3D , 10 );
- wxwindow=panelClipping3D;
- vtkmpr3Ddataviewer->SetVtkMPRBaseData(mvtkmprbasedata);
- //vtkmpr3Ddataviewer->Configure();
- mwxvtkmpr3Dview->SetVtkMPR3DDataViewer(vtkmpr3Ddataviewer);
-*/
}
- wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
+ sizer = new wxBoxSizer(wxVERTICAL);
sizer->Add( wxwindow , 1, wxGROW);
panel->SetSizer(sizer);
panel->SetAutoLayout(true);
//------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------
+
void wxMaracas_ViewerWidget::ConfigureVTK()
{
if ( mwidgetMesure !=NULL ) { mwidgetMesure -> SetMesureScale( 1 ); }
if ( mwxsphereview !=NULL ) { mwxsphereview -> Configure(); }
- if (mwxvtk3Dbaseview_Clipping3D !=NULL) { mwxvtk3Dbaseview_Clipping3D -> Configure();
+ if (mwxvtk3Dbaseview_Clipping3D !=NULL) {
+ mwxvtk3Dbaseview_Clipping3D -> Configure();
+
}
if (vtkmpr3Ddataviewer !=NULL) {
if (mwxvtkclipping3Dview !=NULL) { mwxvtkclipping3Dview -> Configure(); }
+
+
+
+
//if(vtkmpr3Ddataviewer!=NULL){vtkmpr3Ddataviewer->Configure();}
mwxvtkmpr3Dview->setColorLevel(level);
}*/
}
+
+
Program: wxMaracas
Module: $RCSfile: wxMaracas_ViewerWidget.h,v $
Language: C++
- Date: $Date: 2009/09/15 11:25:07 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2010/01/21 13:54:15 $
+ Version: $Revision: 1.9 $
Copyright: (c) 2002, 2003
License:
// For compilers that support precompilation, includes <wx/wx.h>.
// -----------------------------------------------------------------------------------------------------------
#include <wx/wxprec.h>
+
#ifdef __BORLANDC__
#pragma hdrstop
#endif
wxVtkMPR3DView *mwxvtkmpr3Dview;
- vtkMPR3DDataViewer *vtkmpr3Ddataviewer;
-
+ vtkMPR3DDataViewer *vtkmpr3Ddataviewer;
};