interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtHandler * evtHandler, std::string datadir)
: wxPanel(parent, -1, wxDefaultPosition, wxSize(sizex, sizey), wxBORDER_SUNKEN)
{
-printf("EED interfMainPanel::interfMainPanel Start\n");
PANEL = "New Contour";
PANEL1 = "I/O";
PANEL2 = "Edit";
Connect(b6->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
this->Layout();
-printf("EED interfMainPanel::interfMainPanel End\n");
}
interfMainPanel::~interfMainPanel(void)
wxConceptControl::wxConceptControl(wxWindow *parent, bool orientation, int minV, int maxV, int actualV, std::string &aConceptName, std::string elementsDef )
:wxPanel(parent, -1, wxDefaultPosition, parent->GetSize(), wxTAB_TRAVERSAL)
{
-printf("EED wxConceptControl::wxConceptControl Start\n");
minValue = minV;
maxValue = maxV;
_numCheckBox = 0;
wxFlexGridSizer* sizer = new wxFlexGridSizer(3);
#endif
conceptName = new wxStaticText(this, -1, wxString(aConceptName.c_str(),wxConvUTF8), wxDefaultPosition, wxSize(90,20), wxALIGN_CENTRE );
-printf("EED wxConceptControl::wxConceptControl 1\n");
sizer->Add( conceptName, 0, wxALIGN_CENTRE |wxALIGN_CENTER_HORIZONTAL);
-printf("EED wxConceptControl::wxConceptControl 2\n");
if(orientation)
{
sizer->AddGrowableCol(1);
// sizer->AddGrowableRow(1);
conceptSlider = new wxSlider(this, -1, actualV, minV, maxV, wxDefaultPosition, wxDefaultSize, wxSL_LEFT| wxSL_AUTOTICKS | wxSL_LABELS, wxDefaultValidator, wxString(aConceptName.c_str(),wxConvUTF8) );
}
-printf("EED wxConceptControl::wxConceptControl 3\n");
sizer->Add(conceptSlider, 0, wxGROW |wxALL );
-printf("EED wxConceptControl::wxConceptControl 4\n");
createElements( sizer, elementsDef );
SetSizer( sizer );
Connect( conceptSlider->GetId(), wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler(wxConceptControl::onSliderTrack));//(wxObjectEventFunction) &wxConceptControl :: onSliderRelease );
Connect( conceptSlider->GetId(), wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler(wxConceptControl::onSliderRelease));//(wxObjectEventFunction) &wxConceptControl :: onSliderTrack );
this->SetAutoLayout( true );
-printf("EED wxConceptControl::wxConceptControl 5\n");
this->Layout();
-printf("EED wxConceptControl::wxConceptControl End\n");
}
wxConceptControl :: ~wxConceptControl()
//: wxWindow(parent, id, pos, size, style)
: wxPanel(parent, id, pos, size, style)
{
-printf("EED wxContourMainFrame :: wxContourMainFrame Start 1\n");
m_mgr.SetManagedWindow(this);
_contourGroup = 1;
_creatingContoursActive = false;
_viewThresholdImage = NULL;
_viewThresholdImagePanel = NULL;
_viewColorLayerImagePanel = NULL;
-printf("EED wxContourMainFrame :: wxContourMainFrame End 1\n");
}
wxContourMainFrame :: wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style,std::string datadir)
: wxPanel(parent, id, pos, size, style)
{
-printf("EED wxContourMainFrame :: wxContourMainFrame Start 2\n");
m_mgr.SetManagedWindow(this);
_contourGroup = 1;
_creatingContoursActive = false;
_viewThresholdImage = NULL;
_viewThresholdImagePanel = NULL;
_viewColorLayerImagePanel = NULL;
-printf("EED wxContourMainFrame :: wxContourMainFrame A\n");
// set up default notebook style
m_notebook_style = wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_EXTERNAL_MOVE | wxNO_BORDER;
m_notebook_theme = 0;
_datadir = datadir;
inredo = 0;
inundo = 0;
-printf("EED wxContourMainFrame :: wxContourMainFrame B\n");
_pannew = interfMainPanel::getInstance(this,datadir+"/data/Icons");//, eventHandler);
-printf("EED wxContourMainFrame :: wxContourMainFrame C\n");
_performingOperation = new PerformingOperation();
-printf("EED wxContourMainFrame :: wxContourMainFrame C.1\n");
if(images.size() > 0)
{
-printf("EED wxContourMainFrame :: wxContourMainFrame C.2\n");
this->setVectImages(images);
-printf("EED wxContourMainFrame :: wxContourMainFrame C.3\n");
}
_contourextractdata = NULL;
-printf("EED wxContourMainFrame :: wxContourMainFrame End 2\n");
}
void wxContourMainFrame::setVectImages(std::vector<vtkImageData*> imgs)
{
-printf("EED wxContourMainFrame::setVectImages Start\n");
_images = imgs;
#if defined(__GNUC__)
std::string str_home(getenv("HOME"));
std::string strCreaContourDataTmp = str_home + "/.creaContourDataTemp/";
std::vector<std::string> conceptNameVect;
std::vector<int> conceptSizeVect;
-printf("EED wxContourMainFrame::setVectImages Start 01\n");
notebook = this->createNotebook();
-printf("EED wxContourMainFrame::setVectImages Start 02\n");
kernelManager = new KernelManagerContour( imgs , _datadir+"/data/" , strCreaContourDataTmp );
-printf("EED wxContourMainFrame::setVectImages Start 03\n");
_instantPanel = new wxInstantChooserPanel( notebook, "Instant Chooser", true, false, "c" );
-printf("EED wxContourMainFrame::setVectImages Start 04\n");
_theViewPanel = new wxContourViewPanel( kernelManager->getSourceImage(), notebook );
-printf("EED wxContourMainFrame::setVectImages Start 05\n");
//-------------------------------------------------------------
kernelManager->getConceptsInformation(conceptNameVect, conceptSizeVect);
-printf("EED wxContourMainFrame::setVectImages 1\n");
_instantPanel->addConcepts(conceptNameVect, conceptSizeVect);
-printf("EED wxContourMainFrame::setVectImages 2\n");
double val = _theViewPanel->getCurrentDeep();
_instantPanel->setConceptValue( "Axe Depth", (int)val );
//JCP _instantPanel->setConceptValue("time", num de imagenes);
//*******************changeInstant();
_theViewPanel->setVerticalConcept( "Axe Depth", data->getMinValue(), data->getMaxValue(), data->getMinShowedValue(), data->getMaxShowedValue(), data->getActualValue() );
this->configurePanels( );
-printf("EED wxContourMainFrame::setVectImages End\n");
}
wxContourViewPanel::wxContourViewPanel ( vtkImageData * theShowingImage, wxWindow *parent, const wxPoint& pos, const wxSize& size,long style, int vertStart, int vertEnd, int horzStart, int horzEnd )
:wxPanel(parent, -1, pos, size, style)
{
-printf("EED wxContourViewPanel::wxContourViewPanel Start\n");
theShowingImage->GetSpacing(last_spacing);
showingVID = theShowingImage;
int gapH = 20;
wxFlexGridSizer * panelSizer = new wxFlexGridSizer(4);
panelSizer -> AddGrowableCol(2);
#endif
-printf("EED wxContourViewPanel::wxContourViewPanel 01\n");
-printf("EED wxContourViewPanel::wxContourViewPanel 1\n");
panelSizer->Add(_verticalBar, 1, wxGROW);
-printf("EED wxContourViewPanel::wxContourViewPanel 2\n");
panelSizer->AddSpacer(gapV);
-printf("EED wxContourViewPanel::wxContourViewPanel 3\n");
panelSizer->Add(theViewPanel, 1, wxGROW);
-printf("EED wxContourViewPanel::wxContourViewPanel 4\n");
panelSizer->AddSpacer(gapV);
//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
outSizer = new wxFlexGridSizer(3);
outSizer -> AddGrowableCol(1);
#endif
-printf("EED wxContourViewPanel::wxContourViewPanel 5\n");
-printf("EED wxContourViewPanel::wxContourViewPanel 7\n");
outSizer->Add( _horizontalBar, 1, wxGROW);
outSizer->Add( panelSizer, 1, wxGROW);
outSizer->AddSpacer(gapH);
_horizontalBar->setDeviceBlitStart( _verticalBar->GetWidth() + 2*gapH, gapV);
_horizontalBar->setDeviceEndMargin( 2*gapH+10 );
-printf("EED wxContourViewPanel::wxContourViewPanel 8\n");
//Connecting the events to the horizontal bar
Connect(_horizontalBar->GetId(),wxEVT_TSBAR,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onBarrange_Horizontal );
Connect(_horizontalBar->GetId(),wxEVT_TSBAR_ACTUAL,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onActualChange_Bar_Horizontal );
Connect(_horizontalBar->GetId(),wxEVT_TSBAR_END,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onEndChange_Bar_Horizontal );
Connect(_horizontalBar->GetId(),wxEVT_SELECTION_END,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onSelectionEnd_Horizontal );
Connect(_horizontalBar->GetId(),wxEVT_TSBAR_MOVED,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onMovedBar_Horizontal );
-printf("EED wxContourViewPanel::wxContourViewPanel 9\n");
//Connecting the events to the vertical bar
Connect(_verticalBar->GetId(),wxEVT_TSBAR,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onBarrange_Vertical );
Connect(_verticalBar->GetId(),wxEVT_TSBAR_END,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onEndChange_Bar_Vertical );
Connect(_verticalBar->GetId(),wxEVT_SELECTION_END,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onSelectionEnd_Vertical );
Connect(_verticalBar->GetId(),wxEVT_TSBAR_MOVED,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onMovedBar_Vertical );
-printf("EED wxContourViewPanel::wxContourViewPanel 9.1\n");
this->SetSizer( outSizer );
-printf("EED wxContourViewPanel::wxContourViewPanel 9.2\n");
this->SetAutoLayout( true );
-printf("EED wxContourViewPanel::wxContourViewPanel 9.3\n");
this->Layout();
//SetSize(1900,1900);
//theViewPanel->SetSize(800,600);
//theViewPanel->GetWindow(1)->SetSize(800,600);
//outSizer->Fit( this );
-printf("EED wxContourViewPanel::wxContourViewPanel 10\n");
initializeScenceManager();
-printf("EED wxContourViewPanel::wxContourViewPanel End\n");
}
*/
void wxInstantChooserPanel :: addConcept(std::string aConceptName, int minV, int maxV, int actualV)
{
-printf("EED wxInstantChooserPanel :: addConcept Start\n");
wxConceptControl * nwConcept = new wxConceptControl(this, _orientation, minV, maxV, actualV, aConceptName, _configuration);
_concepts->push_back( nwConcept );
_lastConceptUpdated = nwConcept;
-printf("EED wxInstantChooserPanel :: addConcept 1\n");
_outSizer->Add(nwConcept, wxEXPAND);
-printf("EED wxInstantChooserPanel :: addConcept 2\n");
Connect(nwConcept->GetId(), wxEVT_CONCEPT_RELEASE, (wxObjectEventFunction) (wxCommandEventFunction) &wxInstantChooserPanel::onConceptRelease );
-printf("EED wxInstantChooserPanel :: addConcept End\n");
}
void wxInstantChooserPanel :: setWxEventHandler( wxEvtHandler * theEventHandler )