segmentPanelITK = NULL;
configPanel = NULL;
spreadPanel = NULL;
- infoWin=NULL;
- informationPanel=NULL;
- mirrorPanel=NULL;
+ infoWin = NULL;
+ informationPanel = NULL;
+ mirrorPanel = NULL;
+ thresholdPanel = NULL;
+ currentWindow = NULL;
splitterwindow = new wxSplitterWindow(this,-1, wxDefaultPosition, wxSize(sizex, sizey), wxSP_3DSASH, wxString(_T("")));
+
splitterwindow->SetMinimumPaneSize( 10 );
-
sizey = sizey/8;
- currentWindow = NULL;
+
+
wxPanel* toolpanel = new wxPanel(splitterwindow, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
infoPanel->SetAutoLayout( true );
splitterwindow->Initialize(toolpanel);
+ splitterwindow->SetSashGravity(1);
splitterwindow->SplitHorizontally(toolpanel, infoPanel);
Connect(b->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
Connect(b5->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
this->Layout();
- /*sizey = sizey/8;
- currentWindow = NULL;
-
- PANEL = "New Contour";
- PANEL1 = "I/O";
- PANEL2 = "Edit";
- PANEL3 = "Delete";
- PANEL4 = "Tools";
-
-
- wxPanel* toolpanel = new wxPanel(this, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(""));
-
- wxFlexGridSizer* flexsizer = new wxFlexGridSizer(6,2,2,2);
- toolpanel->SetSizer(flexsizer, true);
- toolpanel->SetAutoLayout( true );
-
- wxButton* b = getButton(toolpanel);
- b->SetClientData(&PANEL);
- wxButton* b1 = getButton(toolpanel);
- b1->SetClientData(&PANEL1);
- wxButton* b2 = getButton(toolpanel);
- b2->SetClientData(&PANEL2);
- wxButton* b3 = getButton(toolpanel);
- b3->SetClientData(&PANEL3);
- wxButton* b4 = getButton(toolpanel);
- b4->SetClientData(&PANEL4);
-
-
- wxPanel* mentex = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(""));
- wxPanel* mentex1 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(""));
- wxPanel* mentex2 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(""));
- wxPanel* mentex3 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(""));
- wxPanel* mentex4 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(""));
-
- menubar = new interfNewContourMenu(mentex, sizex, sizey, evtHandler);
- menubar1 = new interfIOMenu(mentex1, sizex, sizey, evtHandler);
- menubar2 = new interfEditMenu(mentex2, sizex, sizey, evtHandler);
- menubar3 = new interfDeleteMenu(mentex3, sizex, sizey, evtHandler);
- menubar4 = new interfToolsMenu(mentex4, sizex,sizey, evtHandler);
-
-// this->initializeToolsPanel(mentex4, sizex, sizey, evtHandler);
-
- statictext = getText(mentex, PANEL);
- statictext1 = getText(mentex1, PANEL1);
- statictext2 = getText(mentex2, PANEL2);
- statictext3 = getText(mentex3, PANEL3);
- statictext4 = getText(mentex4, PANEL4);
-
-
-
- flexsizer->Add(b, wxFIXED_MINSIZE);
- flexsizer->Add(setMenuTextSizer(mentex, menubar,statictext), wxFIXED_MINSIZE);
-
- flexsizer->Add(b1, wxFIXED_MINSIZE);
- flexsizer->Add(setMenuTextSizer(mentex1, menubar1,statictext1), wxFIXED_MINSIZE);
-
- flexsizer->Add(b2, wxFIXED_MINSIZE);
- flexsizer->Add(setMenuTextSizer(mentex2, menubar2,statictext2), wxFIXED_MINSIZE);
-
- flexsizer->Add(b3, wxFIXED_MINSIZE);
- flexsizer->Add(setMenuTextSizer(mentex3, menubar3,statictext3), wxFIXED_MINSIZE);
-
- flexsizer->Add(b4, wxFIXED_MINSIZE);
- flexsizer->Add(setMenuTextSizer(mentex4, menubar4,statictext4), wxFIXED_MINSIZE);
-
- toolpanel->Layout();
-
- infoPanel = new wxPanel(this, -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(""));
- wxFlexGridSizer* infosizer = new wxFlexGridSizer(5,2,2,2);
- infoPanel->SetSizer(infosizer, true);
- infoPanel->SetAutoLayout( true );
-
-
-
- wxFlexGridSizer* mainsizer = new wxFlexGridSizer(1);
- this->SetSizer(mainsizer, true);
- this->SetAutoLayout( true );
-
-
- mainsizer->Add(toolpanel,wxEXPAND);
- mainsizer->Add(new wxSplitterWindow(this,-1, wxDefaultPosition, wxDefaultSize, wxSP_3DBORDER, wxString("")), wxEXPAND);
- mainsizer->Add(infoPanel, wxEXPAND);
-
-
- Connect(b->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
- Connect(b1->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
- Connect(b2->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
- Connect(b3->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
- Connect(b4->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
-
- this->Layout();*/
-
}
interfMainPanel::~interfMainPanel(void)
interfMainPanel* interfMainPanel::getInstance(wxWindow* parent, std::string datadir, wxEvtHandler * evtHandler){
- wxFrame* newframe = new wxFrame(parent, -1, wxT("New Interface"), wxPoint(1,1), wxSize(380,750),wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT);
+ 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);
if(interfmainpanel == NULL){
- interfmainpanel = new interfMainPanel(newframe, 380, 750, evtHandler, datadir);
+ interfmainpanel = new interfMainPanel(newframe, 350, 850, evtHandler, datadir);
}
newframe->Show(TRUE);
interfMainPanel* interfMainPanel::getInstance(wxWindow* parent, wxEvtHandler * evtHandler){
- wxFrame* newframe = new wxFrame(parent, -1, wxT("New Interface"), wxPoint(1,1), wxSize(380,750),wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT );
+ 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 );
if(interfmainpanel == NULL){
- interfmainpanel = new interfMainPanel(newframe, 380, 750, evtHandler);
+ interfmainpanel = new interfMainPanel(newframe, 350, 850, evtHandler);
}
newframe->Show(TRUE);
return interfmainpanel;
}
-interfMainPanel* interfMainPanel::getInstance(){
+interfMainPanel* interfMainPanel::getInstance()
+{
return interfmainpanel;
}
+void interfMainPanel :: resetInstance()
+{
+ delete interfmainpanel;
+ interfmainpanel = NULL;
+}
wxPanel* interfMainPanel::initializeToolsPanel(wxWindow* parent, int sizex, int sizey, wxEvtHandler * evtHandler){
/**
** Shows the panel in the
**/
-void interfMainPanel::showPanel(wxWindow* panel){
+void interfMainPanel::showPanel(wxWindow* panel)
+{
wxContourMainFrame::getInstance()->showAxis(false);
wxSizer* sizer = infoPanel->GetSizer();
return wxContourMainFrame::getInstance()->getImageData();
}
+void interfMainPanel::getImageRange(double range[2] )
+{
+ vtkImageData * img = getImageData();
+ img->GetScalarRange(range);
+}
+
void interfMainPanel::onSegmentationOneSlice(int isovalue,int sampling,int method)
{
wxContourMainFrame::getInstance()->onSegmentationOneSlice(isovalue, sampling, method);
wxContourMainFrame::getInstance()->onMirror();
}
+void interfMainPanel::onMirrorChangeWidth(int width)
+{
+ wxContourMainFrame::getInstance()->refLineChangeWidth(width);
+}
+
void interfMainPanel::setLabelSegmentationPanelVTK(wxString tmpString){
((interfSegmentationPanelVTK*)segmentationPanel)->setLabel(tmpString);
}
}
void interfMainPanel::onMirrorPressed(){
- if(mirrorPanel==NULL){
+ if(mirrorPanel==NULL)
+ {
mirrorPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
}
}
+
+
+void interfMainPanel::onThreshold(int minVal, int maxVal)
+{
+ wxContourMainFrame::getInstance()->onThreshold(minVal, maxVal);
+}
+
+void interfMainPanel::onThresholdPressed()
+{
+ if(thresholdPanel==NULL)
+ {
+
+ thresholdPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
+ wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
+ thresholdPanel->SetSizer(flexsizer, true);
+ thresholdPanel->SetAutoLayout( true );
+ panelThreshold = new interfThresholdPanel(thresholdPanel);
+
+ wxStaticText* stattext = new wxStaticText(thresholdPanel, -1, wxString(_T(" Threshold Tool ")), wxDefaultPosition,
+ wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
+
+ flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
+ flexsizer->Add(panelThreshold, wxEXPAND);
+ thresholdPanel->Layout();
+ showPanel(thresholdPanel);
+ }
+
+
+ else
+ {
+ if(thresholdShown)
+ {
+ wxContourMainFrame::getInstance()->refLineHide();
+ thresholdShown=false;
+ panelThreshold->onThresholdStop();
+
+ hidePanel();
+ }
+
+ else if (!thresholdShown)
+ {
+ wxContourMainFrame::getInstance()->refLineShow();
+ thresholdShown=true;
+
+ showPanel(thresholdPanel);
+ }
+ }
+}