this->connectEvents(evtHandler);
}
-void interfIOMenu::onLoad(wxCommandEvent& event){
+void interfIOMenu::onLoad(wxCommandEvent& event)
+{
interfMainPanel::getInstance()->onLoad();
}
-void interfIOMenu::onSave(wxCommandEvent& event){
+void interfIOMenu::onSave(wxCommandEvent& event)
+{
interfMainPanel::getInstance()->onSave();
}
-void interfIOMenu::onImport(wxCommandEvent& event){
+void interfIOMenu::onImport(wxCommandEvent& event)
+{
interfMainPanel::getInstance()->onImport();
}
-void interfIOMenu::onTest(wxCommandEvent& event){
+void interfIOMenu::onTest(wxCommandEvent& event)
+{
+ printf("EED interfIOMenu::onTest\n");
interfMainPanel::getInstance()->onTest();
}
colorImageLayerPanel = NULL;
currentWindow = NULL;
testPanel = NULL;
+ flipPanel = NULL;
//CMRU 17-08-09 ------------------------------------------------------------------
infoPanelCalibration = NULL;
wxContourMainFrame::getInstance()->onSave();
}
-void interfMainPanel::onImport(){
+void interfMainPanel::onImport()
+{
wxContourMainFrame::getInstance()->onImport();
}
-void interfMainPanel::onTest(){
+void interfMainPanel::onTest()
+{
+ printf("EED interfMainPanel::onTest \n");
if(testPanel==NULL)
{
testPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition,
testPanel->SetSizer(flexsizer, true);
testPanel->SetAutoLayout( true );
panelTest = new interfTestPanel(testPanel);
-
- wxStaticText* stattext = new wxStaticText(mirrorPanel, -1,
+ wxStaticText* stattext = new wxStaticText(testPanel, -1,
wxString(_T(" Test Panel ")),
wxDefaultPosition, wxDefaultSize,
wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
-
flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
flexsizer->Add(panelTest, wxEXPAND);
testPanel->Layout();
- showPanel(testPanel);
}
+ showPanel(testPanel);
}
void interfMainPanel::RefreshInterface()
wxContourMainFrame::getInstance()->SetContourGroup( contourGroup);
}
+
+void interfMainPanel::onFlipContours()
+{
+ printf("EED interfMainPanel::onFlipContours() \n");
+ if(flipPanel==NULL)
+ {
+ flipPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition,
+ wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
+ wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
+ flipPanel->SetSizer(flexsizer, true);
+ flipPanel->SetAutoLayout( true );
+ panelFlip = new interfFlipPanel(flipPanel);
+ wxStaticText* stattext = new wxStaticText(flipPanel, -1,
+ wxString(_T(" Flip Contours ")),
+ wxDefaultPosition, wxDefaultSize,
+ wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
+ flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
+ flexsizer->Add(panelFlip, wxEXPAND);
+ flipPanel->Layout();
+ }
+ showPanel(flipPanel);
+}
+
+
+void interfMainPanel::FlipContours(int typeContourFlip, int flipDirection)
+{
+ printf("EED interfMainPanel::FlipContours( %d , %d ) \n",typeContourFlip, flipDirection );
+ wxContourMainFrame::getInstance()->FlipContours( typeContourFlip , flipDirection );
+}
+
+
+
//CMRU 17-08-09 ---------------------------------------------
void interfMainPanel::onPrintLabel ()
{
virtual bool Show(bool show);
void ShowResultImages(int typeContourGroup, int selection, int minZ, int maxZ);
void SetContourGroup(int contourGroup);
+ void onFlipContours();
+ void FlipContours(int typeContourFlip, int flipDirection);
+
//CMRU 29-08-09-----------------------------------------------------------------------------------------------
/**
*/
void onPrintLabel();
-
/**
* Calculates the pixel value in milimeters according to the current contour if the selected contour is a Line Contour
* @param size Size in milimeters of the selected contour
wxPanel *testPanel;
interfTestPanel *panelTest;
+ wxPanel *flipPanel;
+ interfFlipPanel *panelFlip;
+
wxPanel *mirrorPanel;
interfMirrorPanel *panelMirror;
}
-
-
-
-
-
BEGIN_EVENT_TABLE(interfMirrorPanel, wxPanel)
EVT_SCROLL(interfMirrorPanel :: onChangeWidth)
END_EVENT_TABLE()
+
//////////////////////////////////////////////////////////////
interfTestPanel::interfTestPanel(wxWindow* parent)
{
std::cout << "Button 2 has been pressed" << std::endl;
}
+
+
+
+
DECLARE_EVENT_TABLE()
};
+
+
+
class interfTestPanel
: public wxPanel
{
//-------------------------------------------------------------------------------
+ path.push_back(datadir + "/FlipContours.png");
+ nom.push_back("Flop contours");
+ funct.push_back((wxObjectEventFunction) &interfToolsMenu:: onFlipPressed);
+
+
this->addButtons(path, nom);
this->setVectorFunction(funct);
interfMainPanel::getInstance()->onPrintLabel();
}
+void interfToolsMenu::onFlipPressed(wxCommandEvent& event)
+{
+ printf("EED interfToolsMenu::onFlipLabel \n");
+ interfMainPanel::getInstance()->onFlipContours();
+}
void onSpreadPressed(wxCommandEvent& event);
void onMirrorPressed(wxCommandEvent& event);
void onPrintLabel(wxCommandEvent& event);
+ void onFlipPressed(wxCommandEvent& event);
+
private:
}
//------------------------------------------------------------------------------------------------------------
+
+
+//////////////////////////////////////////////////////////////
+
+interfFlipPanel::interfFlipPanel(wxWindow* parent)
+: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
+{
+ wxButton *buttonFlipX = new wxButton(this,wxID_ANY,_T("Flip Horizontally"), wxDefaultPosition, wxSize(200,35) );
+ wxButton *buttonFlipY = new wxButton(this,wxID_ANY,_T("Flip Vertically"), wxDefaultPosition, wxSize(200,35) );
+
+ wxString lstOptions[3];
+ lstOptions[0]=_T("Flip selected contours");
+ lstOptions[1]=_T("Flip all contours of actual slice");
+ lstOptions[2]=_T("Flip all contours");
+ _wichContoursRadioBox = new wxRadioBox(this, -1, _T("Transform"), wxDefaultPosition, wxDefaultSize, 3 , lstOptions, 1, wxRA_SPECIFY_COLS);
+ _wichContoursRadioBox->SetSelection(2);
+
+
+ Connect( buttonFlipX->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfFlipPanel::onFlipXPressed );
+ Connect( buttonFlipY->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfFlipPanel::onFlipYPressed );
+
+ wxFlexGridSizer * sizer = new wxFlexGridSizer(1);
+ sizer -> Add( _wichContoursRadioBox, 1, wxGROW );
+ sizer -> Add( buttonFlipX, 1, wxGROW );
+ sizer -> Add( buttonFlipY, 1, wxGROW );
+
+ this->SetSizer( sizer );
+ this->SetAutoLayout( true );
+ this->Layout();
+}
+
+
+
+
+interfFlipPanel::~interfFlipPanel(){
+}
+
+void interfFlipPanel::onFlipXPressed(wxCommandEvent& event)
+{
+ std::cout << "interfToolsPanels.cxx interfFlipPanel::onFlipXPressed FlipX (btn)" << std::endl;
+ int typeContoursFlip = _wichContoursRadioBox->GetSelection();
+ interfMainPanel::getInstance()->FlipContours( typeContoursFlip , 0 ); // type, direction
+}
+
+void interfFlipPanel::onFlipYPressed(wxCommandEvent& event)
+{
+ std::cout << "interfToolsPanels.cxx interfFlipPanel::onFlipYPressed FlipY (btn)" << std::endl;
+ int typeContoursFlip = _wichContoursRadioBox->GetSelection();
+ interfMainPanel::getInstance()->FlipContours( typeContoursFlip , 1 ); // type, direction
+}
+
+
void onContourGroup(wxCommandEvent& event);
void FillGridWithContoursInformation();
void onRangeSliceInformation(wxCommandEvent& event);
+};
+
+class interfFlipPanel
+ : public wxPanel
+{
+public:
+ interfFlipPanel(wxWindow * parent);
+ ~interfFlipPanel();
+ wxRadioBox *_wichContoursRadioBox;
+private:
+ void onFlipXPressed(wxCommandEvent& event);
+
+ void onFlipYPressed(wxCommandEvent& event);
};
+
+
//CMRU 29-08-09-----------------------------------------------------------------------------------------------
/**
* This class represents the calibration panel in the interface icons
*/
wxRadioBox * _unitsRadiobox;
};
+
//------------------------------------------------------------------------------------------------------------
+
#endif
}
+void wxContourMainFrame::SetZForAllContours(int pz)
+{
+ printf("EED wxContourMainFrame::SetZForAllContours\n");
+
+ //-- Normal Contours
+
+ std::vector< std::string > lstNameThings;
+ int i,sizeLstNameThings;
+ int ii,sizeLstPoints;
+
+ lstNameThings = kernelManager->GetLstNameThings();
+ sizeLstNameThings = lstNameThings.size();
+ for (i=0 ; i<sizeLstNameThings ; i++)
+ {
+printf("EED wxContourMainFrame::SetZForAllContours contour=%d \n", i );
+ manualBaseModel * manualModel = kernelManager->getOutlineByKeyName(lstNameThings[i]);
+ sizeLstPoints = manualModel->GetSizeLstPoints();
+ for (ii=0 ; ii<sizeLstPoints ; ii++)
+ {
+ manualModel->GetManualPoint(ii)->SetPointZ(-900);
+ }// for ii list of points
+ }// for i list of Things
+
+ //-- Static Contours
+
+ lstNameThings = kernelManager->GetLstNameThingsStatic();
+ sizeLstNameThings = lstNameThings.size();
+ for (i=0 ; i<sizeLstNameThings ; i++)
+ {
+ manualBaseModel * manualModel = kernelManager->getOutlineByKeyName(lstNameThings[i]);
+ sizeLstPoints = manualModel->GetSizeLstPoints();
+ for (ii=0 ; ii<sizeLstPoints ; ii++)
+ {
+ manualModel->GetManualPoint(ii)->SetPointZ(-900);
+ }// for ii list of points
+ }// for i list of static things
+}
+
+
+
void wxContourMainFrame::onLoadContours(std::string fileNameContourROI, bool interactiveInterface)
{
char tmp[255];
fscanf(pFile,"%s",tmp); // 1.0.3 || 1.0.2 || 1.0.1 || 1.0.0
std::string version(tmp);
+
+printf("EED wxContourMainFrame::onLoadContours version%s \n", version.c_str() );
+
+
//AD:02-06-09
_tmpReadFileTypeOfTransformation=-1;
if (version=="1.0.3")
readDimSpc(pFile,interactiveInterface); // DimSpc interactive ON
openContours(pFile,pFileData,false);
openContours(pFile,pFileData,true); //Load StaticContours
- }
+ }
if (version=="1.0.2")
{
//EED001
- readDimSpc(pFile,interactiveInterface); // DimSpc interactive ON
+ readDimSpc(pFile,interactiveInterface); // DimSpc interactive ON
openContours(pFile,pFileData,false);
- readDimSpc(pFile,false); // DimSpc interactive OFF
- openContours(pFile,pFileData,true); //Load StaticContours
+ readDimSpc(pFile,false); // DimSpc interactive OFF
+ openContours(pFile,pFileData,true); // Load StaticContours
+ SetZForAllContours(-900);
}
//AD:02-06-09
}
_theViewPanel->getSceneManager()->removeSceneContours();
changeInstant();
-
}
//Compare Spacing and Dims in X and Y (Necessary in Z?) - Just for Version 2
if (imageDim[0]!=_tmpReadFileImageDim[0] || imageDim[1]!=_tmpReadFileImageDim[1] || imageSpac[0]!=_tmpReadFileImageSpac[0] || imageSpac[1]!=_tmpReadFileImageSpac[1])
{
- wxDialog* dial = new wxDialog (this,-1,_T("Tools"),wxDefaultPosition, wxSize(260,160));
+ wxDialog* dial = new wxDialog (this,-1,_T("Tools"),wxDefaultPosition, wxSize(460,360));
wxSizer* buttonsSizer = dial->CreateSeparatedButtonSizer(wxOK|wxCANCEL);
wxBoxSizer *dialSizer = new wxBoxSizer(wxVERTICAL);
std::cout<<"GETFILELOCATION:"<<_fileLocation<<std::endl;
}
//------------------------------------------------------------------------------------------------------------
+
+
+
+
+
+
+
+
+void wxContourMainFrame::FlipSelectedContours(int flipDirection)
+{
+ printf("EED wxContourMainFrame::FlipSelectedContours flipDirection=%d \n", flipDirection );
+ FlipLstOfContours(
+ (std::vector<std::string>)_theViewPanel->getSceneManager()->getSelectedObjects() ,
+ flipDirection
+ );
+
+}
+
+void wxContourMainFrame::FlipActualSliceContours(int flipDirection)
+{
+ printf("EED wxContourMainFrame::FlipActualSliceContours flipDirection=%d \n", flipDirection );
+ FlipLstOfContours(
+ (std::vector<std::string>)_theViewPanel->getSceneManager()->GetlstContoursNameActualSlice() ,
+ flipDirection
+ );
+}
+
+void wxContourMainFrame::FlipAllContours(int flipDirection)
+{
+ printf("EED wxContourMainFrame::FlipAllContours flipDirection=%d \n", flipDirection );
+ FlipLstOfContours(
+ kernelManager->GetLstNameThings() ,
+ flipDirection
+ );
+}
+
+void wxContourMainFrame::FlipLstOfContours(std::vector<std::string> lstNameThings, int flipDirection)
+{
+ int ext[6];
+ getImageData()->GetExtent(ext);
+ int sizeX = ext[1]-ext[0];
+ int sizeY = ext[3]-ext[2];
+
+
+ int i,sizeLstNameThings;
+ int ii,sizeLstPoints;
+
+ sizeLstNameThings = lstNameThings.size();
+ for (i=0 ; i<sizeLstNameThings ; i++)
+ {
+ printf("EED wxContourMainFrame::FlipAllContours contour=%d \n", i );
+ manualBaseModel * manualModel = kernelManager->getOutlineByKeyName(lstNameThings[i]);
+ if (flipDirection==0)
+ {
+ manualModel->Transform_Ax_Plus_B(-1,sizeX,1,0 );
+ } else {
+ manualModel->Transform_Ax_Plus_B(1,0,-1,sizeY );
+ }
+ }// for i list of Things
+
+ //-- Static Contours
+
+ lstNameThings = kernelManager->GetLstNameThingsStatic();
+ sizeLstNameThings = lstNameThings.size();
+ for (i=0 ; i<sizeLstNameThings ; i++)
+ {
+ manualBaseModel * manualModel = kernelManager->getOutlineByKeyName(lstNameThings[i]);
+ if (flipDirection==0)
+ {
+ manualModel->Transform_Ax_Plus_B(-1,sizeX,1,0 );
+ } else {
+ manualModel->Transform_Ax_Plus_B(1,0,-1,sizeY );
+ }
+ }// for i list of static things
+}
+
+void wxContourMainFrame::FlipContours(int typeContourFlip, int flipDirection)
+{
+ printf("EED wxContourMainFrame::FlipContours( %d , %d ) \n",typeContourFlip, flipDirection );
+
+ saveState();
+
+ if (typeContourFlip==0) //
+ {
+ FlipSelectedContours(flipDirection);
+ }
+
+ if (typeContourFlip==1) //
+ {
+ FlipActualSliceContours(flipDirection);
+ }
+
+ if (typeContourFlip==2) //
+ {
+ FlipAllContours(flipDirection);
+ }
+ RefreshInterface();
+}
+
+
+
+
+
//AD
void onMirror();
-
+ //EED
+ void FlipContours(int typeContourFlip, int flipDirection);
+ void FlipSelectedContours(int flipDirection);
+ void FlipActualSliceContours(int flipDirection);
+ void FlipAllContours(int flipDirection);
+ void FlipLstOfContours(std::vector<std::string> lstNameThings, int flipDirection);
+
+
//====================================================================================================
void showAxis(bool show);
void saveFileWithContours( std::string filename );
void onLoadContours(std::string fileNameContourROI, bool interactiveInterface);
+ void SetZForAllContours(int pz);
int inredo;
int inundo;
#IF ( ${${PROJECT_NAME}_DOC} STREQUAL ON)
IF ( ${PROJECT_NAME}_DOC STREQUAL ON)
CREA_CPDIR ( ${CMAKE_CURRENT_SOURCE_DIR}/bouml/GeneralArchitecture/GeneralArchitecture_HTML/ ${DOXYGEN_OUTPUT}/${DOXYGEN_HTML_OUTPUT}/GeneralArchitecture_HTML/ )
+ CREA_CPDIR ( ${CMAKE_CURRENT_SOURCE_DIR}/bouml/buttons/ ${DOXYGEN_OUTPUT}/${DOXYGEN_HTML_OUTPUT}/How_to_add_buttons_HTML/ )
ADD_CUSTOM_TARGET(doxygen_${NAME} ALL
DEPENDS ${DOXYGEN_OUTPUT}/${DOXYGEN_HTML_OUTPUT}/index.html
</ul>
<ul>
</ul>
+
+<h4><big><big>Tutorials</big></big></h4><big><span class="text"><big><strong><a class="el" href="../GeneralArchitecture_HTML/index.html">creaContours</a></strong>
+is continously evolving. Its development it's not yet finished and tha
+application sees new features being added to it on a regular basis. The
+tutorials give a rough idea of how to contribute to the development of
+certain aspects of the application.</big><br /></span></big><ul style="font-family: Helvetica,Arial,sans-serif;"><li><a href="../How_to_add_buttons_HTML/new_button.html">How to add a new button</a>. Quick step-by-step guide on how to add to the application. a new button and its associated functionality.</li></ul>
+
+
+
+
+
<hr />
<h2 style="text-align: left;" class="style4">Modules
Description</h2>
\endhtmlonly
- */
\ No newline at end of file
+ */