src/interface/wxWindows/widgets/pPlotter
src/interface/wxWindows/widgets/manualContour
src/interface/wxWindows/widgets/ThresholdImageView
+ src/CutModule/interface
+ src/CutModule/kernel
../../../
)
${CREA_LIBRARIES}
#${BOOST_LIBRARIES}
#jhcl-End===========================================================================
+ creaMaracasVisu_CutModule_interface
)
#----------------------------------------------------------------------------
-#ifndef FIGURECUTTINGMODEL_H_
-#define FIGURECUTTINGMODEL_H_
+#ifndef CUTTINGMODELFIGURE_H_
+#define CUTTINGMODELFIGURE_H_
#include "vtkTransform.h"
#include "vtkPolyData.h"
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);
+ panelcut = new wxPanel(this, -1);
+ viewer = new wxMaracas_N_ViewersWidget(panelcut, img, type);
+ sizer = new wxFlexGridSizer(2);
- sizer->Add(viewer, 1, wxGROW);
- this->SetSizer( sizer, true );
- this->SetAutoLayout( true );
- //viewer->SetSize(wxSizer(wxFIXED_MINSIZE));
+ sizer->Add(viewer, wxALL|wxEXPAND, 1);
+ panelcut->SetSizer( sizer, true );
+ panelcut->SetAutoLayout( true );
+ //viewer->SetSize(wxSizer(wxALL|wxEXPAND));
}
/**
/**
** Adds a new panel to the frame
**/
-void wxMaracasDialog_NViewers::AddPanel(wxPanel panel)
+void wxMaracasDialog_NViewers::AddPanel(wxWindow* panel)
{
- wxFlexGridSizer* sizer = new wxFlexGridSizer(1);
+ //wxFlexGridSizer* sizer = new wxFlexGridSizer(1);
- //this->AddChild(panel);
- //sizer->Add(panel, wxFIXED_MINSIZE);
- this->SetSizer( sizer, true );
- this->SetAutoLayout( true );
+ panel->SetSize(400, 200);
+
+ sizer->Add(panel, wxALL|wxEXPAND);
+ panelcut->SetSizer( sizer, true );
+ panelcut->SetAutoLayout( true );
}
+/**
+**
+**/
void wxMaracasDialog_NViewers::OnRefreshView(wxCommandEvent & event)
{
point.clear();
viewer->OnRefreshView(event);
}
+/**
+**
+**/
void wxMaracasDialog_NViewers::OnDClickLeft(wxCommandEvent & event)
{
viewer->OnDClickLeft(event);
+}
+
+/**
+**
+**/
+wxMaracas_N_ViewersWidget* wxMaracasDialog_NViewers::getViewer()
+{
+ return viewer;
+}
+
+/**
+**
+**/
+wxPanel* wxMaracasDialog_NViewers::getinternalPanel()
+{
+ return panelcut;
}
\ No newline at end of file
~wxMaracasDialog_NViewers();
void OnRefreshView(wxCommandEvent & event);
void OnDClickLeft(wxCommandEvent & event);
- void AddPanel(wxPanel panel);
+ void AddPanel(wxWindow* panel);
+ wxMaracas_N_ViewersWidget* getViewer();
+ wxPanel* getinternalPanel();
private:
wxMaracas_N_ViewersWidget* viewer;
std::vector<int> point;
+
+ wxFlexGridSizer* sizer;
+ wxPanel* panelcut;
DECLARE_EVENT_TABLE( );
#include "wxMaracasRenderImageManagementPanel.h"
+
#include <vtkVolume.h>
/**
sliderTranslateX->SetLineSize(1);
Connect(sliderTranslateX->GetId(), wxEVT_COMMAND_SLIDER_UPDATED, (wxObjectEventFunction)&wxMaracasRenderImageManagementPanel::Transform);
sizersliders->Add(tx, wxFIXED_MINSIZE);
- sizersliders->Add(sliderTranslateX,wxSizerFlags().Expand().Center());
+ sizersliders->Add(sliderTranslateX, 1, wxALL|wxEXPAND, 2);
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_COMMAND_SLIDER_UPDATED, (wxObjectEventFunction)&wxMaracasRenderImageManagementPanel::Transform);
sizersliders->Add(ty, wxFIXED_MINSIZE);
- sizersliders->Add(sliderTranslateY,wxSizerFlags().Expand().Center());
+ sizersliders->Add(sliderTranslateY, 1, wxALL|wxEXPAND, 2);
wxStaticText* tz = new wxStaticText(this, -1, wxString(_T(" Translate Z ")));
sliderTranslateZ = new wxSlider(this, -1, 0, -200, 200, wxDefaultPosition, wxDefaultSize, wxSL_LABELS);
#include "wxMaracasRenderImageTransformation.h"
+#include "wxMaracasRendererView.h"
/**
** Class constructor
transformS1 = vtkTransform::New();
transformS2 = vtkTransform::New();
transformS3 = vtkTransform::New();
-
}
/**
double volspY;
double volspZ;
vol->getImageData()->GetSpacing(volspX, volspY, volspZ);
-
+
double surfspX;
double surfspY;
double surfspZ;
surface1->getImageData()->GetSpacing(surfspX, surfspY, surfspZ);
- transformV->Identity();
- transformS1->Identity();
- transformS2->Identity();
- transformS3->Identity();
+ int ext[6];
+ vol->getImageData()->GetExtent(ext);
- 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 ->Identity();
+ transformS1 ->Identity();
+ transformS2 ->Identity();
+ transformS3 ->Identity();
- 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 ->PostMultiply();
+ transformS1 ->PostMultiply();
+ transformS2 ->PostMultiply();
+ transformS3 ->PostMultiply();
+
+ printf("CPR: wxMaracasRenderImageTransformation::Translate-> %d\n", -(ext[1]-ext[0])*volspX );
+ printf("CPR: wxMaracasRenderImageTransformation::Translate-> %d\n", -(ext[3]-ext[2])*surfspY);
+ printf("CPR: wxMaracasRenderImageTransformation::Translate-> %d\n", -(ext[5]-ext[4])*surfspZ);
- transformV->RotateZ( rz*volspZ );
- transformS1->RotateZ( rz*surfspZ );
- transformS2->RotateZ( rz*surfspZ );
- transformS3->RotateZ( rz*surfspZ );
+ transformV ->Translate( -(ext[1]-ext[0])*volspX/2, -(ext[3]-ext[2])*volspY/2, -(ext[5]-ext[4])*volspZ/2 );
+ transformS1->Translate( -(ext[1]-ext[0])*surfspX/2, -(ext[3]-ext[2])*surfspY/2, -(ext[5]-ext[4])*surfspZ/2 );
+ transformS2->Translate( -(ext[1]-ext[0])*surfspX/2, -(ext[3]-ext[2])*surfspY/2, -(ext[5]-ext[4])*surfspZ/2 );
+ transformS3->Translate( -(ext[1]-ext[0])*surfspX/2, -(ext[3]-ext[2])*surfspY/2, -(ext[5]-ext[4])*surfspZ/2 );
- transformV->Scale( (sx/100.0), (sy/100.0), (sz/100.0) );
+ transformV ->Scale( (sx/100.0), (sy/100.0), (sz/100.0) );
transformS1->Scale( (sx/100.0), (sy/100.0), (sz/100.0) );
transformS2->Scale( (sx/100.0), (sy/100.0), (sz/100.0) );
transformS3->Scale( (sx/100.0), (sy/100.0), (sz/100.0) );
+ transformV ->RotateX( rx );
+ transformS1->RotateX( rx );
+ transformS2->RotateX( rx );
+ transformS3->RotateX( rx );
+
+ transformV ->RotateY( ry );
+ transformS1->RotateY( ry );
+ transformS2->RotateY( ry );
+ transformS3->RotateY( ry );
+
+ transformV ->RotateZ( rz );
+ transformS1->RotateZ( rz );
+ transformS2->RotateZ( rz );
+ transformS3->RotateZ( rz );
+
+ transformV ->Translate( tx*volspX + (ext[1]-ext[0])*volspX/2, ty*volspY + (ext[3]-ext[2])*volspY/2, tz*volspZ + (ext[5]-ext[4])*volspZ/2 );
+ transformS1->Translate( tx*surfspX + (ext[1]-ext[0])*volspX/2, ty*surfspY + (ext[3]-ext[2])*volspY/2, tz*surfspZ + (ext[5]-ext[4])*volspZ/2 );
+ transformS2->Translate( tx*surfspX + (ext[1]-ext[0])*volspX/2, ty*surfspY + (ext[3]-ext[2])*volspY/2, tz*surfspZ + (ext[5]-ext[4])*volspZ/2 );
+ transformS3->Translate( tx*surfspX + (ext[1]-ext[0])*volspX/2, ty*surfspY + (ext[3]-ext[2])*volspY/2, tz*surfspZ + (ext[5]-ext[4])*volspZ/2 );
+
Refresh();
}
-
/**
** Updates each Matrix
**/
transformS3->Update();
vol->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
- //vol->getRenderer()->Render();
+ //vol->Update(propID);
surface1->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
- //surface1->getRenderer()->Render();
+ //surface1->Update(propID);
surface2->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
//surface2->getRenderer()->Render();
//wxMaracasRenderTabbedPanel::getInstance()->addRemoveActorSA(_propid, false);
//wxMaracasRenderTabbedPanel::getInstance()->addRemoveActorSB(_propid, false);
//wxMaracasRenderTabbedPanel::getInstance()->addRemoveActorSC(_propid, false);
+ if( vtkmpr3Ddataviewer ) { delete vtkmpr3Ddataviewer; }
+ if( mwxvtkmpr3Dview ) { delete mwxvtkmpr3Dview; }
+
this->deleteVolume(_id);
delete dialog;
delete wxtabs;
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);
+ checkboxVol->SetValue(false);
sizercheck->Add(checkboxVol, wxFIXED_MINSIZE);
checkboxSA = new wxCheckBox(this,-1,wxString(_T("Surface Rendering A")));
Connect(checkboxSA->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction)&wxMaracasRenderTabbedPanel::onCheckBoxSAChange);
- checkboxSA->SetValue(true);
+ checkboxSA->SetValue(false);
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);
+ checkboxViewer->SetValue(true);
sizercheck->Add(checkboxViewer, wxFIXED_MINSIZE);
checkboxSB = new wxCheckBox(this,-1,wxString(_T("Surface Rendering B")));
wxMaracasMultipleVolumeRendererPanel* controlpanV = new wxMaracasMultipleVolumeRendererPanel(wxtabs, _propidV, img, true);
wxtabs->AddPage(controlpanV, _T("Vol Rendering"), true);
controlpanV->updateVolume();
+ wxtabs->GetPage(0)->Disable();
+
+ volmanager->addRemoveActor(this->getPropIdV(), checkboxSC->GetValue());
}
}
catch(char* str)
int maxiso = surrendmanager1->getMaxIsoValue(_propidSA);
((wxMaracasSurfaceRenderingProp3DMHD*)controlpanSA)->createControls(maxiso);
wxtabs->AddPage(controlpanSA, _T("SR A"));
+ wxtabs->GetPage(1)->Disable();
+
+ surrendmanager1->addRemoveActor(this->getPropIdV(), checkboxSC->GetValue());
}
}
catch(char* str)
wxtabs->AddPage(controlpanSB, _T("SR B"));
wxtabs->GetPage(2)->Disable();
+ surrendmanager2->addRemoveActor(this->getPropIdV(), checkboxSC->GetValue());
+
}
}
catch(char* str)
((wxMaracasSurfaceRenderingProp3DMHD*)controlpanSC)->createControls(maxiso);
wxtabs->AddPage(controlpanSC, _T("SR C"));
wxtabs->GetPage(3)->Disable();
+
+ surrendmanager3->addRemoveActor(this->getPropIdV(), checkboxSC->GetValue());
}
}
catch(char* str)
spc[2] = 0;
vtkMPRBaseData* mvtkmprbasedata = new vtkMPRBaseData();
- marImageData* marimagedata = new marImageData( getVolImage() );
- mvtkmprbasedata->SetMarImageData(marimagedata);
+ marImageData* marimagedata = new marImageData( getVolImage() );
+ mvtkmprbasedata ->SetMarImageData(marimagedata);
mwxvtkmpr3Dview = new wxVtkMPR3DView( baseView );
vtkmpr3Ddataviewer = new vtkMPR3DDataViewer();
- wxPanel *panelControl = new wxPanel(wxtabs,-1);
+ wxPanel *panelControl = new wxPanel(wxtabs,-1);
controlPanelMPR3D = mwxvtkmpr3Dview->CreateControlPanel(panelControl, true);
- wxFlexGridSizer *sizerCtrol = new wxFlexGridSizer(1);
- sizerCtrol->Add(controlPanelMPR3D, 1, wxALL|wxEXPAND, 2);
+ 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();
mwxvtkmpr3Dview ->ResetCamera(ext,org,spc);
}
+ int id = 4;
wxtabs->AddPage(panelControl, _T("MPR"));
- wxtabs->GetPage(4)->Disable();
- mwxvtkmpr3Dview->showOutlineActor(false);
+ wxtabs->GetPage(id)->Enable();
+ wxtabs->SetSelection(id);
+
+ ((wxVtkMPR3DViewCntrlPanel*)controlPanelMPR3D)->SetVisibleZ(true);
+ ((wxVtkMPR3DViewCntrlPanel*)controlPanelMPR3D)->SetVisibleXYZ(true);
+ mwxvtkmpr3Dview->showOutlineActor(true);
mwxvtkmpr3Dview->Refresh();
}
bool valueX = ((wxVtkMPR3DViewCntrlPanel*) controlPanelMPR3D)->GetVisibleX();
bool valueY = ((wxVtkMPR3DViewCntrlPanel*) controlPanelMPR3D)->GetVisibleY();
bool valueZ = ((wxVtkMPR3DViewCntrlPanel*) controlPanelMPR3D)->GetVisibleZ();
+ bool valueXYZ = ((wxVtkMPR3DViewCntrlPanel*) controlPanelMPR3D)->GetVisibleXYZ();
+ bool valuePlane = ((wxVtkMPR3DViewCntrlPanel*) controlPanelMPR3D)->GetVisiblePlane();
mwxvtkmpr3Dview->VisibleImageActor( 0, valueX );
mwxvtkmpr3Dview->VisibleImageActor( 1, valueY );
mwxvtkmpr3Dview->VisibleImageActor( 2, valueZ );
+ mwxvtkmpr3Dview->VisiblePointWidget(valueXYZ);
+ mwxvtkmpr3Dview->VisiblePlaneWidget(valuePlane);
mwxvtkmpr3Dview->showOutlineActor(true);
+
mwxvtkmpr3Dview->Refresh();
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
{
wxtabs->GetPage(id)->Disable();
+ mwxvtkmpr3Dview->VisiblePointWidget(false);
+ mwxvtkmpr3Dview->VisiblePlaneWidget(false);
mwxvtkmpr3Dview->VisibleImageActor(0, false );
mwxvtkmpr3Dview->VisibleImageActor(1, false );
mwxvtkmpr3Dview->VisibleImageActor(2, false );
if(dialog == NULL)
{
dialog = new wxMaracasRenderImageManagementPanel(this, volmanager, surrendmanager1, surrendmanager2, surrendmanager3, volname, _id);
- dialog->SetSize(400, 580);
+ dialog->SetSize(460, 580);
dialog->Show();
}
else if(dialog != NULL)
type.push_back(3);
wxMaracasDialog_NViewers* dialog1 = new wxMaracasDialog_NViewers(this, img, &type, wxString(_T("Cut Module") ));
- //dialog1->SetSize(800, 700);
+ dialog1->SetSize(800, 700);
std::string path = crea::System::GetDllAppPath("bbcreaMaracasVisu.dll");
- //cutter = new CutModel2MainPanel(dialog1, path);
+ cutter = CutModel2MainPanel::getInstance(dialog1->getinternalPanel(), path);
+ cutter->setRenderer( dialog1->getViewer()->GetwxVtkBaseView(1)->GetRenderer() );
+ cutter->setInteractor( dialog1->getViewer()->GetwxVtkBaseView(1)->GetWxVTKRenderWindowInteractor() );
+ cutter->setImageData(getVolImage());
- //dialog1->AddPanel(cutter);
+ dialog1->AddPanel(cutter);
dialog1->Show();
}
#include <wx/notebook.h>
#include "wxMaracasRenderImageManagementPanel.h"
-//#include "CutModelMainPanel.h"
+#include "CutModel2MainPanel.h"
#include "wxMaracasMultipleVolumeRendererManager.h"
#include "wxMaracasSurfaceRenderingManager.h"
#include "wxVtkBaseView.h"
void addSurface3(vtkImageData* img, std::string dataname);
void deleteVolume(int volid);
- void Transform(vtkMatrix4x4* tmatrix);
void addRemoveActorV(int id, bool addremove);
void addRemoveActorSA(int id, bool addremove);
void addRemoveActorSB(int id, bool addremove);
bool first;
int _id;
- //CutModel2MainPanel* cutter;
+ CutModel2MainPanel* cutter;
wxMaracasRenderImageManagementPanel* dialog;
wxMaracasMultipleVolumeRendererManager* volmanager;
wxMaracasSurfaceRenderingManager* surrendmanager1;
Program: wxMaracas
Module: $RCSfile: wxMaracas_ViewerWidget.cxx,v $
Language: C++
- Date: $Date: 2009/11/30 20:52:51 $
- Version: $Revision: 1.20 $
+ Date: $Date: 2009/12/01 21:22:12 $
+ Version: $Revision: 1.21 $
Copyright: (c) 2002, 2003
License:
if ( mwidgetMesure !=NULL ) { mwidgetMesure -> SetMesureScale( 1 ); }
if ( mwxsphereview !=NULL ) { mwxsphereview -> 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) {
//-------------------------------------------------------------------
void wxVtk3DBaseView::Configure()
{
- printf("EED wxVtk3DBaseView::Configure A\n");
+ //printf("EED wxVtk3DBaseView::Configure A\n");
if (_configure==false)
{
- printf("EED wxVtk3DBaseView::Configure B\n");
+ //printf("EED wxVtk3DBaseView::Configure B\n");
_configure=true;
//wxVtkBaseView::Configure();
_aRenderer = vtkRenderer::New();
GetWxVTKRenderWindowInteractor()->SetRenderWindow(_renWin);
-
-// EED Borrame
-// vtkInteractorStyle3DMaracas *interactorStyle3DMaracas = vtkInteractorStyle3DMaracas::New();
vtkInteractorStyleBaseView3D *interactorStyleBaseView3D = vtkInteractorStyleBaseView3D::New();
SetInteractorStyleBaseView( interactorStyleBaseView3D );
GetWxVTKRenderWindowInteractor()->SetInteractorStyle( interactorStyleBaseView3D );
interactorStyleBaseView3D->SetwxVtkBaseView(this);
-
-/* EED Borrame
- vtkInteractorStyleSwitch *iss = dynamic_cast<vtkInteractorStyleSwitch*>(_iren->GetInteractorStyle());
- iss->SetCurrentStyleToTrackballCamera();
-*/
-
// It is convenient to create an initial view of the data. The
// FocalPoint and Position form a vector direction. Later on
// (ResetCamera() method) this vector is used to position the camera
sizer = new wxFlexGridSizer(2);
sizerH4 = new wxFlexGridSizer(2);
- sizerH4->Add( _positionX ,1,wxGROW , 0 );
+ sizerH4->Add( _positionX ,1,wxGROW , 0 );
sizerH4->Add( ckBoxX ,0,wxALIGN_CENTER_VERTICAL|wxSHAPED , 0 );
- sizerH4->Add( _positionY ,1,wxGROW , 0 );
+ sizerH4->Add( _positionY ,1,wxGROW , 0 );
sizerH4->Add( ckBoxY ,0,wxALIGN_CENTER_VERTICAL|wxSHAPED , 0 );
- sizerH4->Add( _positionZ ,1,wxGROW , 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);
+ 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
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);
+ 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);
}
// 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);
+ sizer->Add( sizerH4, 1, wxALL|wxGROW, 2);
+ sizer->Add( sizerH5, 1, wxALL|wxEXPAND,2);
panel->SetSize(400,50);
panel->SetAutoLayout(true);
panel->SetEventHandler((wxEvtHandler*)this);
//this->UpdateControlPanel();
-
}
void wxVtkMPR3DViewCntrlPanel::UpdateControlPanel()
{
}catch(char* e){
std::cout<<e<<std::endl;
}
-
}
//-------------------------------------------------------------------
void wxVtkMPR3DViewCntrlPanel::OnVisibleAxisY(wxCommandEvent& event)
void wxVtkMPR3DViewCntrlPanel::OnVisiblePlane(wxCommandEvent& event)
{
_wxvtkmpr3Dview->VisiblePlaneWidget(event.IsChecked());
-}
+}
//-------------------------------------------------------------------
void wxVtkMPR3DViewCntrlPanel::OnPositionX(wxScrollEvent& event)
bool wxVtkMPR3DViewCntrlPanel::GetVisibleZ()
{
return ckBoxZ->GetValue();
+}
+
+//-------------------------------------------------------------------
+bool wxVtkMPR3DViewCntrlPanel::GetVisibleXYZ()
+{
+ return _ckBoxXYZ->GetValue();
+}
+
+//-------------------------------------------------------------------
+bool wxVtkMPR3DViewCntrlPanel::GetVisiblePlane()
+{
+ return _ckBoxPlane->GetValue();
+}
+
+//-------------------------------------------------------------------
+void wxVtkMPR3DViewCntrlPanel::SetVisibleX(bool value)
+{
+ ckBoxX->SetValue(value);
+
+ _wxvtkmpr3Dview->VisibleImageActor(0, value );
+ _wxvtkmpr3Dview->Refresh();
+
+ wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+ _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+}
+
+//-------------------------------------------------------------------
+void wxVtkMPR3DViewCntrlPanel::SetVisibleY(bool value)
+{
+ ckBoxY->SetValue(value);
+
+ _wxvtkmpr3Dview->VisibleImageActor(1, value );
+ _wxvtkmpr3Dview->Refresh();
+
+ wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+ _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+}
+
+//-------------------------------------------------------------------
+void wxVtkMPR3DViewCntrlPanel::SetVisibleZ(bool value)
+{
+ ckBoxZ->SetValue(value);
+
+ _wxvtkmpr3Dview->VisibleImageActor(2, value );
+ _wxvtkmpr3Dview->Refresh();
+
+ wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+ _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+}
+
+//-------------------------------------------------------------------
+void wxVtkMPR3DViewCntrlPanel::SetVisibleXYZ(bool value)
+{
+ _ckBoxXYZ->SetValue(value);
+ _wxvtkmpr3Dview->VisiblePointWidget(value);
+
+}
+
+//-------------------------------------------------------------------
+void wxVtkMPR3DViewCntrlPanel::SetVisiblePlane(bool value)
+{
+ _ckBoxPlane->SetValue(value);
+ _wxvtkmpr3Dview->VisiblePlaneWidget(value);
}
\ No newline at end of file
bool GetVisibleX();
bool GetVisibleY();
bool GetVisibleZ();
+ bool GetVisibleXYZ();
+ bool GetVisiblePlane();
+ void SetVisibleX(bool value);
+ void SetVisibleY(bool value);
+ void SetVisibleZ(bool value);
+ void SetVisibleXYZ(bool value);
+ void SetVisiblePlane(bool value);
private:
wxVtkMPR3DView *_wxvtkmpr3Dview;