: wxPanel(parent, id, pos, size, style)
{
m_mgr.SetManagedWindow(this);
+ _maxContoursByInstant = 1000;
_contourGroup = 1;
_creatingContoursActive = false;
_theViewPanel = NULL;
}
wxContourMainFrame* wxContourMainFrame::getInstance(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style,std::string datadir )
- {
+{
if(instance == NULL)
{
instance=new wxContourMainFrame(parent, id, title, pos, size, images, style,datadir);
}
return instance;
- }
+}
std::vector<vtkImageData*> wxContourMainFrame::getVectImages()
- {
+{
return kernelManager->getVectImages();
- }
+}
wxContourMainFrame* wxContourMainFrame::getInstance()
- {
+{
return instance;
- }
+}
void wxContourMainFrame::resetInstance()
- {
+{
instance->Destroy();
- }
+}
wxContourMainFrame::~wxContourMainFrame()
- {
+{
delete _contourextractdata;
deleteAllContours();
_pannew->Close();
//EED???? delete _buttonsBar;
//EED???? delete _actualInstant;
//EED???? delete _sceneManager;
- }
-
+}
//------------------------------------------------------------------------------------------------------------
// Creational and initialization methods using WxAui
return noteBook;
}
-
//------------------------------------------------------------------------------------------------------------
// Creational and initialization methods
//------------------------------------------------------------------------------------------------------------
return configured;
}
-
bool wxContourMainFrame::addNewPanel(wxPanel* panel)
{
bool configured = panel!=NULL;
//------------------------------------------------------------------------------------------------------------
// Attributes getters and setters
//------------------------------------------------------------------------------------------------------------
-
-
-
void wxContourMainFrame :: setInstantChooserPanel( wxInstantChooserPanel * theInstantChooserPanel )
{
_instantPanel = theInstantChooserPanel;
// _listViewPanel = theListViewPanel;
// }
-
-
void wxContourMainFrame::onCreateContourSpline( ){
//JCP 20-10-08 Undo redo implementation
void wxContourMainFrame::createContour( int typeContour )
{
- //Creating the manualContourModel and including in the model
- manualBaseModel * manModelContour = kernelManager->factoryManualContourModel(typeContour);
std::vector<int> instantVector;
_instantPanel->getInstant( instantVector );
- std::vector<int> tempVector;
- getInstantVector( tempVector );
- manModelContour->SetLabel2( std::to_string(tempVector[1]) );
+ std::vector<std::string> lstOutlinesNames = kernelManager->getOutlinesNameAtInstant(instantVector);
+ int sizeLstOutlinesNames = lstOutlinesNames.size();
- std::string theName = kernelManager->createOutline(manModelContour, instantVector);
- /*std::vector<int> instantVector;
- _instantPanel->getInstant( instantVector );
- std::string theName;
- theName= _modelManager->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
- //_sceneManager->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 , typeContour) ;
- } // if addedModel
+ if (sizeLstOutlinesNames < _maxContoursByInstant)
+ {
+
+ //Creating the manualContourModel and including in the model
+ manualBaseModel * manModelContour = kernelManager->factoryManualContourModel(typeContour);
+
+
+ std::vector<int> tempVector;
+ getInstantVector( tempVector );
+ manModelContour->SetLabel2( std::to_string(tempVector[1]) );
+
+ std::string theName = kernelManager->createOutline(manModelContour, instantVector);
+ /*std::vector<int> instantVector;
+ _instantPanel->getInstant( instantVector );
+ std::string theName;
+ theName= _modelManager->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
+ //_sceneManager->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 , typeContour) ;
+ } // if addedModel
+ } // if < maxContoursByInstant
}
-manualBaseModel * wxContourMainFrame::factoryManualContourModel(wxPanel* panel){
-
+manualBaseModel * wxContourMainFrame::factoryManualContourModel(wxPanel* panel)
+{
manualContourModelBullEye *manModelContourBullEye = new manualContourModelBullEye();
manualBaseModel *manModelContour=NULL;
manModelContour = manModelContourBullEye;
} // for iSector
} // for iCrown
} // if _panelBullEyeOptions
-
return manModelContour;
}
for (i=0;i<size;i++)
{
deleteContour( keyNamesVector[i] );
- }
+ } // for i
}
void wxContourMainFrame :: deleteContour( std::string theKeyName )
getInstantVector( tempVector );
deleteContours( getOutlinesName( tempVector[1] ) );
// deleteContours( (std::vector<std::string>)_theViewPanel->getSceneManager()->GetlstContoursNameActualSlice() );
-
}
+
void wxContourMainFrame::onDeleteAllContours(){
//JCP 20-10-08 Undo redo implementation
saveState();
deleteAllContours();
}
+
void wxContourMainFrame::deleteAllContours(){
//JCP 20-10-08 Undo redo implementation
_instantPanel->setConceptValue(name, value);
}
-
ConceptDataWrap* wxContourMainFrame::getLastConceptData()
{
return _instantPanel->getLastConceptData();
}
-
bool wxContourMainFrame::getIfConceptCheckedAt( std::string name, int pos )
{
return _instantPanel->getIfConceptCheckedAt( name, pos );
}
-
-
void wxContourMainFrame::ShowResultImages(int typeContourGroup, int selection, int minZ, int maxZ)
{
vtkImageData * mask;
wxPanel *panelViewer1 = new wxMaracas_N_ViewersWidget(noteBookViewerResult, value,&nTypeView);
wxPanel *panelViewer2 = new wxMaracas_N_ViewersWidget(noteBookViewerResult, mask,&nTypeView);
-
noteBookViewerResult->AddPage( panelViewer1, wxT("Image result") );
noteBookViewerResult->AddPage( panelViewer2, wxT("Mask result") );
m_mgr_noteBookViewerResult->Update();
} // if _frameShowResultImages
}
-
-
-
void wxContourMainFrame::changeInstant()
{
std::vector<int> instantVect;
updateInstantAxes();
}
-
-
void wxContourMainFrame::updateInstantOutlines()
{
_theViewPanel->removeSceneContours();
_theViewPanel->addNameWrapperToScene();
-
//for( int i=0; i<size; i++)
//{
// _theViewPanel->getSceneManager()->addToScene(namesWrapping[i]->getKeyName(), true, true, true, false, false );
GetWxVtkBaseView()->GetRenderer()->ResetCamera();
}
+void wxContourMainFrame::SetMaxContoursByInstant(int max)
+{
+ _maxContoursByInstant = max;
+}