_ckBoxOutlinePlane = new wxCheckBox(panel,-1,_T("Outline Plane"));
_ckBoxOutlinePlane->SetValue(true);
-
-
// _ckBoxBackGroundBlack= new wxCheckBox(panel,-1,_T("Background Black"));;
// _ckBoxBackGroundBlack->SetValue(false);
// EED Borrame
wxFlexGridSizer *sizerH5;
wxFlexGridSizer *sizerH6;
wxFlexGridSizer *sizerH7;
-
if(align)
{
sizer = new wxFlexGridSizer(4);
sizerH4 = new wxFlexGridSizer(3);
-
sizerH4a = new wxFlexGridSizer(3);
-
sizerH4->Add( new wxStaticText(panel, -1,_T(" ")) ,1, wxALL|wxEXPAND , 0);
sizerH4->Add( new wxStaticText(panel, -1,_T("GL")) ,1, wxALL|wxEXPAND , 0);
sizerH4->Add( new wxStaticText(panel, -1,_T("Color ")),1, wxALL|wxEXPAND , 0);
sizerH4->Add( _positionZ ,1, wxGROW , 0);
sizerH4->Add( _ckFreePlaneZ ,1, wxALL|wxEXPAND , 0);
sizerH4->Add( _ckBoxZ ,0, wxALIGN_CENTER_VERTICAL|wxSHAPED , 0);
-
//EED 2016/02/19
sizerH4->Add( _ckBoxInterpolate ,1, wxALL|wxEXPAND , 0);
sizerH4->Add( new wxStaticText(panel, -1,_T(" ")) ,1, wxALL|wxEXPAND , 0);
// sizerH4->Add( _ckBoxXYZ ,1, wxALL|wxEXPAND , 0);
// sizerH4->Add( new wxStaticText(panel, -1,_T(" ")) ,1, wxALL|wxEXPAND , 0);
// sizerH4->Add( new wxStaticText(panel, -1,_T(" ")) ,1, wxALL|wxEXPAND , 0);
-
// sizerH4a->Add( new wxStaticText(panel, -1,_T("Axis 2D:")),1, wxALL|wxEXPAND , 0);
sizerH4a->Add( _ckBoxXYZ ,1, wxALL|wxEXPAND , 0);
sizerH4a->Add( _ckBoxFixAxis2D ,1, wxALL|wxEXPAND , 0);
sizerH4a->Add( _opacityAxis ,1, wxALL|wxEXPAND , 0);
-
sizerH4->Add( sizerH4a ,1, wxALL|wxEXPAND , 0);
sizerH4->Add( new wxStaticText(panel, -1,_T(" ")) ,1, wxALL|wxEXPAND , 0);
sizerH4->Add( new wxStaticText(panel, -1,_T(" ")) ,1, wxALL|wxEXPAND , 0);
-
-
-
sizerH5 = new wxFlexGridSizer(1);
sizerH5->Add( new wxStaticText(panel, -1,_T(" ")) , 1, wxALL|wxEXPAND , 0);
sizerH5->Add( _ckBoxPlane , 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( _cbStereo , 1, wxALL|wxEXPAND , 0);
-
sizerH6 = new wxFlexGridSizer(1);
sizerH6->Add( _ckBoxOutlineBox , 1, wxALL|wxEXPAND , 0);
sizerH6->Add( _ckBoxOutlinePlane , 1, wxALL|wxEXPAND , 0);
-
-
-
sizerH7 = new wxFlexGridSizer(1);
panelH7->SetSizer(sizerH7);
sizerH7->Add( _rdBackGroundGradient , 1, wxALL|wxEXPAND , 0);
sizerH7->Add( _rdBackGroundBlack , 1, wxALL|wxEXPAND , 0);
sizerH7->Add( _rdBackGroundWhite , 1, wxALL|wxEXPAND , 0);
-
-
sizerH6->Add( new wxStaticText(panel, -1,_T(" ")) , 1, wxALL|wxEXPAND , 0);
sizerH6->Add( panelH7 , 1, wxALL|wxEXPAND , 0);
-
sizer->Add( sizerH4, 1, wxALL|wxGROW, 2);
sizer->Add( sizerH5, 1, wxALL|wxEXPAND,2);
sizer->Add( sizerH6, 1, wxALL|wxEXPAND,2);
-
} else {
sizer = new wxFlexGridSizer(1);
-
sizerH4 = new wxFlexGridSizer(10);
sizerH5 = new wxFlexGridSizer(10);
sizerH6 = 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( _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);
////EED 05Nov2012 sizerH5->Add( _ckBox_BW_Color_Plane , 1, wxALL|wxEXPAND, 0);
sizerH5->Add( new wxStaticText(panel, -1,_T(" ")) , 1, wxALL|wxEXPAND, 0);
-
sizerH6 = new wxFlexGridSizer(10);
sizerH6->Add( _ckFreePlaneX , 1, wxALL|wxEXPAND, 0);
sizerH6->Add( new wxStaticText(panel, -1,_T(" ")) , 1, wxALL|wxEXPAND, 0);
sizerH6->Add( btnFreePlanesOrtho , 0 , wxALIGN_CENTER_VERTICAL|wxSHAPED, 0 );
sizerH6->Add( new wxStaticText(panel, -1,_T(" ")) , 1, wxALL|wxEXPAND, 0);
sizerH6->Add( _cbStereo, 1, wxALL|wxEXPAND, 0);
-
sizer->Add( sizerH4, 1, wxALL|wxGROW, 2);
sizer->Add( sizerH5, 1, wxALL|wxEXPAND,2);
sizer->Add( sizerH6, 1, wxALL|wxEXPAND,2);
}
-
-
-
-
//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);
-
// sizerH5->Add( ckBoxY , 1, wxALL|wxEXPAND, 0);
// sizerH5->Add( new wxStaticText(panel, -1," ") , 1, wxALL|wxEXPAND, 0);
// sizerH5->Add( _positionY , 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);
-
// sizerH7->Add( _ckBoxXYZ , 1, wxALL|wxEXPAND, 0);
// sizerH7->Add( _ckBoxPlane , 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);
-
-
// sizerH5->Add( ckBoxX , 1, wxALL|wxEXPAND, 0);
// sizerH5->Add( ckBoxY , 1, wxALL|wxEXPAND, 0);
// sizerH5->Add( ckBoxZ , 1, wxALL|wxEXPAND, 0);
-
-
panelH7->SetAutoLayout(true);
panelH7->Layout();
-
-
panel->ClearBackground();
// panel->SetSize(400,50);
// sizer->FitInside(panel);
panel->SetSizer(sizer);
panel->SetAutoLayout(true);
panel->Layout();
-
panel->SetEventHandler((wxEvtHandler*)this);
-
//this->UpdateControlPanel();
Layout();
}
{
vtkMPRBaseData* basedata = _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData();
if(basedata != NULL){
-
vtkImageData* img = basedata->GetImageData();
int x0,x1,y0,y1,z0,z1;
-
if(img)
{
img->GetExtent(x0,x1,y0,y1,z0,z1);
_positionX->SetRange(x0,x1);
_positionY->SetRange(y0,y1);
_positionZ->SetRange(z0,z1);
-
if (firsttime==true)
{
_positionX->SetValue((x0+x1)/2);
// _positionZ->Update();
// this->Update();
}//img
-
- }//basedata
-
+ }//basedata
}
//-------------------------------------------------------------------
//-------------------------------------------------------------------
void wxVtkMPR3DViewCntrlPanel::OnEditColorTable(wxCommandEvent& event)
{
-
vtkImageData *imagedata = this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
if ( imagedata->GetScalarType()!=VTK_UNSIGNED_SHORT )
windowMessage1.ShowModal();
return;
}
-
vtkColorTransferFunction *ctfun = this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetvtkColorTransferFunction();
std::vector<double> *ctfunVectorPoint = this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetctFunVectorPoint();
std::vector<double> *ctfunVectorRed = this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetctFunVectorRed();
std::vector<double> *ctfunVectorGreen = this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetctFunVectorGreen();
std::vector<double> *ctfunVectorBlue = this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetctFunVectorBlue();
-
//void *p=this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer(); // JPRx
-
-
int i=0,xi,r,g,b;
-
HistogramDialog* hDlg=new HistogramDialog(NULL,_T("Color table"),imagedata,2);
-
-
hDlg->erasePointsTransferenceFunction();
int ctfSize=ctfunVectorRed->size();
if(ctfSize>0)
double gr = (*ctfunVectorPoint)[i];
double r = (*ctfunVectorRed)[i];
double g = (*ctfunVectorGreen)[i];
- double b = (*ctfunVectorBlue)[i];
-
+ double b = (*ctfunVectorBlue)[i];
hDlg->addColorPoint(gr,(int)(r*255),(int)(g*255),(int)(b*255));
-
i++;
}
}
-
//
// when the user had changed the transference Function
//
-
//setting variables if the user wants to do refresh
-
hDlg->setCTF(ctfun);
//hDlg->setMPR3Dview(_wxvtkmpr3Dview);
-
if(hDlg->ShowModal()== wxID_OK )
{
// -- vtkColorTransferFunction --
double blue = (*ctfunVectorBlue)[i];
ctfun->AddRGBPoint(grey2,red,green,blue);
}
- }
-
+ }
}
-
hDlg->Destroy();
}
-
//-------------------------------------------------------------------
void wxVtkMPR3DViewCntrlPanel::OnVisibleFreePlaneX(wxCommandEvent& event)
{
_wxvtkmpr3Dview->FreePlaneInteraction( _ckFreePlaneInteraction->GetValue() );
}
-
//-------------------------------------------------------------------
void wxVtkMPR3DViewCntrlPanel::OnVisibleFreePlaneZ(wxCommandEvent& event)
{
_wxvtkmpr3Dview->FreePlaneInteraction( _ckFreePlaneInteraction->GetValue() );
}
-
//-------------------------------------------------------------------
void wxVtkMPR3DViewCntrlPanel::OnVisibleFreePlaneInteraction(wxCommandEvent& event)
{
this->_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->SetStereo( _cbStereo->GetSelection() );
}
-
-
//-------------------------------------------------------------------
void wxVtkMPR3DViewCntrlPanel::OnVisibleAxisX(wxCommandEvent& event)
{
std::cout<<e<<std::endl;
}
}
+
//-------------------------------------------------------------------
void wxVtkMPR3DViewCntrlPanel::OnVisibleAxisY(wxCommandEvent& event)
{
_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
#endif
}
+
//-------------------------------------------------------------------
void wxVtkMPR3DViewCntrlPanel::OnVisibleAxisZ(wxCommandEvent& event)
{
//-------------------------------------------------------------------
void wxVtkMPR3DViewCntrlPanel::OnVisibleAxisXYZ(wxCommandEvent& event)
{
-
_wxvtkmpr3Dview->VisiblePointWidget(event.IsChecked());
}
//-------------------------------------------------------------------
void wxVtkMPR3DViewCntrlPanel::OnPositionX(wxScrollEvent& event)
{
- _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetX( _positionX->GetValue() , true );
- _wxvtkmpr3Dview->RefreshView();
-
+ _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetX( _positionX->GetValue() , true );
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
#if wxMAJOR_VERSION <= 2
#else
_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
#endif
+ _wxvtkmpr3Dview->RefreshView();
}
//-------------------------------------------------------------------
void wxVtkMPR3DViewCntrlPanel::OnPositionY(wxScrollEvent& event)
{
_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetY( _positionY->GetValue() , true);
- _wxvtkmpr3Dview->RefreshView();
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
#if wxMAJOR_VERSION <= 2
#else
_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
#endif
+ _wxvtkmpr3Dview->RefreshView();
}
//-------------------------------------------------------------------
void wxVtkMPR3DViewCntrlPanel::OnPositionZ(wxScrollEvent& event)
{
_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetZ( _positionZ->GetValue() , true );
- _wxvtkmpr3Dview->RefreshView();
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
#if wxMAJOR_VERSION <= 2
#else
_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
#endif
+ _wxvtkmpr3Dview->RefreshView();
}
//-------------------------------------------------------------------