spreadPanel = NULL;
infoWin=NULL;
informationPanel=NULL;
+ mirrorPanel=NULL;
splitterwindow = new wxSplitterWindow(this,-1, wxDefaultPosition, wxSize(sizex, sizey), wxSP_3DSASH, wxString(_T("")));
wxContourMainFrame::getInstance()->showAxis(false);
wxContourMainFrame::getInstance()->onCreateContourCircle();
}
+void interfMainPanel::onCreateContourLine( ){
+ wxContourMainFrame::getInstance()->showAxis(false);
+ wxContourMainFrame::getInstance()->onCreateContourLine();
+}
void interfMainPanel::onCreateContoursBullEye(wxPanel* panBull){
wxContourMainFrame::getInstance()->showAxis(false);
wxContourMainFrame::getInstance()->onCreateContourBullEye(panBull);
return wxContourMainFrame::getInstance()->getImageData();
}
-void interfMainPanel::onSegmentationOneSlice(int isovalue,int sampling,int method){
+void interfMainPanel::onSegmentationOneSlice(int isovalue,int sampling,int method)
+{
wxContourMainFrame::getInstance()->onSegmentationOneSlice(isovalue, sampling, method);
}
wxContourMainFrame::getInstance()->onSegmentationAllSlice(minZ, maxZ,isovalue,sampling,method);
}
+void interfMainPanel::onMirror()
+{
+ wxContourMainFrame::getInstance()->onMirror();
+}
+
void interfMainPanel::setLabelSegmentationPanelVTK(wxString tmpString){
((interfSegmentationPanelVTK*)segmentationPanel)->setLabel(tmpString);
}
void interfMainPanel::onSnakePressed(){
wxContourMainFrame::getInstance()->onSnakePressed();
}
+
+void interfMainPanel::onMirrorPressed(){
+ if(mirrorPanel==NULL){
+
+ mirrorPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
+ wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
+ mirrorPanel->SetSizer(flexsizer, true);
+ mirrorPanel->SetAutoLayout( true );
+ panelMirror = new interfMirrorPanel(mirrorPanel);
+
+ wxStaticText* stattext = new wxStaticText(mirrorPanel, -1, wxString(_T(" Mirroring Tool ")), wxDefaultPosition,
+ wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
+
+ flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
+ flexsizer->Add(panelMirror, wxEXPAND);
+ mirrorPanel->Layout();
+ }
+ showPanel(mirrorPanel);
+ //hideAxis();
+}
void onCreateContourSpline( );
void onCreateContourRectangle( );
void onCreateContourCircle( );
+ void onCreateContourLine( );
void onCreateContoursBullEye(wxPanel* panBull);
/////////////////////////////////
void onDeleteContour();
void onSegmentationAllSlice(int minZ,int maxZ,int isovalue,int sampling,int method);
+ void onMirror();
+
void setLabelSegmentationPanelVTK(wxString tmpString);
void onSegmentationPressed();
wxString getCellValue(int j,int i);
void onSnakePressed();
+
+ void onMirrorPressed();
+
private:
wxPanel* configPanel;
wxPanel* spreadPanel;
interfSpreadPanel* panelSpread;
+ wxPanel* mirrorPanel;
+ interfMirrorPanel* panelMirror;
wxWindow* infoWin;
wxPanel* informationPanel;
funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourBullseye);
hand.push_back(this);
+ path.push_back(datadir + "/Line.png");
+ nom.push_back("Create a Line");
+ funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourLine);
+ hand.push_back(this);
+
this->addButtons(path, nom);
this->setVectorFunction(funct);
void interfNewContourMenu::onCreateContourCircle( wxCommandEvent& event ){
interfMainPanel::getInstance()->onCreateContourCircle();
}
+void interfNewContourMenu::onCreateContourLine( wxCommandEvent& event ){
+ interfMainPanel::getInstance()->onCreateContourLine();
+}
** This method is in charge of capturing the event when the button is clicked
**/
void onCreateContourCircle( wxCommandEvent& event );
+ /**
+ ** This method is in charge of capturing the event when the button is clicked
+ **/
+ void onCreateContourLine( wxCommandEvent& event );
};
#endif
nom.push_back("Show help page with information about the tools");
funct.push_back((wxObjectEventFunction) &interfToolsMenu:: onHelpPressed);
+ path.push_back(datadir + "/Mirror.png");
+ nom.push_back("Create an Axis and select a contour to mirror it accordingly");
+ funct.push_back((wxObjectEventFunction) &interfToolsMenu:: onMirrorPressed);
+
this->addButtons(path, nom);
this->setVectorFunction(funct);
}
void interfToolsMenu::onHelpPressed(wxCommandEvent& event){
+
wxLaunchDefaultBrowser(_T("http://www.creatis.insa-lyon.fr/creatools/node/25"), 0);
+
+}
+
+void interfToolsMenu::onMirrorPressed(wxCommandEvent& event){
+
+ interfMainPanel::getInstance()->onMirrorPressed();
+
}
void onHelpPressed(wxCommandEvent& event);
+ void onMirrorPressed(wxCommandEvent& event);
+
private:
//wxContourEventHandler* contourevent;
wxString interfInformationPanel::getCellValue(int j,int i){
return _grid->GetCellValue( j , i );
-}
\ No newline at end of file
+}
+
+
+
+/**
+** Begin of the mirror panel
+**/
+
+interfMirrorPanel::interfMirrorPanel(wxWindow* parent)
+: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
+{
+ wxButton *mirrorGoBtn = new wxButton(this,-1,_T("Go"), wxDefaultPosition, wxSize(200,35) );
+ _thickness = new wxSlider(this, -1, 0 , 0, 10, wxDefaultPosition, wxSize(200,35), wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
+
+ Connect( mirrorGoBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfMirrorPanel::onMirrorGo );
+
+ wxFlexGridSizer * sizer = new wxFlexGridSizer(1);
+ sizer -> Add( new wxStaticText(this,-1,_T("Thickness")) , 1, wxGROW );
+ sizer -> Add( _thickness, 1, wxGROW );
+ sizer -> Add( mirrorGoBtn, 1, wxGROW );
+
+ this->SetSizer( sizer );
+ this->SetAutoLayout( true );
+ this->Layout();
+}
+
+interfMirrorPanel::~interfMirrorPanel(){
+}
+
+void interfMirrorPanel::onMirrorGo(wxCommandEvent& event)
+{
+ //wxString thick=_thickness->GetValue();
+ interfMainPanel::getInstance()->onMirror();
+}
+};
+
+class interfMirrorPanel
+ : public wxPanel
+{
+public:
+ interfMirrorPanel(wxWindow * parent);
+ ~interfMirrorPanel();
+
+private:
+
+ wxSlider* _thickness;
+
+ void onMirrorGo(wxCommandEvent& event);
};
#endif
//JCP 20-10-08 Undo redo implementation
createContour( 3 );
}
+
+void wxContourMainFrame::onCreateContourLine( ){
+ //JCP 20-10-08 Undo redo implementation
+ saveState();
+ //JCP 20-10-08 Undo redo implementation
+ createContour( 6 );
+}
+
//------------------------------------------------------------------------------------------------------------
void wxContourMainFrame :: onCreateContourBullEye(wxPanel* panel )
_performingOperation->setStartOperationInstantVector( tempVector );
_performingOperation->setKeyNamesOperationElems( currentSelection );
}
+
void wxContourMainFrame::onPaste(){
RefreshInterface();
}
+
void wxContourMainFrame::SegmentationOneSlice( int x, int y, int z, int isovalue, int sampling, int method )
{
int typeofcontour = 1;
RefreshInterface();
}
+void wxContourMainFrame::onMirror()
+{
+ //AD:02-09
+ std::vector<std::string> currentSelection = _theViewPanel->getSelectedObjects();
+
+ std::vector<int> tempVector;
+ _instantPanel->getInstant( tempVector );
+ _performingOperation->reset();
+ _performingOperation->setStartCommand( COPY );
+ _performingOperation->setStartOperationInstantVector( tempVector );
+ _performingOperation->setKeyNamesOperationElems( currentSelection );
+
+ //AD:02-09
+ char theStartCommand = _performingOperation->getStartCommand();
+ if ( theStartCommand == COPY )
+ {
+ //JCP 20-10-08 Undo redo implementation
+ saveState();
+ //JCP 20-10-08 Undo redo implementation
+ std::vector<int> tempVector;
+ _instantPanel->getInstant( tempVector );
+ _performingOperation->setEndOperationInstantVector ( tempVector );
+ std::vector<std::string> elems = _performingOperation->getKeyNamesOperationElems();
+ int i,size = elems.size();
+ for( i=0; i<size; i++ )
+ {
+ createCopyContourOf( elems[i], tempVector, i>0 );
+ }
+ }
+}
+
void wxContourMainFrame::showAxis(bool show){
_theViewPanel->SetVisibleAxis(show);
_theViewPanel->Refresh();
void onCreateContourSpline( );
void onCreateContourRectangle( );
void onCreateContourCircle( );
+ void onCreateContourLine( );
void onCreateContourBullEye(wxPanel* pan);
/////////////////////////////////
void onDeleteContour();
void SegmentationOneSlice( int x, int y, int z, int isovalue, int sampling, int method );
+ void Mirror( int x, int y, int z, int isovalue, int sampling, int method );
+
int GetImageDataSizeZ();
void GetImageDataRange(double *range);
void onSegmentationAllSlice(int minZ,int maxZ,int isovalue,int sampling,int method);
+ void onMirror();
+
void showAxis(bool show);
void onRigidPressed();
manViewerContour = new manualViewBullEye();
}
+ if (typeContour==6)
+ {
+ manContourControl = new manualLineControler();
+ manViewerContour = new manualViewLine();
+ }
+
//EED Borrame
//FILE *ff = fopen("c:/temp/wxVtkBaseView_SceneManagerStadistics.txt","a+");
manModelContour = new manualContourModelCircle();
}
+ // line
+ if (typeContour==6)
+ {
+ manModelContour = new manualContourModelLine();
+ }
+
return manModelContour;
}