std::vector<int> instantVector;
_instantPanel->getInstant( instantVector );
+ //EED 2025-01-07
+ CleanContoursWithEmptyPoints();
+
+ //EED 2024-12-28
std::vector<std::string> lstOutlinesNames = kernelManager->getOutlinesNameAtInstant(instantVector);
int sizeLstOutlinesNames = lstOutlinesNames.size();
JCP 19 - 11 - 08*/
}
-void wxContourMainFrame :: deleteContours( std::vector<std::string> keyNamesVector )
+void wxContourMainFrame::deleteContours( std::vector<std::string> keyNamesVector )
{
int i,size=keyNamesVector.size();
for (i=0;i<size;i++)
} // for i
}
-void wxContourMainFrame :: deleteContour( std::string theKeyName )
+void wxContourMainFrame::deleteContour( std::string theKeyName )
{
/*
manualContourModel * cModel;
manualViewBaseContour * cViewer;
manualContourBaseControler * cControler;
-
ContourWrap_ViewControl *conwrapviewControl = _theViewPanel->getSceneManager()->getContourWrap_ViewControlOf( theKeyName );
cControler = conwrapviewControl->getControler();*/
-
+
//JCP 21 - 11 - 2008
bool isedit = _theViewPanel->isEditableCControler(theKeyName);
bool ispartofstaticlst = kernelManager->IsPartOfStaticList(theKeyName);
-
if (isedit && ispartofstaticlst)
{
_theViewPanel->removeFromScene(theKeyName);
-
kernelManager->deleteCModel(theKeyName);
//_theViewPanel->getSceneManager()->removeFromScene( theKeyName );
//cViewer = conwrapviewControl->getViewer();
void wxContourMainFrame::onDeleteContoursActSlice()
{
+ //EED 2025-01-07
+ CleanContoursWithEmptyPoints();
+
//JCP 20-10-08 Undo redo implementation
saveState();
//JCP 20-10-08 Undo redo implementation
-
std::vector<int> tempVector;
getInstantVector( tempVector );
deleteContours( getOutlinesName( tempVector[1] ) );
// deleteContours( (std::vector<std::string>)_theViewPanel->getSceneManager()->GetlstContoursNameActualSlice() );
}
-void wxContourMainFrame::onDeleteAllContours(){
+void wxContourMainFrame::CleanContoursWithEmptyPoints()
+{
+ std::vector<int> tempVector;
+ getInstantVector( tempVector );
+// std::vector<std::string> keyNamesVector = getOutlinesName( tempVector[1] );
+ std::vector<std::string> keyNamesVector = kernelManager->GetLstNameThings();
+ int i,size=keyNamesVector.size();
+ for ( i=0 ; i<size ; i++ )
+ {
+ manualBaseModel* manualModel = kernelManager->getOutlineByKeyName( keyNamesVector[i] );
+ if ( manualModel->GetSizeLstPoints()==0 )
+ {
+ deleteContour( keyNamesVector[i] );
+ } // if
+ } // for i
+}
+
+void wxContourMainFrame::onDeleteAllContours()
+{
//JCP 20-10-08 Undo redo implementation
saveState();
deleteAllContours();
}
-void wxContourMainFrame::deleteAllContours(){
+void wxContourMainFrame::deleteAllContours()
+{
//JCP 20-10-08 Undo redo implementation
-
wxBusyCursor wait;
std::vector<int> tempVector;
_instantPanel->getInstant( tempVector );
-
//JCP --08-09-2008 When using a diferent interface the _mbarrangeDeleteAll might not be initialize
// the values in GetStart and GetEnd will then not be initialize also.
// We use instead the values given when initializing the _deletepanel.
-
//int minZ = _mbarrangeDeleteAll->GetStart();
//int maxZ = _mbarrangeDeleteAll->GetEnd();
int minZ, maxZ;
-
minZ = 0;
maxZ = _theViewPanel->getSceneManager()->GetImageDataSizeZ();
-
//JCP --08-09-2008
-
_theViewPanel->getSceneManager()->removeSceneContours( );
_theViewPanel->getSceneManager()->removeAllOutlines();
kernelManager->removeAllOutlines();
//AD: 29-05-09
void wxContourMainFrame::saveFileWithContours( std::string filename )
{
-
+ //EED 2025-01-07
+ CleanContoursWithEmptyPoints();
+
FILE *pFile=fopen(filename.c_str(),"w+");
//CMRU 03-09-09-----------------------------------------------------------------------------------------------
void SetXY(int x,int y);
void ResetCamera();
- void SetMaxContoursByInstant(int max);
+ void CleanContoursWithEmptyPoints();
+ void SetMaxContoursByInstant(int max);
private:
//------------------------------------------------------------------------------------------------------------
// Private methods
//------------------------------------------------------------------------------------------------------------
-
//------------------------------------------------------------------------------------------------------------
// Attributtes
//------------------------------------------------------------------------------------------------------------
void saveState();
void loadState(std::string filename);
-
// void loadContours( FILE *pFile, bool staticContour );
-
void saveFileWithContours( std::string filename );
void onLoadContours(std::string fileNameContourROI, bool interactiveInterface);
void SetZForAllContours(int pz);
std::string _imageLocation;
std::string _fileLocation;
//------------------------------------------------------------------------------------------------------------
-
wxFrame *_frameShowResultImages;
-
//EED 2025-01-01
int _maxContoursByInstant;
-
};
#endif
_lastInteraction->getControler()->SetActive( false );
this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
}
+
manualContourBaseControler *manContourControl;
manualViewBaseContour *manViewerContour;
// Creating the view manualViewContour and the manualContourControler
manViewerContour = new manualViewContour();
}
- _lastInteraction = insertWrap( theKeyName, manContourControl, manViewerContour );
- _lastInteractionName = theKeyName;
- //Configuring the relations between the contour members representation
+ _lastInteraction = insertWrap( theKeyName, manContourControl, manViewerContour );
+ _lastInteractionName = theKeyName;
+ //Configuring the relations between the contour members representation
manViewerContour->SetModel( manModelContour );
manViewerContour->SetWxVtkBaseView( _wxVtk_BaseView );
manViewerContour->SetRange( _widthOfControlPoint );
manContourControl->CreateNewManualContour();
manViewerContour->RefreshContour();
addToScene( theKeyName );
- }
+}
+
//------------------------------------------------------------------------------------------------------------
void wxVtkBaseView_SceneManager :: configureSelectionROI( double * spc )
{