#include "wxContourMainFrame.h"
//#include "OutlineModelManager.h"
//#include "wxContourEventHandler.h"
-
//#include <creaImageIOWxGimmickDialog.h>
//#include <creaImageIOWxGimmickReaderDialog.h>
#include <creaImageIOWxSimpleDlg.h>
-
#include <creaImageIOSystem.h>
-
#include <creaVtkBasicSlicer.h>
//#include "wxContourMainPanel.h"
-
#include "vtkMetaImageReader.h"
#include <map>
#include "vtkImageData.h"
-
#include "wx/artprov.h"
#include <wx/filedlg.h>
-
-/* EED EraseMe
-//#include "OutlineModelBuilder.h"
-//#include "ContourThing.h"
-//#include "AxeThing.h"
-//#include "ImageSourceThing.h"
-//#include "ImageSectionThing.h"
-//#include "SomeEnvironment.h"
-//#include "ReaderEnvironment.h"
-
-//#include "interfMainPanel.h"
-
-#if defined(MACOSX) // assume this is OSX
-# include <sys/param.h>
-# include <mach-o/dyld.h> // _NSGetExecutablePath : must add -framework CoreFoundation to link line
-# include <string.h>
-# ifndef PATH_MAX
-# define PATH_MAX MAXPATHLEN
-# endif
-#endif // MACOSX
-*/
-
#ifndef PATH_MAX // If not defined yet : do it
# define PATH_MAX 2048
#endif
-
#if defined(WIN32)
#include <direct.h>
#else
#include <dirent.h>
#endif
-
#include <stdlib.h>
-
-
wxContourMainFrame* wxTheApplication::frame = 0;
//----------------------------------------------------------------------------------------------------------------
// This macro implements the entry point (main function) for the application
//----------------------------------------------------------------------------------------------------------------
-
-
-
-
-
//=========================================================================
//=========================================================================
IMPLEMENT_APP( wxTheApplication );
}
#endif
-
-
-bool wxTheApplication :: OnInit()
+bool wxTheApplication::OnInit()
{
vtkOutputWindowCreaContour *outputWindowCreaContour= vtkOutputWindowCreaContour::New();
vtkOutputWindow::SetInstance( outputWindowCreaContour );
outputWindowCreaContour->Delete();
-
wxString infoImage;
wxInitAllImageHandlers();
//EED01Juin2010 int output_dim = NATIVE;
//EED01Juin2010 int threads = 1;
-
//EED 1Juin2010
creaImageIO::WxSimpleDlg w(0,_T("Select your image"),"creaContours_Descriptor.dscp","creatisContours DB");
w.ShowModal();
// threads);
// w.ShowModal();
-
//JCP
//std::string datadir( crea::wx2std(GetExecutablePath()) );
std::string datadir( crea::System::GetExecutablePath() );
//JCP
-
#ifdef LINUX /* assume this is OSX */
datadir=datadir+"/../share/creaContours";
#endif // MACOSX
-
#ifdef MACOSX /* assume this is OSX */
datadir=datadir+"/../../../../share/creaContours";
#endif // MACOSX
-
-
if(w.GetReturnCode() == wxID_OK)
{
- std::vector<std::string> s;
-//EED 01Juin2010 w.GetSelectedFiles(s);
-
-
-//EED std::vector<std::string>::iterator i;
-// for (i=s.begin();i!=s.end();++i)
-// {
-// std::cout << *i << std::endl;
-// }
-// std::cout << "$$$$ "<<std::endl;
- //w.GetSelectedImages(images);
-
-//EED31mai2010 w.GetSelectedImages(images,output_dim);
-
-
-//EED 1Juin2010
-// std::vector<creaImageIO::OutStrGimmick> out;
-// std::vector<std::string> attr;
-//// attr.push_back("D0028_0010");
-//// attr.push_back("D0008_0023");
-//// attr.push_back("D0008_1070");
-// w.getSelected(out, attr,true,"");
-//// std::cout<<out.size()<<std::endl;
-//// crea::VtkBasicSlicer(out.front().img);
-// int size=out.size();
-// int ii;
-// for (ii=0;ii<size;ii++)
-// {
-// images.push_back(out[ii].img);
-// }
-
-//EED 1Juin2010
-// printf("EED creaContours wxTheApplication :: OnInit %d\n", w.getImagesSelected().size() );
- images = w.getImagesSelected();
- infoImage = w.getInfoImage();
-// printf("EED creaContours wxTheApplication :: OnInit %d\n", images.size() );
-
- }
- else if (w.GetReturnCode() == wxID_CANCEL)
+ std::vector<std::string> s;
+ images = w.getImagesSelected();
+ infoImage = w.getInfoImage();
+ } else if (w.GetReturnCode() == wxID_CANCEL)
{
- vtkMetaImageReader *reader = vtkMetaImageReader::New();
- std::string filename= datadir + "/data/hola.mhd";
- infoImage=_T("DEFAULT-Image:")+crea::std2wx(filename);
- reader->SetFileName( filename.c_str() );
- reader->Update();
- images.push_back(reader->GetOutput());
- }
- else
- {
- return -1;
- }
-
-
+ vtkMetaImageReader *reader = vtkMetaImageReader::New();
+ std::string filename= datadir + "/data/hola.mhd";
+ infoImage=_T("DEFAULT-Image:")+crea::std2wx(filename);
+ reader->SetFileName( filename.c_str() );
+ reader->Update();
+ images.push_back(reader->GetOutput());
+ } else {
+ return -1;
+ }
wxFrame* frame1 = new wxFrame(NULL, wxID_ANY, wxT("Creatis- ROI Application- Evaluation version,01 Agost 2010 ")+infoImage, wxPoint(400,50), wxSize(800, 600) );
-
//frame = new wxContourMainFrame( frame1, wxID_ANY, wxString(_T("")), wxPoint(50,50), wxSize(800, 600), images );
frame = wxContourMainFrame::getInstance(frame1, wxID_ANY, wxString(_T("")), wxPoint(200,50), wxSize(800, 600), images, wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER,datadir );
frame1->CreateStatusBar();
vtkImageData* img = bbGetInputIn();
std::vector<vtkImageData*> selectedimages;
- if(img!=NULL && currentimg!=img){
-
- printf("EED nDimensions::Process 02\n");
+ if(img!=NULL && currentimg!=img)
+ {
wxContourMainFrame::getInstance()->ShowToolsPanel(true);
currentimg=img;
selectedimages.push_back(img);
wxContourMainFrame::getInstance()->setVectImages(selectedimages);
- printf("EED nDimensions::Process 03\n");
}
if(currentimg != NULL){
#include "interfMainPanel.h"
-interfMainPanel* interfMainPanel::interfmainpanel=NULL;
-wxFrame* interfMainPanel::_newframe=NULL;
+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)
_viewColorLayerImagePanel = NULL;
}
- wxContourMainFrame :: wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style,std::string datadir)
+ 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)
{
m_mgr.SetManagedWindow(this);
notebook->AddPage( _theViewPanel, wxT(" View ") );
m_mgr.Update();
}
-
-
if( configured )
{
notebook->AddPage( _instantPanel, wxT("Instant Page") );
m_mgr.Update();
}
-
m_mgr.AddPane(notebook, wxAuiPaneInfo().Name(wxT("notebook_content")).CenterPane().PaneBorder(false));
m_mgr.Update();
-
SetMinSize(wxSize(300,300));
m_mgr.Update();
return configured;
return manModelContour;
}
-void wxContourMainFrame :: saveState(){
+void wxContourMainFrame :: saveState()
+{
std::string temp = kernelManager->saveState();
saveFileWithContours(temp);
}
-void wxContourMainFrame::onDeleteContour(){
+void wxContourMainFrame::onDeleteContour()
+{
//JCP 20-10-08 Undo redo implementation
saveState();
//JCP 20-10-08 Undo redo implementation
}
}
-void wxContourMainFrame :: deleteContour( std::string theKeyName ){
+void wxContourMainFrame :: deleteContour( std::string theKeyName )
+{
/*
manualContourModel * cModel;
manualViewBaseContour * cViewer;
JCP --08-09-2008 */
}
-void wxContourMainFrame::setConceptValue( std::string name, int value ){
+void wxContourMainFrame::setConceptValue( std::string name, int value )
+{
_instantPanel->setConceptValue(name, value);
}
-ConceptDataWrap* wxContourMainFrame::getLastConceptData(){
+ConceptDataWrap* wxContourMainFrame::getLastConceptData()
+{
return _instantPanel->getLastConceptData();
}
-bool wxContourMainFrame::getIfConceptCheckedAt( std::string name, int pos ){
+bool wxContourMainFrame::getIfConceptCheckedAt( std::string name, int pos )
+{
return _instantPanel->getIfConceptCheckedAt( name, pos );
}
std::vector<int> instantVect;
_instantPanel->getInstant( instantVect );
int actualSlice = instantVect[1];
-
kernelManager->setInstant(instantVect);
-
// Refresh Mask image
- if(_viewMaskImage!=NULL){
+ if(_viewMaskImage!=NULL)
+ {
_viewMaskImage->SetZ(actualSlice);
if (_viewMaskImagePanel->IsVisible()==true)
{
getMaskValue(&mask,&value, _contourGroup , 0, -1, -1);
_viewMaskImage->onThreshold();
}
- }
-
+ } // if _viewMaskImage
// Refresh Threshold image
- if(_viewThresholdImage!=NULL){
+ if(_viewThresholdImage!=NULL)
+ {
_viewThresholdImage->SetZ(actualSlice);
- if (_viewThresholdImagePanel->IsVisible()==true){
+ if (_viewThresholdImagePanel->IsVisible()==true)
+ {
_viewThresholdImage->onThreshold();
}
- }
-
-
+ } // if _viewThresholdImage
updateInstantOutlines();
updateInstantImageData();
updateInstantAxes();
-void wxContourMainFrame :: updateInstantOutlines()
+void wxContourMainFrame::updateInstantOutlines()
{
_theViewPanel->removeSceneContours();
_theViewPanel->addNameWrapperToScene();
//}
}
-int wxContourMainFrame::getNamesWrappingSize(){
+int wxContourMainFrame::getNamesWrappingSize()
+{
return kernelManager->getNamesWrappingSize();
}
-std::string wxContourMainFrame::getNameWrapping(int i){
+
+std::string wxContourMainFrame::getNameWrapping(int i)
+{
return kernelManager->getNameWrapping(i);
}
void wxContourMainFrame::onCopy(){
std::vector<std::string> currentSelection = _theViewPanel->getSelectedObjects();
-
std::vector<int> tempVector;
_instantPanel->getInstant( tempVector );
_performingOperation->reset();
_performingOperation->setKeyNamesOperationElems( currentSelection );
}
-void wxContourMainFrame::onPaste(){
-
-
+void wxContourMainFrame::onPaste()
+{
char theStartCommand = _performingOperation->getStartCommand();
if ( theStartCommand == COPY )
{
}
}
}
-void wxContourMainFrame::onUndo(){
+
+void wxContourMainFrame::onUndo()
+{
std::string filename;
if(kernelManager->onUndoSaveFile(filename)){
saveFileWithContours(filename);
_theViewPanel->getSceneManager()->createCopyContourOf( anExistingKName, cloneName, manualModel , append );
}
-//EED04
-void wxContourMainFrame ::loadState(std::string filename){
-
+void wxContourMainFrame ::loadState(std::string filename)
+{
deleteAllContours();
onLoadContours(filename,false);
-
- /* EED Borrame
- char tmp[255];
- FILE *pFile=fopen(filename.c_str(),"r+");
-
- fscanf(pFile,"%s",tmp); // --CreaContour--
-
- fscanf(pFile,"%s",tmp); // Version
- fscanf(pFile,"%s",tmp); // 1.0.3 || 1.0.2 || 1.0.1 || 1.0.0
-
- deleteAllContours();
-
- loadContours(pFile, false);
- loadContours(pFile, true);
-
- fclose(pFile);
- */
-}
-
-
-//EED03
-/*EED Borrame
-void wxContourMainFrame::loadContours( FILE *pFile, bool staticContour )
-{
- char tmp[255];
-
- if (staticContour==false)
- {
- fscanf(pFile,"%s",tmp); // ImageDimensions
- fscanf(pFile,"%s",tmp); // X
- fscanf(pFile,"%s",tmp); // Y
- fscanf(pFile,"%s",tmp); // Z
-
- fscanf(pFile,"%s",tmp); // ImageSpacing
- fscanf(pFile,"%s",tmp); // X
- fscanf(pFile,"%s",tmp); // Y
- fscanf(pFile,"%s",tmp); // Z
- }
-
- fscanf(pFile,"%s",tmp); // NumberOfContours
- fscanf(pFile,"%s",tmp); // ##
- int numberOfContours = atoi(tmp);
-
- std::vector<int> instantVector;
- int typeContourModel;
- manualBaseModel *manModelContour;
- int typeView;
-
- int i;
- for (i=0;i<numberOfContours;i++)
- {
- instantVector.clear();
- fscanf(pFile,"%s",tmp); // Instant
- fscanf(pFile,"%s",tmp); // 1
- instantVector.push_back( atoi(tmp) );
- fscanf(pFile,"%s",tmp); // 2
- instantVector.push_back( atoi(tmp) );
- fscanf(pFile,"%s",tmp); // 3
- instantVector.push_back( atoi(tmp) );
- fscanf(pFile,"%s",tmp); // 4
- instantVector.push_back( atoi(tmp) );
- fscanf(pFile,"%s",tmp); // 5
- instantVector.push_back( atoi(tmp) );
- fscanf(pFile,"%s",tmp); // 6
- instantVector.push_back( atoi(tmp) );
-
- fscanf(pFile,"%s",tmp); // TypeContourModel
- fscanf(pFile,"%s",tmp); // ##
- typeContourModel = atoi(tmp);
-
- manModelContour = kernelManager->factoryManualContourModel(typeContourModel);
- manModelContour->Open(pFile);
-
- fscanf(pFile,"%s",tmp); // TypeView
- fscanf(pFile,"%s",tmp); // ##
- typeView = atoi(tmp);
-
- std::string theName;
- theName = kernelManager->createOutline( manModelContour, instantVector );
- bool addedModel = theName.compare("") != 0;
- if( addedModel )
- {
- double spc[3];//Si no hay imagen pero hay contornos que spacing se pone por default
- _theViewPanel->getSpacing(spc);
- //Adding the manualContourControler to interface objects structure
- //Adding the manualViewContour to interface objects structure
- //_theViewPanel->getSceneManager()->setControlActiveStateOfALL( false );//This call is being done here because if the ROI is created underneath the previously created ROIS will still be active.
- _theViewPanel->getSceneManager()->configureViewControlTo( theName, manModelContour,spc , typeView) ;
- }
-
- if (staticContour==true)
- {
- Instant instant(&instantVector);
- kernelManager->changeContourOfManager( theName , &instant );
- }
- }// for numberOfContours
}
-*/
void wxContourMainFrame::onLoad()
void wxContourMainFrame::SetZForAllContours(int pz)
{
- printf("EED wxContourMainFrame::SetZForAllContours\n");
-
//-- Normal Contours
-
std::vector< std::string > lstNameThings;
int i,sizeLstNameThings;
int ii,sizeLstPoints;
fscanf(pFileData,"%s",tmpD); // NumberOfContours
fscanf(pFileData,"%s",tmpD); // #
}
-
fscanf(pFile,"%s",tmp); // --CreaContour--
-
fscanf(pFile,"%s",tmp); // Version
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")
openContours(pFile,pFileData,false);
openContours(pFile,pFileData,true); //Load StaticContours
}
-
if (version=="1.0.2")
{
//EED001
openContours(pFile,pFileData,true); // Load StaticContours
SetZForAllContours(-900);
}
-
//AD:02-06-09
else if (version=="1.0.1")
{
}
-void wxContourMainFrame::RefreshInterface(){
+void wxContourMainFrame::RefreshInterface()
+{
changeInstant();
_theViewPanel->RefreshInterface();
//wxVtk2DBaseView *wxvtk2dbaseview = (wxVtk2DBaseView*)this->_theViewPanel->getWxVtkBaseView();
//wxvtk2dbaseview->Refresh();
}
-vtkImageData* wxContourMainFrame::getImageData(){
+vtkImageData* wxContourMainFrame::getImageData()
+{
return _theViewPanel->getImageData();
}
return _theViewPanel->getWindowLevel();
}
-void wxContourMainFrame::onBrigthnessColorWindowLevel(int colorwindow,int windowlevel){
+void wxContourMainFrame::onBrigthnessColorWindowLevel(int colorwindow,int windowlevel)
+{
_theViewPanel->onBrigthnessColorWindowLevel(colorwindow, windowlevel);
RefreshInterface();
}
-void wxContourMainFrame::onInterpolation(bool interpolate){
+void wxContourMainFrame::onInterpolation(bool interpolate)
+{
_theViewPanel->onInterpolation(interpolate);
RefreshInterface();
}
-void wxContourMainFrame::onChangeInstant(std::string name,int actual){
+void wxContourMainFrame::onChangeInstant(std::string name,int actual)
+{
_instantPanel->setConceptValue( name, actual );
}
-void wxContourMainFrame::resetAppend(){
+void wxContourMainFrame::resetAppend()
+{
kernelManager->resetAppend();
-
}
-void wxContourMainFrame::onSpreadAdd(){
+void wxContourMainFrame::onSpreadAdd()
+{
std::vector<double> vecX;
std::vector<double> vecY;
std::vector<double> vecZ;
}
-void wxContourMainFrame::onSpreadAddAll(){
+void wxContourMainFrame::onSpreadAddAll()
+{
//EED02
std::vector<int> tempVector;
_instantPanel->getInstant( tempVector );
}
-void wxContourMainFrame::onSpreadGo(int type){
+void wxContourMainFrame::onSpreadGo(int type)
+{
//JCP 20-10-08 Undo redo implementation
saveState();
//JCP 20-10-08 Undo redo implementation
//RefreshInterface();
}
-void wxContourMainFrame::getInstantVector(std::vector<int>& tempVector){
-
+void wxContourMainFrame::getInstantVector(std::vector<int>& tempVector)
+{
}
-std::vector<std::string> wxContourMainFrame::getOutlinesName(int slide){
+std::vector<std::string> wxContourMainFrame::getOutlinesName(int slide)
+{
std::vector<int> tempVector;
_instantPanel->getInstant(tempVector);
//Asignation of slide number should be different ex by name
#include "vtkMetaImageWriter.h"
#include "vtkImageData.h"
#include "vtkTransform.h"
-
#include "vtkCamera.h"
#include "vtkImageActor.h"
#include <vtkImageMapToColors.h>
int _numberOfVariablesStatistics;
// Contour Image Mask
- ThresholdImageView *_viewMaskImage;
+ ThresholdImageView *_viewMaskImage;
ThresholdImageViewPanel *_viewMaskImagePanel;
// Threshold Image
//------------------------------------------------------------------------------------------------------------
// Constructors & Destructors
//------------------------------------------------------------------------------------------------------------
- /*{
-
- showingVID = theShowingImage;
- int gapH = 20;
- int gapV = 10;
- createHorizontalBar(1,80);
- createVerticalBar(1,200);
- createViewPanel();
-
- wxFlexGridSizer * panelSizer = new wxFlexGridSizer(3,1,0,0);
- panelSizer->AddSpacer(gapV);
- panelSizer -> AddGrowableCol(1);
- panelSizer->Add(theViewPanel, 1, wxEXPAND);
- panelSizer->AddSpacer(gapV);
-
- wxFlexGridSizer * downSizer = new wxFlexGridSizer(1,3,gapV,gapH);
- downSizer->Add(_verticalBar, 1, wxEXPAND);
- //downSizer->AddSpacer(gapH);
- downSizer -> AddGrowableCol(1);
- downSizer->Add(panelSizer, 1, wxEXPAND|wxALL|wxCENTER);
- //downSizer->AddSpacer(gapH);
- outSizer = new wxFlexGridSizer(3,1,1,1);
- outSizer->Add(_horizontalBar, 1, wxEXPAND);
- outSizer -> AddGrowableRow(1);
- outSizer -> AddGrowableCol(1);
- outSizer->Add(downSizer, 1, wxEXPAND);
-
- _horizontalBar->setDeviceBlitStart( _verticalBar->GetWidth() + gapH, gapV);
- _horizontalBar->setDeviceEndMargin( gapH+10 );
-
- //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_START,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onStartChange_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 );
-
- //Connecting the events to the vertical bar
- Connect(_verticalBar->GetId(),wxEVT_TSBAR,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onBarrange_Vertical );
- Connect(_verticalBar->GetId(),wxEVT_TSBAR_ACTUAL,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onActualChange_Bar_Vertical );
- Connect(_verticalBar->GetId(),wxEVT_TSBAR_START,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onStartChange_Bar_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 );
-
-
- this->SetAutoLayout( true );
- SetSizer( outSizer );
- this->Layout();
-
- SetSize(900,700);
- theViewPanel->SetSize(800,600);
- theViewPanel->GetWindow(1)->SetSize(800,600);
-
- outSizer->Fit( this );
- SetBackgroundColour(wxColour(255,0,0));
-
- }*/
//:wxScrolledWindow(parent, -1, pos, size, style)
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)
createViewPanel();
_eventHandler = NULL;
+ wxFlexGridSizer * panelSizer = new wxFlexGridSizer(1,4, gapV, gapH);
//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
#if wxMAJOR_VERSION <= 2
- wxFlexGridSizer * panelSizer = new wxFlexGridSizer(1,4, gapV, gapH);
panelSizer -> AddGrowableCol(2);
panelSizer -> AddGrowableRow(2);
#else
- wxFlexGridSizer * panelSizer = new wxFlexGridSizer(4);
- panelSizer -> AddGrowableCol(2);
+ panelSizer -> AddGrowableRow(0,1);
+ panelSizer -> AddGrowableCol(2,1);
#endif
- panelSizer->Add(_verticalBar, 1, wxGROW);
+ panelSizer->Add(_verticalBar, 0, wxEXPAND);
panelSizer->AddSpacer(gapV);
- panelSizer->Add(theViewPanel, 1, wxGROW);
+ panelSizer->Add(theViewPanel, 1, wxEXPAND);
panelSizer->AddSpacer(gapV);
+ outSizer = new wxFlexGridSizer(3, 1, gapH, gapV);
//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
#if wxMAJOR_VERSION <= 2
- outSizer = new wxFlexGridSizer(3, 1, gapH, gapV);
outSizer -> AddGrowableCol(1);
outSizer -> AddGrowableRow(1);
#else
- outSizer = new wxFlexGridSizer(3);
- outSizer -> AddGrowableCol(1);
+ outSizer -> AddGrowableRow(1,1);
+ outSizer -> AddGrowableCol(0,1);
#endif
- outSizer->Add( _horizontalBar, 1, wxGROW);
- outSizer->Add( panelSizer, 1, wxGROW);
+ outSizer->Add( _horizontalBar, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP);
+ outSizer->Add( panelSizer, 1, wxEXPAND);
outSizer->AddSpacer(gapH);
_horizontalBar->setDeviceBlitStart( _verticalBar->GetWidth() + 2*gapH, gapV);
}
}
- void wxContourViewPanel::removeSceneContours(){
+ void wxContourViewPanel::removeSceneContours()
+ {
_sceneManager->removeSceneContours();
}
- void wxContourViewPanel::addNameWrapperToScene(){
+ void wxContourViewPanel::addNameWrapperToScene()
+ {
int size = wxContourMainFrame::getInstance()->getNamesWrappingSize();
for(int i = 0; i < size;i++){
std::string name = wxContourMainFrame::getInstance()->getNameWrapping(i);
//------------------------------------------------------------------------------------------------------------
// Attributtes
//------------------------------------------------------------------------------------------------------------
- wxVtkBaseView_SceneManager* _sceneManager;
+ wxVtkBaseView_SceneManager *_sceneManager;
/*
* Represents the outer sizer of the ContourViewPanel
*/
- wxFlexGridSizer* outSizer;
+ wxFlexGridSizer *outSizer;
/*
* Represents the panel for viewing
*/
- wxMaracas_N_ViewersWidget * theViewPanel;
+ wxMaracas_N_ViewersWidget *theViewPanel;
/*
* Represents the vertical barrange
*/
- mBarRange * _verticalBar;
+ mBarRange *_verticalBar;
/*
* Represents the horizontal barrange
*/
- mBarRange * _horizontalBar;
+ mBarRange *_horizontalBar;
+ vtkImageData *showingVID;
+ std::string _verticalConceptName;
+ std::string _horizontalConceptName;
+ double last_spacing[3];
+ bool _useVerticalBar;
+ bool _useHorizontalBar;
- vtkImageData * showingVID;
-
- std::string _verticalConceptName;
-
- std::string _horizontalConceptName;
-
- double last_spacing[3];
-
- bool _useVerticalBar;
-
- bool _useHorizontalBar;
-
- wxEvtHandler * _eventHandler;
+ wxEvtHandler *_eventHandler;
//EED
wxVtkBaseView_SceneManager :: wxVtkBaseView_SceneManager( wxVtkBaseView * theWxBaseViewToManage, wxEvtHandler * theEventHandler, double * spc )
{
-
_lastInteraction = NULL;
- _lastInteractionName = "";
+ _lastInteractionName = "";
_eventHandler = theEventHandler;
_leftClickCount = 0;
_rigthClickCount = 0;
-
- _contours_ViewControl = new std::map< std::string, ContourWrap_ViewControl * >();
- _sceneContours_ViewControl = new std::map< std::string, ContourWrap_ViewControl * >();
+ _contours_ViewControl = new std::map< std::string, ContourWrap_ViewControl * >();
+ _sceneContours_ViewControl = new std::map< std::string, ContourWrap_ViewControl * >();
_workingGroup = new std::map< std::string, ContourWrap_ViewControl * >();
-
_creatingMULT_ROI = false;
- _editingROI = false;
- _toIncludeAtInteractionGroup = false;
- _waiting = false;
+ _editingROI = false;
+ _toIncludeAtInteractionGroup = false;
+ _waiting = false;
_creatingROI = false;
- _drawingSelectionROI = false;
- SetWidthContour(1.0);
-
+ _drawingSelectionROI = false;
+ SetWidthContour(1.0);
_wxVtk_BaseView = theWxBaseViewToManage;
if( _wxVtk_BaseView!=NULL )
{
}
configureSelectionROI( spc );
}
+
//------------------------------------------------------------------------------------------------------------
wxVtkBaseView_SceneManager :: ~wxVtkBaseView_SceneManager()
{
{
_contours_ViewControl->erase( iter );
i++;
- }
+ } // for
_contours_ViewControl->clear();
delete _contours_ViewControl;
_workingGroup->clear();
wxCommandEvent cevent( theEventType );
cevent.SetString( wxString( text.c_str(), wxConvUTF8) );
_eventHandler->ProcessEvent( cevent );
- }
+ } // if
}
-
//------------------------------------------------------------------------------------------------------------
// Attributes getters and setters
//------------------------------------------------------------------------------------------------------------
{
_eventHandler = theEventHandler;
}
+
//------------------------------------------------------------------------------------------------------------
void wxVtkBaseView_SceneManager :: setWxVtkViewBase( wxVtkBaseView * theBaseView )
{
}
//------------------------------------------------------------------------------------------------------------
- void wxVtkBaseView_SceneManager :: removeSceneContours( )
+ void wxVtkBaseView_SceneManager::removeSceneContours()
{
std::map <std::string, ContourWrap_ViewControl *>::iterator iter = _sceneContours_ViewControl->begin();
int size = _sceneContours_ViewControl->size();
iter++;
}
_sceneContours_ViewControl->clear();
-
-
//Removing the selection rectangle to avoid showing when it's innecesary
_controlerSelectionROI->SetActive( false );
_viewerSelectionROI->RemoveCompleteContourActor();
int GetImageDataSizeZ();
void GetImageDataRange( double *range );
- void SetWidthContour(double width);
+ void SetWidthContour(double width);
//JCP 21 - 09 - 08
bool isEditableCControler(std::string theKeyName);
// Attributtes
//------------------------------------------------------------------------------------------------------------
- std::map<std::string, ContourWrap_ViewControl *> * _contours_ViewControl;
- std::map<std::string, ContourWrap_ViewControl *> * _sceneContours_ViewControl;
- wxVtkBaseView *_wxVtk_BaseView;
- wxEvtHandler *_eventHandler;
- ContourWrap_ViewControl *_lastInteraction;
- std::string _lastInteractionName;
- std::map<std::string, ContourWrap_ViewControl *> * _workingGroup;
- bool _creatingMULT_ROI;
- bool _editingROI;
- bool _toIncludeAtInteractionGroup;
- bool _waiting;
- bool _creatingROI;
- int _enventID;
- int _leftClickCount;
- int _rigthClickCount;
- int clickX;
- int clickY;
- char _lastKeyCode;
- long int onCharCallBackTimeEnd;
- long int onCharNeeded;
- bool _drawingSelectionROI;
- manualRoiControler *_controlerSelectionROI;
- manualViewRoi *_viewerSelectionROI;
- manualBaseModel *_modelSelectionROI;
- double _widthOfContour;
- double _widthOfControlPoint;
-
- bool _ctrlKey;
- bool _shiftKey;
+ std::map<std::string, ContourWrap_ViewControl *> *_contours_ViewControl;
+ std::map<std::string, ContourWrap_ViewControl *> *_sceneContours_ViewControl;
+ wxVtkBaseView *_wxVtk_BaseView;
+ wxEvtHandler *_eventHandler;
+ ContourWrap_ViewControl *_lastInteraction;
+ std::string _lastInteractionName;
+ std::map<std::string, ContourWrap_ViewControl *> *_workingGroup;
+ bool _creatingMULT_ROI;
+ bool _editingROI;
+ bool _toIncludeAtInteractionGroup;
+ bool _waiting;
+ bool _creatingROI;
+ int _enventID;
+ int _leftClickCount;
+ int _rigthClickCount;
+ int clickX;
+ int clickY;
+ char _lastKeyCode;
+ long int onCharCallBackTimeEnd;
+ long int onCharNeeded;
+ bool _drawingSelectionROI;
+ manualRoiControler *_controlerSelectionROI;
+ manualViewRoi *_viewerSelectionROI;
+ manualBaseModel *_modelSelectionROI;
+ double _widthOfContour;
+ double _widthOfControlPoint;
+ bool _ctrlKey;
+ bool _shiftKey;
};
#endif // __wxVtkBaseView_SceneManager_HEADER_FILE__