namespace bbcreaMaracasVisu
{
-BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,CutModule2)
-BBTK_BLACK_BOX_IMPLEMENTATION(CutModule2,bbtk::WxBlackBox);
-void CutModule2::Process()
-{
-
- vtkImageData* img = bbGetInputIn();
- vtkRenderWindowInteractor* interactor = bbGetInputInteractor();
- vtkRenderer* render = bbGetInputRenderer();
-
- if(img != NULL && interactor != NULL && render != NULL && _mainpanel!=NULL){
-
- if(_currentimage!=img){
- _currentimage=img;
- _mainpanel->setImageData(img);
- }
+ BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,CutModule2)
+ BBTK_BLACK_BOX_IMPLEMENTATION(CutModule2,bbtk::WxBlackBox);
+ void CutModule2::Process()
+ {
+ vtkImageData* img = bbGetInputIn();
+ vtkRenderWindowInteractor* interactor = bbGetInputInteractor();
+ vtkRenderer* render = bbGetInputRenderer();
+
+ if(img != NULL && interactor != NULL && render != NULL && _mainpanel!=NULL){
+
+ if(_currentimage!=img){
+ _currentimage=img;
+ _mainpanel->setImageData(img);
+ }
+
+ _mainpanel->setInteractor(interactor);
+ _mainpanel->setRenderer(render);
+ bbSetOutputOut(_mainpanel->GetResultImage());
+ }
+ }
+ void CutModule2::CreateWidget(wxWindow* parent)
+ {
+
+ std::string path = crea::System::GetDllAppPath("bbcreaMaracasVisu.dll");
+ _mainpanel = CutModel2MainPanel::getInstance(parent, path);
- _mainpanel->setInteractor(interactor);
- _mainpanel->setRenderer(render);
- bbSetOutputOut(_mainpanel->GetResultImage());
-
- }
-
-}
-void CutModule2::CreateWidget(wxWindow* parent)
-{
-
- std::string path = crea::System::GetDllAppPath("bbcreaMaracasVisu.dll");
- _mainpanel = CutModel2MainPanel::getInstance(parent, path);
-
- bbSetOutputWidget( _mainpanel);
- Process();
-
-}
-void CutModule2::bbUserSetDefaultValues()
-{
- _mainpanel = NULL;
- _currentimage=NULL;
-}
-void CutModule2::bbUserInitializeProcessing()
-{
- bbSetInputIn(0);
- bbSetInputInteractor(0);
- bbSetInputRenderer(0);
-}
-void CutModule2::bbUserFinalizeProcessing()
-{
-
-}
+ bbSetOutputWidget( _mainpanel);
+ Process();
+
+ }
+ void CutModule2::bbUserSetDefaultValues()
+ {
+ _mainpanel = NULL;
+ _currentimage=NULL;
+ }
+ void CutModule2::bbUserInitializeProcessing()
+ {
+ bbSetInputIn(0);
+ bbSetInputInteractor(0);
+ bbSetInputRenderer(0);
+ }
+ void CutModule2::bbUserFinalizeProcessing()
+ {
+
+ }
}
// EO namespace bbcreaMaracasVisu
vtkImageData* _img2 = bbGetInputIn2();
vtkImageData* _img3 = bbGetInputIn3();
vtkImageData* _img4 = bbGetInputIn4();
+
vtkRenderer* renderer = bbGetInputRenderer();
- //vtkRenderer* rendererSA = bbGetInputRendererSA();
- //vtkRenderer* rendererSB = bbGetInputRendererSB();
- //vtkRenderer* rendererSC = bbGetInputRendererSC();
if(view != NULL)
{
+ view->setVtkBaseView( (wxVtk3DBaseView*) bbGetInputwxVtkBaseView() );
+
if(renderer != NULL && _currentrenderer != renderer)
{
view->setRenderer(renderer);
#include "bbtkWxBlackBox.h"
#include "vtkImageData.h"
-//#include "vtkRenderer.h"
#include "vtkProp3D.h"
+#include "vtkRenderer.h"
+#include "wxVtkBaseView.h"
namespace bbcreaMaracasVisu
{
BBTK_BLACK_BOX_INTERFACE(RenderingViewer,bbtk::WxBlackBox);
//BBTK_DECLARE_INPUT(Title,std::string);
BBTK_DECLARE_INPUT(Renderer,vtkRenderer*);
- //BBTK_DECLARE_INPUT(RendererSA,vtkRenderer*);
- //BBTK_DECLARE_INPUT(RendererSB,vtkRenderer*);
- //BBTK_DECLARE_INPUT(RendererSC,vtkRenderer*);
+ BBTK_DECLARE_INPUT(wxVtkBaseView,wxVtkBaseView*);
BBTK_DECLARE_INPUT(In1,vtkImageData*);
BBTK_DECLARE_INPUT(In2,vtkImageData*);
BBTK_DECLARE_INPUT(In3,vtkImageData*);
BBTK_CATEGORY("__CategoryBlackBox__");
//BBTK_INPUT(RenderingViewer,Title,"Title prepended to the text",std::string,"");
BBTK_INPUT(RenderingViewer,Renderer,"Renderer to show volume rendering image" ,vtkRenderer*, "");
+BBTK_INPUT(RenderingViewer,wxVtkBaseView,"wxVtkBaseView",wxVtkBaseView*,"");
//BBTK_INPUT(RenderingViewer,RendererSA,"Renderer to show surface rendering image" ,vtkRenderer*, "");
//BBTK_INPUT(RenderingViewer,RendererSB,"Renderer to show surface rendering image" ,vtkRenderer*, "");
//BBTK_INPUT(RenderingViewer,RendererSC,"Renderer to show surface rendering image" ,vtkRenderer*, "");
}
// EO namespace bbcreaMaracasVisu
+
// std::cout<<"img "<<img<<std::endl;
// std::cout<<"widget "<<mwxwidget<<std::endl;
- if(img != NULL && mwxwidget != NULL){// && !enter){
+// if(img != NULL && mwxwidget != NULL){// && !enter){
+ if( mwxwidget != NULL){// && !enter){
if(!compareVectors(type, currenttype)){
mwxwidget->SetType(&type);
mwxwidget->SetImage(img);
//mwxwidget->UpdateLayout(img);
}
+
+ mwxwidget->ConfigureVTK();
+ mwxwidget->RefreshView();
+
currenttype = type;
currentimg = img;
if(bbGetInputWindowLevel()!=-1){
mwxwidget->setWindowLevel(bbGetInputWindowLevel());
}
+
if(bbGetInputColorLevel()!=-1){
if(bbGetInputColorLevel() == 0){
std::cout<<"colorlevel "<<bbGetInputColorLevel()<<std::endl;
mwxwidget->setColorLevel(bbGetInputColorLevel());
}
}
- }
+
+ }// mwxwidget != NULL
}
//-------------------------------------------------------------
BBTK_CATEGORY("viewer");
BBTK_INPUT(ViewerNV,Title,"Title prepended to the text",std::string,"");
BBTK_INPUT(ViewerNV,In,"Input image",vtkImageData*,"");
- BBTK_INPUT(ViewerNV,nTypeView,"vector of viewer types (default 5 0 1 3 ): -1=Z_2DwithOutAxis 0=Z_2D 1=X_2D 2=Y_2D 3=Plane 4=Sphere 5=3D 6=3Dplane",std::vector<int>,"");
+ BBTK_INPUT(ViewerNV,nTypeView,"vector of viewer types (default 5 0 1 3 ): -1=Z_2DwithOutAxis 0=Z_2D 1=X_2D 2=Y_2D 3=Plane 4=Sphere 5=3D 6=3Dplane 7=3D_empty",std::vector<int>,"");
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,"");
_saggitalColors->SetLookupTable(colortable);
_coronalColors->SetLookupTable(colortable);
_axialColors->SetLookupTable(colortable);
-}
-
+}
\ No newline at end of file
Program: wxMaracas
Module: $RCSfile: wxMPRWidget.cxx,v $
Language: C++
- Date: $Date: 2009/05/14 13:54:35 $
- Version: $Revision: 1.14 $
+ Date: $Date: 2009/11/30 20:52:50 $
+ Version: $Revision: 1.15 $
Copyright: (c) 2002, 2003
License:
_wxvtkmpr3Dview_B->SetVtkMPR3DDataViewer(vtkmpr3Ddataviewer);
wxWindow *window3D = _wxvtk3Dbaseview_MPR3D_B->GetWxVTKRenderWindowInteractor();
- wxPanel *controlPanel3D = _wxvtkmpr3Dview_B->CreateControlPanel(panelMPR3D);
+ wxPanel *controlPanel3D = _wxvtkmpr3Dview_B->CreateControlPanel(panelMPR3D, false);
//EEDxx2.4
panelMPR3D -> SetMinimumPaneSize( 5 );
wxWindow *window3D = _wxvtk3Dbaseview_Clipping3D_BB->GetWxVTKRenderWindowInteractor();
wxPanel *panelControl = new wxPanel(panelClipping3D,-1);
- wxPanel *controlPanelMPR3D = _wxvtkmpr3Dview_BB->CreateControlPanel(panelControl);
+ wxPanel *controlPanelMPR3D = _wxvtkmpr3Dview_BB->CreateControlPanel(panelControl, false);
wxPanel *controlPanelClipping3D = _wxvtkclipping3Dview_BB->CreateControlPanel(panelControl);
_btnCutImageData = new wxCheckBox(panelControl,-1,_T("Cut Module"));
Connect(_btnCutImageData->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &wxMPRWidget::OnCutImagaData );
wxWindow *window3D = _wxvtk3Dbaseview_MPRClipping3D->GetWxVTKRenderWindowInteractor();
wxPanel *panelControl = new wxPanel(panelMPR3D,-1);
- wxPanel *controlPanelMPR3D = _wxvtkmpr3Dview->CreateControlPanel(panelControl);
+ wxPanel *controlPanelMPR3D = _wxvtkmpr3Dview->CreateControlPanel(panelControl, false);
wxPanel *controlPanelClipping3D = _wxvtkclipping3Dview->CreateControlPanel(panelControl);
Program: wxMaracas
Module: $RCSfile: wxManualTree_MPRWidget.cxx,v $
Language: C++
- Date: $Date: 2009/05/14 13:54:35 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2009/11/30 20:55:40 $
+ Version: $Revision: 1.3 $
Copyright: (c) 2002, 2003
License:
wxWindow *window3D = _wxvtk3Dbaseview_Clipping3D_C->GetWxVTKRenderWindowInteractor();
wxPanel *panelControl = new wxPanel(panelClipping3D,-1);
- wxPanel *controlPanelMPR3D = _wxvtkmpr3Dview_C->CreateControlPanel(panelControl);
+ wxPanel *controlPanelMPR3D = _wxvtkmpr3Dview_C->CreateControlPanel(panelControl, false);
wxPanel *controlPanelClipping3D = _wxvtkclipping3Dview_C->CreateControlPanel(panelControl);
// wxBoxSizer *sizerCtrol = new wxBoxSizer(wxVERTICAL);
--- /dev/null
+#include "wxMaracasDialog_NViewers.h"
+//#include <wx/frame.h>
+#include <wx/sizer.h>
+
+
+BEGIN_EVENT_TABLE( wxMaracasDialog_NViewers, wxFrame )
+ EVT_MENU( 12121, wxMaracasDialog_NViewers::OnRefreshView )
+ EVT_MENU( 12122, wxMaracasDialog_NViewers::OnDClickLeft )
+END_EVENT_TABLE( );
+
+/**
+** Class constructor
+**/
+wxMaracasDialog_NViewers::wxMaracasDialog_NViewers(wxWindow* parent, vtkImageData* img, std::vector<int>* type, wxString title)
+: wxFrame(parent, -1, title)
+{
+ viewer = new wxMaracas_N_ViewersWidget(this, img, type);
+ wxFlexGridSizer* sizer = new wxFlexGridSizer(1);
+
+ sizer->Add(viewer, 1, wxGROW);
+ this->SetSizer( sizer, true );
+ this->SetAutoLayout( true );
+ //viewer->SetSize(wxSizer(wxFIXED_MINSIZE));
+}
+
+/**
+** Class destructor
+**/
+wxMaracasDialog_NViewers::~wxMaracasDialog_NViewers(){
+}
+
+/**
+** Adds a new panel to the frame
+**/
+void wxMaracasDialog_NViewers::AddPanel(wxPanel panel)
+{
+ wxFlexGridSizer* sizer = new wxFlexGridSizer(1);
+
+ //this->AddChild(panel);
+ //sizer->Add(panel, wxFIXED_MINSIZE);
+ this->SetSizer( sizer, true );
+ this->SetAutoLayout( true );
+}
+
+void wxMaracasDialog_NViewers::OnRefreshView(wxCommandEvent & event)
+{
+ point.clear();
+ point.push_back((int)viewer->GetX());
+ point.push_back((int)viewer->GetY());
+ point.push_back((int)viewer->GetZ());
+
+ viewer->OnRefreshView(event);
+}
+
+void wxMaracasDialog_NViewers::OnDClickLeft(wxCommandEvent & event)
+{
+ viewer->OnDClickLeft(event);
+}
\ No newline at end of file
--- /dev/null
+#include "vtkImageData.h"
+#include "wxMaracas_N_ViewersWidget.h"
+#include <wx/wx.h>
+#include <vector>
+
+/**
+** Class constructor
+**/
+class wxMaracasDialog_NViewers : public wxFrame{
+
+ public:
+ wxMaracasDialog_NViewers(wxWindow* parent, vtkImageData* img, std::vector<int>* type, wxString title);
+ ~wxMaracasDialog_NViewers();
+ void OnRefreshView(wxCommandEvent & event);
+ void OnDClickLeft(wxCommandEvent & event);
+ void AddPanel(wxPanel panel);
+
+ private:
+ wxMaracas_N_ViewersWidget* viewer;
+ std::vector<int> point;
+
+ DECLARE_EVENT_TABLE( );
+
+};
\ No newline at end of file
#include "wxMaracasMultipleVolumeRendererPanel.h"
#include "wxMaracasMultipleVolumeRendererView.h"
+#include "wxMaracasDialog_NViewers.h"
#include "wxMaracasRendererView.h"
#include <wx/colordlg.h>
**/
void wxMaracasMultipleVolumeRendererPanel::onViewImage(wxCommandEvent& event)
{
- printf("wxMaracasMultipleVolumeRendererPanel->onViewImage: Test View Image /n");
- vtkImageData* img = (wxMaracasRendererView::getInstance())->getTabbedPanel(_propid)->getVolImage();
- /*wxMaracasDialog_NViewers* dialog = new wxMaracasDialog_NViewers(this);
-
- std::vector<int> type;
- std::vector<int> point;
-
- type.push_back(6);
- dialog->SetImage( );
- dialog->SetType(type);
-
- point.clear();
- point.push_back((int)dialog->GetX());
- point.push_back((int)dialog->GetY());
- point.push_back((int)dialog->GetZ());
-
- wxVtkBaseView *wvbv1 = dialog->GetwxVtkBaseView(1);
- wxVtkBaseView *wvbv2 = dialog->GetwxVtkBaseView(2);
- wxVtkBaseView *wvbv3 = dialog->GetwxVtkBaseView(3);
- wxVtkBaseView *wvbv4 = dialog->GetwxVtkBaseView(4);*/
+ vtkImageData* img;
+ if(this->isComplexBox){
+ img = (wxMaracasRendererView::getInstance())->getTabbedPanel(_propid)->getVolImage();
+ std::vector<int> type;
+ type.push_back(6);
+
+ wxMaracasDialog_NViewers* dialog1 = new wxMaracasDialog_NViewers(this, img, &type, wxString(_T("Volume Visualization") ));
+ dialog1->SetSize(wxDefaultSize);
+ dialog1->Show();
+ }
+ else{
+ //vtkImageData* img = wxMaracasMultipleVolumeRendererView::getInstance()->getVolImage();
+ }
}
/**
Program: wxMaracas
Module: $RCSfile: wxMaracasMultipleVolumeRendererView.cxx,v $
Language: C++
- Date: $Date: 2009/11/20 17:09:05 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2009/11/30 20:52:50 $
+ Version: $Revision: 1.10 $
Copyright: (c) 2002, 2003
License:
#include <wx/colordlg.h>
-#include <wx/bmpbuttn.h>
+#include <wx/bmpbuttn.h>
#include <OpenImage.xpm>
#include <Color.xpm>
wxStaticText* tx = new wxStaticText(this, -1, wxString(_T(" Translate X ")));
sliderTranslateX = new wxSlider(this, -1, 0, -200, 200, wxDefaultPosition, wxDefaultSize, wxSL_LABELS);
sliderTranslateX->SetLineSize(1);
- Connect(sliderTranslateX->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction)&wxMaracasRenderImageManagementPanel::Transform);
+ Connect(sliderTranslateX->GetId(), wxEVT_COMMAND_SLIDER_UPDATED, (wxObjectEventFunction)&wxMaracasRenderImageManagementPanel::Transform);
sizersliders->Add(tx, wxFIXED_MINSIZE);
sizersliders->Add(sliderTranslateX,wxSizerFlags().Expand().Center());
wxStaticText* ty = new wxStaticText(this, -1, wxString(_T(" Translate Y ")));
sliderTranslateY = new wxSlider(this, -1, 0, -200, 200, wxDefaultPosition, wxDefaultSize, wxSL_LABELS);
sliderTranslateY->SetLineSize(1);
- Connect(sliderTranslateY->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction)&wxMaracasRenderImageManagementPanel::Transform);
+ Connect(sliderTranslateY->GetId(), wxEVT_COMMAND_SLIDER_UPDATED, (wxObjectEventFunction)&wxMaracasRenderImageManagementPanel::Transform);
sizersliders->Add(ty, wxFIXED_MINSIZE);
sizersliders->Add(sliderTranslateY,wxSizerFlags().Expand().Center());
wxStaticText* tz = new wxStaticText(this, -1, wxString(_T(" Translate Z ")));
sliderTranslateZ = new wxSlider(this, -1, 0, -200, 200, wxDefaultPosition, wxDefaultSize, wxSL_LABELS);
sliderTranslateZ->SetLineSize(1);
- Connect(sliderTranslateZ->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction)&wxMaracasRenderImageManagementPanel::Transform);
+ Connect(sliderTranslateZ->GetId(), wxEVT_COMMAND_SLIDER_UPDATED, (wxObjectEventFunction)&wxMaracasRenderImageManagementPanel::Transform);
sizersliders->Add(tz, wxFIXED_MINSIZE);
sizersliders->Add(sliderTranslateZ,wxSizerFlags().Expand().Center());
wxStaticText* rx = new wxStaticText(this, -1, wxString(_T(" Rotate X ")));
sliderRotateX = new wxSlider(this, -1, 0, -360, 360, wxDefaultPosition, wxDefaultSize, wxSL_LABELS);
sliderRotateX->SetLineSize(1);
- Connect(sliderRotateX->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction)&wxMaracasRenderImageManagementPanel::Transform);
+ Connect(sliderRotateX->GetId(), wxEVT_COMMAND_SLIDER_UPDATED, (wxObjectEventFunction)&wxMaracasRenderImageManagementPanel::Transform);
sizersliders->Add(rx, wxFIXED_MINSIZE);
sizersliders->Add(sliderRotateX,wxSizerFlags().Expand().Center());
wxStaticText* ry = new wxStaticText(this, -1, wxString(_T(" Rotate Y ")));
sliderRotateY = new wxSlider(this, -1, 0, -360, 360, wxDefaultPosition, wxDefaultSize, wxSL_LABELS);
sliderRotateY->SetLineSize(1);
- Connect(sliderRotateY->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction)&wxMaracasRenderImageManagementPanel::Transform);
+ Connect(sliderRotateY->GetId(), wxEVT_COMMAND_SLIDER_UPDATED, (wxObjectEventFunction)&wxMaracasRenderImageManagementPanel::Transform);
sizersliders->Add(ry, wxFIXED_MINSIZE);
sizersliders->Add(sliderRotateY,wxSizerFlags().Expand().Center());
wxStaticText* rz = new wxStaticText(this, -1, wxString(_T(" Rotate Z ")));
sliderRotateZ = new wxSlider(this, -1, 0, -360, 360, wxDefaultPosition, wxDefaultSize, wxSL_LABELS);
sliderRotateZ->SetLineSize(1);
- Connect(sliderRotateZ->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction)&wxMaracasRenderImageManagementPanel::Transform);
+ Connect(sliderRotateZ->GetId(), wxEVT_COMMAND_SLIDER_UPDATED, (wxObjectEventFunction)&wxMaracasRenderImageManagementPanel::Transform);
sizersliders->Add(rz, wxFIXED_MINSIZE);
sizersliders->Add(sliderRotateZ,wxSizerFlags().Expand().Center());
wxStaticText* sx = new wxStaticText(this, -1, wxString(_T(" Scale X ")));
sliderScaleX = new wxSlider(this, -1, 100, 1, 200, wxDefaultPosition, wxDefaultSize, wxSL_LABELS);
sliderScaleX->SetLineSize(1);
- Connect(sliderScaleX->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction)&wxMaracasRenderImageManagementPanel::Transform);
+ Connect(sliderScaleX->GetId(), wxEVT_COMMAND_SLIDER_UPDATED, (wxObjectEventFunction)&wxMaracasRenderImageManagementPanel::Transform);
sizersliders->Add(sx, wxFIXED_MINSIZE);
sizersliders->Add(sliderScaleX,wxSizerFlags().Expand().Center());
wxStaticText* sy = new wxStaticText(this, -1, wxString(_T(" Scale Y ")));
sliderScaleY = new wxSlider(this, -1, 100, 1, 200, wxDefaultPosition, wxDefaultSize, wxSL_LABELS);
sliderScaleY->SetLineSize(1);
- Connect(sliderScaleY->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction)&wxMaracasRenderImageManagementPanel::Transform);
+ Connect(sliderScaleY->GetId(), wxEVT_COMMAND_SLIDER_UPDATED, (wxObjectEventFunction)&wxMaracasRenderImageManagementPanel::Transform);
sizersliders->Add(sy, wxFIXED_MINSIZE);
sizersliders->Add(sliderScaleY,wxSizerFlags().Expand().Center());
wxStaticText* sz = new wxStaticText(this, -1, wxString(_T(" Scale Z ")));
sliderScaleZ = new wxSlider(this, -1, 100, 1, 200, wxDefaultPosition, this->GetSize(), wxSL_LABELS);
sliderScaleZ->SetLineSize(1);
- Connect(sliderScaleZ->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction)&wxMaracasRenderImageManagementPanel::Transform);
+ Connect(sliderScaleZ->GetId(), wxEVT_COMMAND_SLIDER_UPDATED, (wxObjectEventFunction)&wxMaracasRenderImageManagementPanel::Transform);
sizersliders->Add(sz, wxFIXED_MINSIZE);
sizersliders->Add(sliderScaleZ,wxSizerFlags().Expand().Center());
transformS2->Identity();
transformS3->Identity();
- transformV->Translate( tx/*volspX*/, ty/*volspY*/, tz/*volspZ*/ );
- transformS1->Translate( tx/*surfspX*/, ty/*surfspY*/, tz/*surfspZ*/ );
- transformS2->Translate( tx/*surfspX*/, ty/*surfspY*/, tz/*surfspZ*/ );
- transformS3->Translate( tx/*surfspX*/, ty/*surfspY*/, tz/*surfspZ*/ );
-
- transformV->RotateX( rx/*volspX*/ );
- transformS1->RotateX( rx/*surfspX*/ );
- transformS2->RotateX( rx/*surfspX*/ );
- transformS3->RotateX( rx/*surfspX*/ );
-
- transformV->RotateY( ry/*volspY*/ );
- transformS1->RotateY( ry/*surfspY*/ );
- transformS2->RotateY( ry/*surfspY*/ );
- transformS3->RotateY( ry/*surfspY*/ );
-
- transformV->RotateZ( rz/*volspZ*/ );
- transformS1->RotateZ( rz/*surfspZ*/ );
- transformS2->RotateZ( rz/*surfspZ*/ );
- transformS3->RotateZ( rz/*surfspZ*/ );
+ transformV->Translate( tx*volspX, ty*volspY, tz*volspZ );
+ transformS1->Translate( tx*surfspX, ty*surfspY, tz*surfspZ );
+ transformS2->Translate( tx*surfspX, ty*surfspY, tz*surfspZ );
+ transformS3->Translate( tx*surfspX, ty*surfspY, tz*surfspZ );
+
+ transformV->RotateX( rx*volspX );
+ transformS1->RotateX( rx*surfspX );
+ transformS2->RotateX( rx*surfspX );
+ transformS3->RotateX( rx*surfspX );
+
+ transformV->RotateY( ry*volspY );
+ transformS1->RotateY( ry*surfspY );
+ transformS2->RotateY( ry*surfspY );
+ transformS3->RotateY( ry*surfspY );
+
+ transformV->RotateZ( rz*volspZ );
+ transformS1->RotateZ( rz*surfspZ );
+ transformS2->RotateZ( rz*surfspZ );
+ transformS3->RotateZ( rz*surfspZ );
transformV->Scale( (sx/100.0), (sy/100.0), (sz/100.0) );
transformS1->Scale( (sx/100.0), (sy/100.0), (sz/100.0) );
}
-/**
-** Scales a volume by the given value for the X axis
-*
-void wxMaracasRenderImageTransformation::Scale(int x, int y, int z)
-{
- float resultX = x/100.0;
- float resultY = y/100.0;
- float resultZ = z/100.0;
-
- //printf("wxMaracasRenderImageManagementPanel::Rotate int:scaleX = %d \n",x);
- //printf("wxMaracasRenderImageManagementPanel::Rotate int:scaleY = %d \n", y);
- //printf("wxMaracasRenderImageManagementPanel::Rotate int:scaleZ = %d \n", z);
-
- Refresh();
-}*/
-
/**
** Updates each Matrix
**/
#include "wxMaracasSurfaceRenderingPanel.h"
#include "wxMaracasSurfaceRenderingProp3DMHD.h"
#include "wxMaracasMultipleVolumeRendererManagerData.h"
+#include "wxMaracasDialog_NViewers.h"
#include <wx/colordlg.h>
#include <wx/button.h>
#include <OpenImage.xpm>
#include "Color.xpm"
+#include "creaSystem.h"
#include <vtkProp3D.h>
+#include "wxVtkMPR3DViewCntrlPanel.h"
/**
** Class constructor
**/
-wxMaracasRenderTabbedPanel::wxMaracasRenderTabbedPanel(wxWindow* parent, int id)
+wxMaracasRenderTabbedPanel::wxMaracasRenderTabbedPanel(wxWindow* parent, int id, wxVtk3DBaseView* _baseView)
: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize)
{
_id = id;
-
+ baseView = _baseView;
dialog = NULL;
volmanager = new wxMaracasMultipleVolumeRendererManager();
//wxMaracasRenderTabbedPanel::getInstance()->addRemoveActorSB(_propid, false);
//wxMaracasRenderTabbedPanel::getInstance()->addRemoveActorSC(_propid, false);
this->deleteVolume(_id);
+ delete dialog;
delete wxtabs;
}
{
wxFlexGridSizer* sizerrenderprop = new wxFlexGridSizer(1);
- wxFlexGridSizer* sizercheck = new wxFlexGridSizer(2);
+ wxFlexGridSizer* sizercheck = new wxFlexGridSizer(3);
checkboxVol = new wxCheckBox(this,-1,wxString(_T("Volume Rendering")));
Connect(checkboxVol->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction)&wxMaracasRenderTabbedPanel::onCheckBoxVChange);
checkboxVol->SetValue(true);
checkboxSA->SetValue(true);
sizercheck->Add(checkboxSA, wxFIXED_MINSIZE);
+ checkboxViewer = new wxCheckBox(this,-1,wxString(_T("MPR")));
+ Connect(checkboxViewer->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction)&wxMaracasRenderTabbedPanel::onMPROptions);
+ checkboxViewer->SetValue(false);
+ sizercheck->Add(checkboxViewer, wxFIXED_MINSIZE);
+
checkboxSB = new wxCheckBox(this,-1,wxString(_T("Surface Rendering B")));
Connect(checkboxSB->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction)&wxMaracasRenderTabbedPanel::onCheckBoxSBChange);
- checkboxSB->SetValue(true);
+ checkboxSB->SetValue(false);
sizercheck->Add(checkboxSB, wxFIXED_MINSIZE);
checkboxSC = new wxCheckBox(this,-1,wxString(_T("Surface Rendering C")));
Connect(checkboxSC->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction)&wxMaracasRenderTabbedPanel::onCheckBoxSCChange);
- checkboxSC->SetValue(true);
+ checkboxSC->SetValue(false);
sizercheck->Add(checkboxSC, wxFIXED_MINSIZE);
+
+ sizercheck->Add(new wxStaticText(this, -1,_T("")), wxFIXED_MINSIZE);
wxButton* _openParameters = new wxButton(this, -1, wxString(_T("Apply Transformation")));
Connect(_openParameters->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&wxMaracasRenderTabbedPanel::onOpenParameters);
addSurface1(img, filename);
addSurface2(img, filename);
addSurface3(img, filename);
+ addMPROptions();
volname = (wxString) filename;
wxtabs->Refresh();
}
int maxiso = surrendmanager2->getMaxIsoValue(_propidSB);
((wxMaracasSurfaceRenderingProp3DMHD*)controlpanSB)->createControls(maxiso);
wxtabs->AddPage(controlpanSB, _T("SR B"));
+ wxtabs->GetPage(2)->Disable();
}
}
int maxiso = surrendmanager3->getMaxIsoValue(_propidSC);
((wxMaracasSurfaceRenderingProp3DMHD*)controlpanSC)->createControls(maxiso);
wxtabs->AddPage(controlpanSC, _T("SR C"));
+ wxtabs->GetPage(3)->Disable();
}
}
catch(char* str)
}
}
+/**
+**
+**/
+void wxMaracasRenderTabbedPanel::addMPROptions()
+{
+ int x = 0,y = 0,z = 0;
+ int ext[6];
+ ext[0] = 0;
+ ext[1] = 0;
+ ext[2] = 0;
+ ext[3] = 0;
+ ext[4] = 0;
+ ext[5] = 0;
+
+ double org[3],spc[3];
+ org[0] = 0;
+ org[1] = 0;
+ org[2] = 0;
+ spc[0] = 0;
+ spc[1] = 0;
+ spc[2] = 0;
+
+ vtkMPRBaseData* mvtkmprbasedata = new vtkMPRBaseData();
+ marImageData* marimagedata = new marImageData( getVolImage() );
+ mvtkmprbasedata->SetMarImageData(marimagedata);
+
+ mwxvtkmpr3Dview = new wxVtkMPR3DView( baseView );
+
+ vtkmpr3Ddataviewer = new vtkMPR3DDataViewer();
+
+ wxPanel *panelControl = new wxPanel(wxtabs,-1);
+ controlPanelMPR3D = mwxvtkmpr3Dview->CreateControlPanel(panelControl, true);
+
+ wxFlexGridSizer *sizerCtrol = new wxFlexGridSizer(1);
+ sizerCtrol->Add(controlPanelMPR3D, 1, wxALL|wxEXPAND, 2);
+
+ panelControl->SetAutoLayout(true);
+ panelControl->SetSizer(sizerCtrol);
+ panelControl->SetSize(400,350);
+ panelControl->Layout();
+
+
+ if (mvtkmprbasedata!=NULL)
+ {
+ mvtkmprbasedata->Configure();
+ /*x = mvtkmprbasedata -> GetMaxPositionX()/2;
+ y = mvtkmprbasedata -> GetMaxPositionY()/2;
+ z = mvtkmprbasedata -> GetMaxPositionZ()/2; */
+
+ if(mvtkmprbasedata->GetImageData() != NULL)
+ {
+ mvtkmprbasedata->GetImageData()->GetExtent(ext);
+ mvtkmprbasedata->GetImageData()->GetOrigin(org);
+ mvtkmprbasedata->GetImageData()->GetSpacing(spc);
+
+ x = (ext[0]+ext[1])/2;
+ y = (ext[2]+ext[3])/2;
+ z = (ext[4]+ext[5])/2;
+
+ mvtkmprbasedata->SetX( x );
+ mvtkmprbasedata->SetY( y );
+ mvtkmprbasedata->SetZ( z );
+ }
+ else
+ {
+ mvtkmprbasedata->SetX( 0 );
+ mvtkmprbasedata->SetY( 0 );
+ mvtkmprbasedata->SetZ( 0 );
+ }
+ }
+
+ if (baseView!=NULL)
+ baseView ->Configure();
+
+ if (vtkmpr3Ddataviewer !=NULL)
+ {
+ vtkmpr3Ddataviewer ->SetVtkMPRBaseData(mvtkmprbasedata);
+ vtkmpr3Ddataviewer ->Configure();
+ }
+ if (mwxvtkmpr3Dview !=NULL)
+ {
+ mwxvtkmpr3Dview ->SetVtkMPR3DDataViewer(vtkmpr3Ddataviewer);
+ mwxvtkmpr3Dview ->Configure();
+ mwxvtkmpr3Dview ->ResetCamera(ext,org,spc);
+ }
+
+ wxtabs->AddPage(panelControl, _T("MPR"));
+ wxtabs->GetPage(4)->Disable();
+ mwxvtkmpr3Dview->showOutlineActor(false);
+ mwxvtkmpr3Dview->Refresh();
+
+}
+
/**
** Deletes complete volume
**/
{
try{
volmanager->addRemoveActor(id, addremove);
+
}
catch(char* str){
std::cout << "Exception : " << str << '\n';
}
}
+
/**
** Sets color points values for the given volume rendering identified by parameter: volumeid
**/
void wxMaracasRenderTabbedPanel::onCheckBoxVChange(wxCommandEvent& event)
{
try{
- volmanager->addRemoveActor(this->getPropIdV(), checkboxVol->GetValue());
+ volmanager->addRemoveActor(this->getPropIdV(), checkboxVol->GetValue());
+
+ int id = 0;
+ wxtabs->SetSelection(id);
+
+ if(checkboxVol->GetValue())
+ {
+ wxtabs->GetPage(id)->Enable();
+ }
+ else
+ {
+ wxtabs->GetPage(id)->Disable();
+ }
}
catch(char* str){
std::cout << "Exception : " << str << '\n';
{
try{
surrendmanager1->addRemoveActor(this->getPropIdV(), checkboxSA->GetValue());
+
+ int id = 1;
+ wxtabs->SetSelection(id);
+
+ if(checkboxSA->GetValue())
+ {
+ wxtabs->GetPage(id)->Enable();
+
+ }
+ else
+ {
+ wxtabs->GetPage(id)->Disable();
+ }
}
catch(char* str){
std::cout << "Exception : " << str << '\n';
{
try{
surrendmanager2->addRemoveActor(this->getPropIdV(), checkboxSB->GetValue());
+
+ int id = 2;
+ wxtabs->SetSelection(id);
+
+ if(checkboxSB->GetValue())
+ {
+ wxtabs->GetPage(id)->Enable();
+ }
+ else
+ {
+ wxtabs->GetPage(id)->Disable();
+ }
}
catch(char* str){
std::cout << "Exception : " << str << '\n';
void wxMaracasRenderTabbedPanel::onCheckBoxSCChange(wxCommandEvent& event)
{
try{
- surrendmanager3->addRemoveActor(this->getPropIdV(), checkboxSC->GetValue());
+ surrendmanager3->addRemoveActor(this->getPropIdV(), checkboxSC->GetValue());
+
+ int id = 3;
+ wxtabs->SetSelection(id);
+
+ if(checkboxSC->GetValue())
+ {
+ wxtabs->GetPage(id)->Enable();
+ }
+ else
+ {
+ wxtabs->GetPage(id)->Disable();
+ }
}
catch(char* str){
std::cout << "Exception : " << str << '\n';
}
/**
-**
+** Method called when MPR checkbox status changes: Either shows or hides actors
+**/
+void wxMaracasRenderTabbedPanel::onMPROptions(wxCommandEvent& event)
+{
+ int id = 4;
+ wxtabs->SetSelection(id);
+ if(checkboxViewer->IsChecked())
+ {
+ wxtabs->GetPage(id)->Enable();
+
+ bool valueX = ((wxVtkMPR3DViewCntrlPanel*) controlPanelMPR3D)->GetVisibleX();
+ bool valueY = ((wxVtkMPR3DViewCntrlPanel*) controlPanelMPR3D)->GetVisibleY();
+ bool valueZ = ((wxVtkMPR3DViewCntrlPanel*) controlPanelMPR3D)->GetVisibleZ();
+
+ mwxvtkmpr3Dview->VisibleImageActor( 0, valueX );
+ mwxvtkmpr3Dview->VisibleImageActor( 1, valueY );
+ mwxvtkmpr3Dview->VisibleImageActor( 2, valueZ );
+ mwxvtkmpr3Dview->showOutlineActor(true);
+ mwxvtkmpr3Dview->Refresh();
+
+ wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+ mwxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+
+ }
+ else
+ {
+ wxtabs->GetPage(id)->Disable();
+
+ mwxvtkmpr3Dview->VisibleImageActor(0, false );
+ mwxvtkmpr3Dview->VisibleImageActor(1, false );
+ mwxvtkmpr3Dview->VisibleImageActor(2, false );
+ mwxvtkmpr3Dview->showOutlineActor(false);
+ mwxvtkmpr3Dview->Refresh();
+
+ wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+ mwxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+ }
+}
+
+/**
+**
**/
void wxMaracasRenderTabbedPanel::onOpenParameters(wxCommandEvent& event){
if(dialog == NULL)
}
}
+/**
+**
+**/
+void wxMaracasRenderTabbedPanel::onOpenCutter(wxCommandEvent& event)
+{
+ vtkImageData* img = getVolImage();
+ std::vector<int> type;
+ type.push_back(5);
+ type.push_back(0);
+ type.push_back(1);
+ type.push_back(3);
+
+ wxMaracasDialog_NViewers* dialog1 = new wxMaracasDialog_NViewers(this, img, &type, wxString(_T("Cut Module") ));
+ //dialog1->SetSize(800, 700);
+
+ std::string path = crea::System::GetDllAppPath("bbcreaMaracasVisu.dll");
+ //cutter = new CutModel2MainPanel(dialog1, path);
+
+ //dialog1->AddPanel(cutter);
+ dialog1->Show();
+}
+
/**
** Gets volume rendering image asociated to the given ID
**/
return surrendmanager3->getImageData();
}
-/**
-**
-**/
-void wxMaracasRenderTabbedPanel::onOpenCutter(wxCommandEvent& event)
-{
-
-}
-
/**
**
**/
#include <wx/wx.h>
#include <wx/notebook.h>
-#include "wxMaracasRenderImageManagementPanel.h"
+#include "wxMaracasRenderImageManagementPanel.h"
+//#include "CutModelMainPanel.h"
#include "wxMaracasMultipleVolumeRendererManager.h"
#include "wxMaracasSurfaceRenderingManager.h"
-
+#include "wxVtkBaseView.h"
+#include "wxMPRWidget.h"
class wxMaracasRenderTabbedPanel : public wxPanel
{
public:
- wxMaracasRenderTabbedPanel(wxWindow* parent, int id);
+ wxMaracasRenderTabbedPanel(wxWindow* parent, int id, wxVtk3DBaseView* _baseView);
~wxMaracasRenderTabbedPanel();
void createControls(vtkImageData* inImg, std::string pathfile, std::string filename);
void addRemoveActorSA(int id, bool addremove);
void addRemoveActorSB(int id, bool addremove);
void addRemoveActorSC(int id, bool addremove);
+ void addMPROptions();
// ----- Volume rendering functions ----- //
void SetValuesColorPointsFunction(int volid, std::vector<double> greylevelcolors,std::vector<double> red,std::vector<double> green,std::vector<double> blue);
void onCheckBoxSAChange(wxCommandEvent& event);
void onCheckBoxSBChange(wxCommandEvent& event);
void onCheckBoxSCChange(wxCommandEvent& event);
+ void onMPROptions(wxCommandEvent& event);
void onOpenParameters(wxCommandEvent& event);
void onColorChange(wxCommandEvent& event);
wxCheckBox* checkboxSA;
wxCheckBox* checkboxSB;
wxCheckBox* checkboxSC;
+ wxCheckBox* checkboxViewer;
//wxBitmapButton* _viewimage;
wxNotebook* wxtabs;
- wxMaracasRenderImageManagementPanel* dialog;
+ wxString volname;
+
+ wxVtk3DBaseView* baseView;
+ wxVtkMPR3DView* mwxvtkmpr3Dview;
+ vtkMPR3DDataViewer* vtkmpr3Ddataviewer;
+ wxPanel* controlPanelMPR3D;
bool first;
-
- wxMaracasMultipleVolumeRendererManager* volmanager;
- wxMaracasSurfaceRenderingManager* surrendmanager1;
- wxMaracasSurfaceRenderingManager* surrendmanager2;
- wxMaracasSurfaceRenderingManager* surrendmanager3;
-
int _id;
- wxString volname;
+ //CutModel2MainPanel* cutter;
+ wxMaracasRenderImageManagementPanel* dialog;
+ wxMaracasMultipleVolumeRendererManager* volmanager;
+ wxMaracasSurfaceRenderingManager* surrendmanager1;
+ wxMaracasSurfaceRenderingManager* surrendmanager2;
+ wxMaracasSurfaceRenderingManager* surrendmanager3;
};
#endif /*wxMaracasMultipleVolumeRendererPanel_H_*/
_renderer = renderer;
}
+void wxMaracasRendererView::setVtkBaseView(wxVtk3DBaseView* vbv)
+{
+ baseView = vbv;
+}
+
/**
** Called when an image file is opened
**/
**/
void wxMaracasRendererView::addVolumes(vtkImageData* img, std::string pathfile, std::string filename)
{
- wxMaracasRenderTabbedPanel* wxtabs = new wxMaracasRenderTabbedPanel(this, _idCount);
+ wxMaracasRenderTabbedPanel* wxtabs = new wxMaracasRenderTabbedPanel(this, _idCount, baseView);
wxtabs->setRenderer(_renderer);
tabsVector.push_back(wxtabs);
#include <iostream>
#include "marTypes.h"
#include "vtkProp3D.h"
+#include "wxVtkBaseView.h"
#include "wxMaracasRendererView.h"
#include "wxMaracasRenderTabbedPanel.h"
wxMaracasRenderTabbedPanel* getTabbedPanel(int id) throw(char*);
void setRenderer(vtkRenderer* renderer); /* throw(char*), */ // JPR
+ void setVtkBaseView(wxVtk3DBaseView* base);
void onLoadImageFile();
void addVolumes(vtkImageData* img, std::string pathfile, std::string filename);
void addPanels(wxMaracasRenderTabbedPanel* wxtabs, vtkImageData* img, std::string pathfile, std::string filename);
wxToolBar * _toolb;
vtkRenderer* _renderer;
+ wxVtk3DBaseView* baseView;
std::string _path;
int _idCount;
#include "wxMaracasSurfaceRenderingProp3D.h"
+#include "wxMaracasDialog_NViewers.h"
#include <wx/colordlg.h>
#include "wxMaracasSurfaceRendering.h"
** Loads the volume in a separate window
**/
void wxMaracasSurfaceRenderingProp3D::onViewImage(wxCommandEvent& event){
- printf("wxMaracasSurfaceRenderingProp3D->onViewImage: Test View Image \n");
- vtkImageData* image = ((wxMaracasRendererView::getInstance())->getTabbedPanel(this->_propid))->getVolImage();
-
+ vtkImageData* img;
+ if(this->isComplexBox){
+ if(this->getPanId() == 1)
+ img = (wxMaracasRendererView::getInstance())->getTabbedPanel(_propid)->getSurfAImage();
+ if(this->getPanId() == 2)
+ img = (wxMaracasRendererView::getInstance())->getTabbedPanel(_propid)->getSurfBImage();
+ if(this->getPanId() == 3)
+ img = (wxMaracasRendererView::getInstance())->getTabbedPanel(_propid)->getSurfCImage();
+ std::vector<int> type;
+ type.push_back(6);
+
+ wxMaracasDialog_NViewers* dialog1 = new wxMaracasDialog_NViewers(this, img, &type, wxString(_T("Volume Visualization") ));
+ dialog1->SetSize(730, 700);
+ dialog1->Show();
+ }
+ else{
+ //vtkImageData* img = wxMaracasMultipleVolumeRendererView::getInstance()->getVolImage();
+ }
}
\ No newline at end of file
Program: wxMaracas
Module: $RCSfile: wxMaracas_N_ViewersWidget.cxx,v $
Language: C++
- Date: $Date: 2009/09/15 11:25:07 $
- Version: $Revision: 1.12 $
+ Date: $Date: 2009/11/30 20:52:51 $
+ Version: $Revision: 1.13 $
Copyright: (c) 2002, 2003
License:
//-----------------------------------------------------------------------------------
void wxMaracas_N_ViewersWidget::SetImage( vtkImageData *image )
{
- if (wxwindow1!=NULL) {
-
- wxwindow1->SetImage(image);
- }
+ if (wxwindow1!=NULL) { wxwindow1->SetImage(image); }
if (wxwindow2!=NULL) { wxwindow2->SetImage(image); }
if (wxwindow3!=NULL) { wxwindow3->SetImage(image); }
if (wxwindow4!=NULL) { wxwindow4->SetImage(image); }
+ }
-
+//-----------------------------------------------------------------------------------
+ void wxMaracas_N_ViewersWidget::ConfigureVTK()
+ {
+ if (wxwindow1!=NULL) { wxwindow1->ConfigureVTK(); }
+ if (wxwindow2!=NULL) { wxwindow2->ConfigureVTK(); }
+ if (wxwindow3!=NULL) { wxwindow3->ConfigureVTK(); }
+ if (wxwindow4!=NULL) { wxwindow4->ConfigureVTK(); }
}
//-----------------------------------------------------------------------------------
Program: wxMaracas
Module: $RCSfile: wxMaracas_N_ViewersWidget.h,v $
Language: C++
- Date: $Date: 2009/09/15 11:25:07 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2009/11/30 20:52:51 $
+ Version: $Revision: 1.9 $
Copyright: (c) 2002, 2003
License:
wxVtkBaseView *GetwxVtkBaseView(int iWin);
virtual void Refresh(bool eraseBackground = true,const wxRect* rect = NULL );
void SetImage( vtkImageData *image );
+ void ConfigureVTK();
void SetType(std::vector<int>* type);
void UpdateLayout(vtkImageData* imagedata);
// double GetZ(int iWin);
Program: wxMaracas
Module: $RCSfile: wxMaracas_ViewerWidget.cxx,v $
Language: C++
- Date: $Date: 2009/11/25 16:35:38 $
- Version: $Revision: 1.19 $
+ Date: $Date: 2009/11/30 20:52:51 $
+ Version: $Revision: 1.20 $
Copyright: (c) 2002, 2003
License:
wxWindow *window3D = mwxvtk3Dbaseview_Clipping3D->GetWxVTKRenderWindowInteractor();
wxPanel *panelControl = new wxPanel(panelClipping3D,-1);
- wxPanel *controlPanelMPR3D = mwxvtkmpr3Dview->CreateControlPanel(panelControl);
+ wxPanel *controlPanelMPR3D = mwxvtkmpr3Dview->CreateControlPanel(panelControl, false);
wxPanel *controlPanelClipping3D = mwxvtkclipping3Dview->CreateControlPanel(panelControl);
// mbtnCutImageData = new wxCheckBox(panelControl,-1,_T("Cut Module"));
// Connect(_btnCutImageData->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &wxMPRWidget::OnCutImagaData );
wxWindow *window3D = mwxvtk3Dbaseview_Clipping3D->GetWxVTKRenderWindowInteractor();
wxPanel *panelControl = new wxPanel(panelClipping3D,-1);
- wxPanel *controlPanelMPR3D = mwxvtkmpr3Dview->CreateControlPanel(panelControl);
+ wxPanel *controlPanelMPR3D = mwxvtkmpr3Dview->CreateControlPanel(panelControl, false);
wxFlexGridSizer *sizerCtrol = new wxFlexGridSizer(1);
sizerCtrol->Add(controlPanelMPR3D , 1, wxALL|wxEXPAND, 2);
}
+ 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;
+*/
+/*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->Add( wxwindow , 1, wxGROW);
panel->SetSizer(sizer);
/*x = mvtkmprbasedata -> GetMaxPositionX()/2;
y = mvtkmprbasedata -> GetMaxPositionY()/2;
z = mvtkmprbasedata -> GetMaxPositionZ()/2; */
-
- mvtkmprbasedata->GetImageData()->GetExtent(ext);
- mvtkmprbasedata->GetImageData()->GetOrigin(org);
- mvtkmprbasedata->GetImageData()->GetSpacing(spc);
-
- x = (ext[0]+ext[1])/2;
- y = (ext[2]+ext[3])/2;
- z = (ext[4]+ext[5])/2;
-
- mvtkmprbasedata->SetX( x );
- mvtkmprbasedata->SetY( y );
- mvtkmprbasedata->SetZ( z );
-
+
+ if(mvtkmprbasedata->GetImageData() != NULL)
+ {
+ mvtkmprbasedata->GetImageData()->GetExtent(ext);
+ mvtkmprbasedata->GetImageData()->GetOrigin(org);
+ mvtkmprbasedata->GetImageData()->GetSpacing(spc);
+
+ x = (ext[0]+ext[1])/2;
+ y = (ext[2]+ext[3])/2;
+ z = (ext[4]+ext[5])/2;
+
+ mvtkmprbasedata->SetX( x );
+ mvtkmprbasedata->SetY( y );
+ mvtkmprbasedata->SetZ( z );
+ }
+ else
+ {
+ mvtkmprbasedata->SetX( 0 );
+ mvtkmprbasedata->SetY( 0 );
+ mvtkmprbasedata->SetZ( 0 );
+ }
}
if ( mwidgetMesure !=NULL ) { mwidgetMesure -> SetMesureScale( 1 ); }
if ( mwxsphereview !=NULL ) { mwxsphereview -> Configure(); }
- if (mwxvtk3Dbaseview_Clipping3D !=NULL) { mwxvtk3Dbaseview_Clipping3D -> Configure(); }
+ printf("CPR wxMaracas_ViewerWidget::ConfigureVTK A \n");
+ if (mwxvtk3Dbaseview_Clipping3D !=NULL) { mwxvtk3Dbaseview_Clipping3D -> Configure();
+ printf("CPR wxMaracas_ViewerWidget::ConfigureVTK B \n");
+/*Borrame
+ mwxvtk3Dbaseview_Clipping3D->GetRenderer()->SetActiveCamera(mwxvtk3Dbaseview_Clipping3D->GetCamera());
+ mwxvtk3Dbaseview_Clipping3D->GetRenderer()->ResetCamera ();
+ mwxvtk3Dbaseview_Clipping3D->GetCamera()->Dolly(1.5);
+ mwxvtk3Dbaseview_Clipping3D->GetRenderer()->SetBackground( 0.36 , 0.36 , 0.36 );
+ mwxvtk3Dbaseview_Clipping3D->GetRenWin()->SetSize(400, 400);
+ mwxvtk3Dbaseview_Clipping3D->GetRenderer()->ResetCameraClippingRange();
+*/
+ }
if (vtkmpr3Ddataviewer !=NULL) {
vtkmpr3Ddataviewer->Configure();
if (mwxvtkclipping3Dview !=NULL) { mwxvtkclipping3Dview -> Configure(); }
-
void wxMaracas_ViewerWidget::SetImage( vtkImageData *image )
{
- marImageData* mar = mvtkmprbasedata->GetMarImageData();
- mar->removeImageData(0);
- mar->AddImageData(image);
-
- ConfigureVTK();
- RefreshView();
-
-
+ if(mvtkmprbasedata !=NULL)
+ {
+ marImageData* mar = mvtkmprbasedata->GetMarImageData();
+ mar->removeImageData(0);
+ mar->AddImageData(image);
+ }
+//EED 26/11/2009
+// ConfigureVTK();
+// RefreshView();
}
double wxMaracas_ViewerWidget :: GetX()
{
- return mvtkmprbasedata->GetX();
+ double value = -1;
+ if(mvtkmprbasedata !=NULL)
+ {
+ value = mvtkmprbasedata->GetX();
+ }
+ return value;
}
double wxMaracas_ViewerWidget :: GetY()
{
- return mvtkmprbasedata->GetY();
+ double value = -1;
+ if(mvtkmprbasedata !=NULL)
+ {
+ value = mvtkmprbasedata->GetY();
+ }
+ return value;
}
double wxMaracas_ViewerWidget :: GetZ()
{
- return mvtkmprbasedata->GetZ();
+ double value = -1;
+ if(mvtkmprbasedata !=NULL)
+ {
+ value = mvtkmprbasedata->GetZ();
+ }
+ return value;
// return mvtk2Dbaseview->GetVtkBaseData()->GetZ();
}
//-------------------------------------------------------------------
wxVtk3DBaseView::~wxVtk3DBaseView()
{
+
if (_aCamera!=NULL) { _aCamera -> Delete(); _aCamera=NULL;}
if (_aRenderer!=NULL) { _aRenderer -> Delete(); _aRenderer=NULL;}
if (_renWin!=NULL) {
//-------------------------------------------------------------------
void wxVtk3DBaseView::Configure()
{
+ printf("EED wxVtk3DBaseView::Configure A\n");
if (_configure==false)
{
+ printf("EED wxVtk3DBaseView::Configure B\n");
_configure=true;
//wxVtkBaseView::Configure();
_aRenderer = vtkRenderer::New();
_planeWidget->GetPolyData(_vtkplane);
}
//-------------------------------------------------------------------
-wxPanel* wxVtkMPR3DView::CreateControlPanel(wxWindow *parent)
+wxPanel* wxVtkMPR3DView::CreateControlPanel(wxWindow *parent, bool align)
{
- _wxvtkmpr3DviewCntrlPanel = new wxVtkMPR3DViewCntrlPanel(parent,this);
+ _wxvtkmpr3DviewCntrlPanel = new wxVtkMPR3DViewCntrlPanel(parent,this, align);
return _wxvtkmpr3DviewCntrlPanel;
}
//-------------------------------------------------------------------
//-------------------------------------------------------------------
void wxVtkMPR3DView::VisibleImageActor(int idPosition, bool visible){
+ /*if(visible == false)
+ printf("CPR: wxVtkMPR3DView::VisibleImageActor-> visibleActor == false \n");
+ else
+ {
+ printf("CPR: wxVtkMPR3DView::VisibleImageActor-> visibleActor == true\n");
+ printf("CPR: wxVtkMPR3DView::VisibleImageActor-> idPosition == %d\n", idPosition);
+ }
+ */
if (visible!=_vtkmpr3Ddataviewer->GetVisiblePosition(idPosition)){
if (visible==false){
_wxvtk3Dbaseview->GetRenderer()->RemoveActor( _vtkmpr3Ddataviewer->GetImageActor(idPosition) );
}
}
+//CPR: Method added 30 Nov 2009
+void wxVtkMPR3DView::showOutlineActor(bool value)
+{
+ vtkActor* _outlineActor = _vtkmpr3Ddataviewer->GetOutlineActor();
+ if(value == true)
+ {
+ _wxvtk3Dbaseview->GetRenderer()->AddActor( _outlineActor );
+ }
+ else
+ {
+ _wxvtk3Dbaseview->GetRenderer()->RemoveActor( _outlineActor );
+ }
+}
+
//-------------------------------------------------------------------
void wxVtkMPR3DView::SetVtkMPR3DDataViewer(vtkMPR3DDataViewer *vtkmpr3Ddataviewer)
{
virtual void RefreshView();
virtual void Configure();
void SetVtkMPR3DDataViewer( vtkMPR3DDataViewer *vtkmpr3Ddataviewer );
- wxPanel* CreateControlPanel(wxWindow *parent);
+ wxPanel* CreateControlPanel(wxWindow *parent, bool align);
vtkMPR3DDataViewer* GetVtkMPR3DDataViewer();
wxVtk3DBaseView* GetWxvtk3Dbaseview() throw (char*);
void InitOrientationPointWidget();
+ void showOutlineActor(bool value);
// EED 25 Janvier 2007 testLoic
void TestLoic1();
#include "HistogramDialog.h"
-wxVtkMPR3DViewCntrlPanel::wxVtkMPR3DViewCntrlPanel(wxWindow *parent, wxVtkMPR3DView *wxvtkmpr3Dview )
+wxVtkMPR3DViewCntrlPanel::wxVtkMPR3DViewCntrlPanel(wxWindow *parent, wxVtkMPR3DView *wxvtkmpr3Dview, bool align )
: wxPanel(parent, -1)
{
int maxY = 1;
int maxZ = 1;
+ //CPR: Modified 30 Nov 2009
+ /*
wxCheckBox *ckBoxX = new wxCheckBox(panel,-1,_T("X "));
_positionX = new wxSlider(panel,-1,maxX/2,0,maxX, wxDefaultPosition, wxSize(150,40), wxSL_HORIZONTAL | wxSL_LABELS);
wxCheckBox *ckBoxY = new wxCheckBox(panel,-1,_T("Y "));
wxCheckBox *ckBoxZ = new wxCheckBox(panel,-1,_T("Z "));
_positionZ = new wxSlider(panel,-1,maxZ/2,0,maxZ, wxDefaultPosition, wxSize(150,40), wxSL_HORIZONTAL | wxSL_LABELS);
wxButton *btnColorTable = new wxButton (panel, -1, _T("Edit Color Table") );
+ */
+
+ ckBoxX = new wxCheckBox(panel,-1,_T("X "));
+ _positionX = new wxSlider(panel,-1,maxX/2,0,maxX, wxDefaultPosition, wxSize(150,40), wxSL_HORIZONTAL | wxSL_LABELS);
+ ckBoxY = new wxCheckBox(panel,-1,_T("Y "));
+ _positionY = new wxSlider(panel,-1,maxY/2,0,maxY, wxDefaultPosition, wxSize(150,40), wxSL_HORIZONTAL | wxSL_LABELS);
+ ckBoxZ = new wxCheckBox(panel,-1,_T("Z "));
+ _positionZ = new wxSlider(panel,-1,maxZ/2,0,maxZ, wxDefaultPosition, wxSize(150,40), wxSL_HORIZONTAL | wxSL_LABELS);
+ wxButton *btnColorTable = new wxButton (panel, -1, _T("Edit Color Table") );
- _ckBoxXYZ = new wxCheckBox(panel,-1,_T("XYZ "));
- _ckBoxPlane = new wxCheckBox(panel,-1,_T("Plane"));
+ _ckBoxXYZ = new wxCheckBox(panel,-1,_T("XYZ "));
+ _ckBoxPlane = new wxCheckBox(panel,-1,_T("Plane"));
ckBoxX->SetValue(false);
ckBoxY->SetValue(false);
Connect(_ckBoxXYZ->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnVisibleAxisXYZ );
Connect(_ckBoxPlane->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnVisiblePlane );
+ wxFlexGridSizer *sizer;
+
+ // wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
+ // wxBoxSizer *sizerH4 = new wxBoxSizer(wxHORIZONTAL);
+
+ //CPR: If-else statements added 30 Nov 2009
+ wxFlexGridSizer *sizerH4;
+ wxFlexGridSizer *sizerH5;
+ if(align)
+ {
+ sizer = new wxFlexGridSizer(2);
+
+ sizerH4 = new wxFlexGridSizer(2);
+ sizerH4->Add( _positionX ,1,wxGROW , 0 );
+ sizerH4->Add( ckBoxX ,0,wxALIGN_CENTER_VERTICAL|wxSHAPED , 0 );
+ sizerH4->Add( _positionY ,1,wxGROW , 0 );
+ sizerH4->Add( ckBoxY ,0,wxALIGN_CENTER_VERTICAL|wxSHAPED , 0 );
+ sizerH4->Add( _positionZ ,1,wxGROW , 0 );
+ sizerH4->Add( ckBoxZ ,0,wxALIGN_CENTER_VERTICAL|wxSHAPED , 0 );
+
+ sizerH5 = new wxFlexGridSizer(1);
+ sizerH5->Add( new wxStaticText(panel, -1,_T(" ")) , 1, wxALL|wxEXPAND, 0);
+ sizerH5->Add( _ckBoxXYZ , 1, wxALL|wxEXPAND, 0);
+ sizerH5->Add( new wxStaticText(panel, -1,_T(" ")) , 1, wxALL|wxEXPAND, 0);
+ sizerH5->Add( _ckBoxPlane , 1, wxALL|wxEXPAND, 0);
+ sizerH5->Add( new wxStaticText(panel, -1,_T(" ")) , 1, wxALL|wxEXPAND, 0);
+ sizerH5->Add( btnColorTable ,0,wxALIGN_CENTER_VERTICAL|wxSHAPED , 0 );
+ //sizerH5->Add( new wxStaticText(panel, -1,_T(" ")) , 1, wxALL|wxEXPAND, 0);
+ }
+ else
+ {
+ sizer = new wxFlexGridSizer(1);
+
+ sizerH4 = new wxFlexGridSizer(10);
+ sizerH5 = new wxFlexGridSizer(10);
+
+ sizerH4->Add( _positionX ,1,wxGROW , 0 );
+ sizerH4->Add( ckBoxX ,0,wxALIGN_CENTER_VERTICAL|wxSHAPED , 0 );
+ sizerH4->Add( _positionY ,1,wxGROW , 0 );
+ sizerH4->Add( ckBoxY ,0,wxALIGN_CENTER_VERTICAL|wxSHAPED , 0 );
+ sizerH4->Add( _positionZ ,1,wxGROW , 0 );
+ sizerH4->Add( ckBoxZ ,0,wxALIGN_CENTER_VERTICAL|wxSHAPED , 0 );
+ sizerH4->Add( btnColorTable ,0,wxALIGN_CENTER_VERTICAL|wxSHAPED , 0 );
+
+ sizerH5->Add( _ckBoxXYZ , 1, wxALL|wxEXPAND, 0);
+ sizerH5->Add( _ckBoxPlane , 1, wxALL|wxEXPAND, 0);
+ sizerH5->Add( new wxStaticText(panel, -1,_T(" ")) , 1, wxALL|wxEXPAND, 0);
+ }
+
- wxFlexGridSizer *sizer = new wxFlexGridSizer(1);
-// wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
-
-// wxBoxSizer *sizerH4 = new wxBoxSizer(wxHORIZONTAL);
- wxFlexGridSizer *sizerH4 = new wxFlexGridSizer(10);
- wxFlexGridSizer *sizerH5 = new wxFlexGridSizer(10);
-
-
-
-//EED 28 sep 2006
-// wxFlexGridSizer *sizerH6 = new wxFlexGridSizer(10);
-// wxFlexGridSizer *sizerH7 = new wxFlexGridSizer(10);
-
-// sizerH4->Add( ckBoxX , 1, wxALL|wxEXPAND, 0);
-// sizerH4->Add( new wxStaticText(panel, -1," ") , 1, wxALL|wxEXPAND, 0);
-// sizerH4->Add( _positionX , 1, wxALL|wxEXPAND, 0);
+ //EED 28 sep 2006
+ // wxFlexGridSizer *sizerH6 = new wxFlexGridSizer(10);
+ // wxFlexGridSizer *sizerH7 = new wxFlexGridSizer(10);
-// sizerH5->Add( ckBoxY , 1, wxALL|wxEXPAND, 0);
-// sizerH5->Add( new wxStaticText(panel, -1," ") , 1, wxALL|wxEXPAND, 0);
-// sizerH5->Add( _positionY , 1, wxALL|wxEXPAND, 0);
+ // sizerH4->Add( ckBoxX , 1, wxALL|wxEXPAND, 0);
+ // sizerH4->Add( new wxStaticText(panel, -1," ") , 1, wxALL|wxEXPAND, 0);
+ // sizerH4->Add( _positionX , 1, wxALL|wxEXPAND, 0);
-// sizerH6->Add( ckBoxZ , 1, wxALL|wxEXPAND, 0);
-// sizerH6->Add( new wxStaticText(panel, -1," ") , 1, wxALL|wxEXPAND, 0);
-// sizerH6->Add( _positionZ , 1, wxALL|wxEXPAND, 0);
+ // sizerH5->Add( ckBoxY , 1, wxALL|wxEXPAND, 0);
+ // sizerH5->Add( new wxStaticText(panel, -1," ") , 1, wxALL|wxEXPAND, 0);
+ // sizerH5->Add( _positionY , 1, wxALL|wxEXPAND, 0);
-// sizerH7->Add( _ckBoxXYZ , 1, wxALL|wxEXPAND, 0);
-// sizerH7->Add( _ckBoxPlane , 1, wxALL|wxEXPAND, 0);
+ // sizerH6->Add( ckBoxZ , 1, wxALL|wxEXPAND, 0);
+ // sizerH6->Add( new wxStaticText(panel, -1," ") , 1, wxALL|wxEXPAND, 0);
+ // sizerH6->Add( _positionZ , 1, wxALL|wxEXPAND, 0);
-// sizer->Add( sizerH4 , 1, wxALL|wxEXPAND, 2);
-// sizer->Add( sizerH5 , 1, wxALL|wxEXPAND, 2);
-// sizer->Add( sizerH6 , 1, wxALL|wxEXPAND, 2);
-// sizer->Add( sizerH7 , 1, wxALL|wxEXPAND, 2);
+ // sizerH7->Add( _ckBoxXYZ , 1, wxALL|wxEXPAND, 0);
+ // sizerH7->Add( _ckBoxPlane , 1, wxALL|wxEXPAND, 0);
- sizerH4->Add( _positionX ,1,wxGROW , 0 );
- sizerH4->Add( ckBoxX ,0,wxALIGN_CENTER_VERTICAL|wxSHAPED , 0 );
- sizerH4->Add( _positionY ,1,wxGROW , 0 );
- sizerH4->Add( ckBoxY ,0,wxALIGN_CENTER_VERTICAL|wxSHAPED , 0 );
- sizerH4->Add( _positionZ ,1,wxGROW , 0 );
- sizerH4->Add( ckBoxZ ,0,wxALIGN_CENTER_VERTICAL|wxSHAPED , 0 );
- sizerH4->Add( btnColorTable ,0,wxALIGN_CENTER_VERTICAL|wxSHAPED , 0 );
+ // sizer->Add( sizerH4 , 1, wxALL|wxEXPAND, 2);
+ // sizer->Add( sizerH5 , 1, wxALL|wxEXPAND, 2);
+ // sizer->Add( sizerH6 , 1, wxALL|wxEXPAND, 2);
+ // sizer->Add( sizerH7 , 1, wxALL|wxEXPAND, 2);
- sizerH5->Add( _ckBoxXYZ , 1, wxALL|wxEXPAND, 0);
- sizerH5->Add( _ckBoxPlane , 1, wxALL|wxEXPAND, 0);
- sizerH5->Add( new wxStaticText(panel, -1,_T(" ")) , 1, wxALL|wxEXPAND, 0);
-// sizerH5->Add( ckBoxX , 1, wxALL|wxEXPAND, 0);
-// sizerH5->Add( ckBoxY , 1, wxALL|wxEXPAND, 0);
-// sizerH5->Add( ckBoxZ , 1, wxALL|wxEXPAND, 0);
+
+ // sizerH5->Add( ckBoxX , 1, wxALL|wxEXPAND, 0);
+ // sizerH5->Add( ckBoxY , 1, wxALL|wxEXPAND, 0);
+ // sizerH5->Add( ckBoxZ , 1, wxALL|wxEXPAND, 0);
sizer->Add( sizerH4 , 1, wxALL|wxGROW, 2);
sizer->Add( sizerH5 , 1, wxALL|wxEXPAND, 2);
-
panel->SetSize(400,50);
panel->SetAutoLayout(true);
panel->SetSizer(sizer);
//-------------------------------------------------------------------
void wxVtkMPR3DViewCntrlPanel::OnEditColorTable(wxCommandEvent& event)
{
-
+
vtkColorTransferFunction *ctfun = this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetvtkColorTransferFunction();
std::vector<double> *ctfunVectorPoint = this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetctFunVectorPoint();
std::vector<double> *ctfunVectorRed = this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetctFunVectorRed();
double g = (*ctfunVectorGreen)[i];
double b = (*ctfunVectorBlue)[i];
-hDlg->addColorPoint(gr,(int)(r*255),(int)(g*255),(int)(b*255));
+ hDlg->addColorPoint(gr,(int)(r*255),(int)(g*255),(int)(b*255));
i++;
}
}
//-------------------------------------------------------------------
void wxVtkMPR3DViewCntrlPanel::OnVisibleAxisX(wxCommandEvent& event)
{
+
_wxvtkmpr3Dview->VisibleImageActor(0, event.IsChecked() );
_wxvtkmpr3Dview->Refresh();
-
+
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
try{
_wxvtkmpr3Dview->VisibleImageActor(1, event.IsChecked() );
_wxvtkmpr3Dview->Refresh();
- wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+ wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
}
//-------------------------------------------------------------------
void wxVtkMPR3DViewCntrlPanel::OnVisibleAxisXYZ(wxCommandEvent& event)
{
+
_wxvtkmpr3Dview->VisiblePointWidget(event.IsChecked());
}
{
_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetX( _positionX->GetValue() );
_wxvtkmpr3Dview->RefreshView();
+
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
}
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
}
+
+//-------------------------------------------------------------------
+bool wxVtkMPR3DViewCntrlPanel::GetVisibleX()
+{
+ return ckBoxX->GetValue();
+}
+
+//-------------------------------------------------------------------
+bool wxVtkMPR3DViewCntrlPanel::GetVisibleY()
+{
+ return ckBoxY->GetValue();
+}
+
+//-------------------------------------------------------------------
+bool wxVtkMPR3DViewCntrlPanel::GetVisibleZ()
+{
+ return ckBoxZ->GetValue();
+}
\ No newline at end of file
class wxVtkMPR3DViewCntrlPanel: public wxPanel
{
public:
- wxVtkMPR3DViewCntrlPanel(wxWindow *parent, wxVtkMPR3DView *wxvtkmpr3Dview);
+ wxVtkMPR3DViewCntrlPanel(wxWindow *parent, wxVtkMPR3DView *wxvtkmpr3Dview, bool align);
~wxVtkMPR3DViewCntrlPanel();
void OnVisibleAxisX(wxCommandEvent& event);
void OnVisibleAxisY(wxCommandEvent& event);
virtual void Refresh();
void UpdateControlPanel();
+ bool GetVisibleX();
+ bool GetVisibleY();
+ bool GetVisibleZ();
+
private:
wxVtkMPR3DView *_wxvtkmpr3Dview;
wxSlider *_positionX;
wxSlider *_positionY;
wxSlider *_positionZ;
+
+ //CPR: Added 30 nov 2009
+ wxCheckBox *ckBoxX;
+ wxCheckBox *ckBoxY;
+ wxCheckBox *ckBoxZ;
wxCheckBox *_ckBoxXYZ;
wxCheckBox *_ckBoxPlane;