*/
interfMainPanel* interfMainPanel::interfmainpanel=NULL;
+wxFrame* interfMainPanel::_newframe=NULL;
interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtHandler * evtHandler, std::string datadir)
: wxPanel(parent, -1, wxDefaultPosition, wxSize(sizex, sizey), wxBORDER_SUNKEN)
splitterwindow->SetMinimumPaneSize( 10 );
sizey = sizey/8;
-
-
wxPanel* toolpanel = new wxPanel(splitterwindow, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
wxFlexGridSizer* flexsizer = new wxFlexGridSizer(6,2,1,1);
interfMainPanel* interfMainPanel::getInstance(wxWindow* parent, std::string datadir, wxEvtHandler * evtHandler){
- wxFrame* newframe = new wxFrame(parent, -1, wxT(" Contour Tools "), wxPoint(25,50), wxSize(350,850),wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT);
+ _newframe = new wxFrame(parent, -1, wxT(" Contour Tools "), wxPoint(25,50), wxSize(350,850),wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT);
if(interfmainpanel == NULL){
- interfmainpanel = new interfMainPanel(newframe, 350, 850, evtHandler, datadir);
+ interfmainpanel = new interfMainPanel(_newframe, 350, 850, evtHandler, datadir);
}
- newframe->Show(TRUE);
+ _newframe->Show(TRUE);
return interfmainpanel;
}
interfMainPanel* interfMainPanel::getInstance(wxWindow* parent, wxEvtHandler * evtHandler){
- wxFrame* newframe = new wxFrame(parent, -1, wxT(" Contour Tools "), wxPoint(25,50), wxSize(350,850),wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT );
+ _newframe = new wxFrame(parent, -1, wxT(" Contour Tools "), wxPoint(25,50), wxSize(350,850),wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT );
if(interfmainpanel == NULL){
- interfmainpanel = new interfMainPanel(newframe, 350, 850, evtHandler);
+ interfmainpanel = new interfMainPanel(_newframe, 350, 850, evtHandler);
}
- newframe->Show(TRUE);
+ _newframe->Show(TRUE);
return interfmainpanel;
}
-
+bool interfMainPanel::Show(bool show){
+ return _newframe->Show(show);
+}
interfMainPanel* interfMainPanel::getInstance()
{
void interfMainPanel :: resetInstance()
{
- delete interfmainpanel;
+ //delete interfmainpanel;
+ delete _newframe;
interfmainpanel = NULL;
}
}
/**
-** Hide the panel in the
+** Hide the panel in the lower box
**/
void interfMainPanel::hidePanel( ){
wxContourMainFrame::getInstance()->showAxis(false);
return wxContourMainFrame::getInstance()->GetImageDataSizeZ();
}
-void interfMainPanel::GetImageDataRange(double *range){
- wxContourMainFrame::getInstance()->GetImageDataRange(range);
-}
-
void interfMainPanel::onSegmentationAllSlice(int minZ,int maxZ,int isovalue,int sampling,int method){
wxContourMainFrame::getInstance()->onSegmentationAllSlice(minZ, maxZ,isovalue,sampling,method);
}
-void interfMainPanel::onMirror()
-{
- wxContourMainFrame::getInstance()->onMirror();
-}
-
-void interfMainPanel::onMirrorChangeWidth(int width)
-{
- wxContourMainFrame::getInstance()->refLineChangeWidth(width);
-}
-
void interfMainPanel::setLabelSegmentationPanelVTK(wxString tmpString){
((interfSegmentationPanelVTK*)segmentationPanel)->setLabel(tmpString);
}
wxContourMainFrame::getInstance()->onBrigthnessColorWindowLevel(colorwindow, windowlevel);
}
-void interfMainPanel::onInterpolation(bool interpolate){
+void interfMainPanel::onInterpolation(bool interpolate)
+{
wxContourMainFrame::getInstance()->onInterpolation(interpolate);
}
void interfMainPanel::onInformationPressed(){
if(infoWin ==NULL){
- infoWin = new wxFrame (this, -1,_T(" Spread "), wxDefaultPosition, wxDefaultSize, wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT | wxRESIZE_BORDER );
- infoWin->SetSize( wxSize(500,450) );
+ infoWin = new wxFrame (this, -1,_T(" Statistics "), wxDefaultPosition, wxDefaultSize, wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT | wxRESIZE_BORDER );
+ infoWin->SetSize( wxSize(825,650) );
- wxSize sizepanel(200,300);
+ wxSize sizepanel(825,675);
informationPanel = new interfInformationPanel(infoWin);//contourevent->getInformationPanel(infoWin);
wxBoxSizer * sizerPanel = new wxBoxSizer(wxHORIZONTAL);
}
-void interfMainPanel::onSaveResults(std::string directory,std::string namefile, std::string filename, int typeContourGroup){
- wxContourMainFrame::getInstance()->onSaveResults(directory, namefile,filename, typeContourGroup);
+void interfMainPanel::onSaveResults(std::string directory,std::string namefile, std::string filename,
+ int typeContourGroup, bool XYZValues, bool contourImage, bool statistics)
+{
+ wxContourMainFrame::getInstance()->onSaveResults(directory, namefile, filename,
+ typeContourGroup, XYZValues, contourImage, statistics);
}
wxString interfMainPanel::getCellValue(int j,int i){
return ((interfInformationPanel*)informationPanel)->getCellValue(j, i );
}
-void interfMainPanel::onSnakePressed(){
+void interfMainPanel::onSnakePressed()
+{
+ axisshown=false;
+ wxContourMainFrame::getInstance()->showAxis(axisshown);
wxContourMainFrame::getInstance()->onSnakePressed();
}
mirrorPanel->Layout();
refLineShown=true;
-
- showPanel(mirrorPanel);
wxContourMainFrame::getInstance()->referenceLine();
}
else
{
- if(refLineShown)
- {
- wxContourMainFrame::getInstance()->refLineHide();
- refLineShown=false;
- hidePanel();
- }
-
- else if (!refLineShown)
+ if (!refLineShown)
{
wxContourMainFrame::getInstance()->refLineShow();
refLineShown=true;
-
- showPanel(mirrorPanel);
}
}
+ showPanel(mirrorPanel);
}
-
-void interfMainPanel::onThreshold(int minVal, int maxVal)
+void interfMainPanel::onMirror()
+{
+ wxContourMainFrame::getInstance()->onMirror();
+}
+
+void interfMainPanel::onMirrorAxisShow()
+{
+ if (!refLineShown)
+ {
+ wxContourMainFrame::getInstance()->refLineShow();
+ refLineShown=true;
+ }
+}
+
+void interfMainPanel::onMirrorAxisHide()
+{
+ if (refLineShown)
+ {
+ wxContourMainFrame::getInstance()->refLineHide();
+ refLineShown=false;
+ }
+}
+
+void interfMainPanel::onMirrorChangeWidth(int width)
+{
+ wxContourMainFrame::getInstance()->refLineChangeWidth(width);
+}
+
+
+void interfMainPanel::onThreshold()
+{
+ wxContourMainFrame::getInstance()->onThreshold();
+}
+
+void interfMainPanel::onThresholdChange()
+{
+ wxContourMainFrame::getInstance()->onThresholdChange();
+}
+
+void interfMainPanel::onThresholdInstantChange(double range[])
+{
+ panelThreshold->onThresholdInstantChange(range);
+}
+
+void interfMainPanel::onThresholdInterpolation(bool interpolate)
{
- wxContourMainFrame::getInstance()->onThreshold(minVal, maxVal);
+ wxContourMainFrame::getInstance()->onThresholdInterpolation(interpolate);
+}
+
+void interfMainPanel::onThresholdChangeOpacity (int opacity)
+{
+ wxContourMainFrame::getInstance()->onThresholdChangeOpacity(opacity);
+}
+
+void interfMainPanel::onThresholdRemove()
+{
+ wxContourMainFrame::getInstance()->onThresholdRemove();
}
void interfMainPanel::onThresholdPressed()
flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
flexsizer->Add(panelThreshold, wxEXPAND);
thresholdPanel->Layout();
- showPanel(thresholdPanel);
+
}
+ showPanel(thresholdPanel);
+}
+void interfMainPanel::ShowResultImages(int typeContourGroup)
+{
+ wxContourMainFrame::getInstance()->ShowResultImages(typeContourGroup);
+}
- else
- {
- if(thresholdShown)
- {
- thresholdShown=false;
- panelThreshold->onThresholdStop();
-
- hidePanel();
- }
- else if (!thresholdShown)
- {
- thresholdShown=true;
- showPanel(thresholdPanel);
- }
- }
-}