]> Creatis software - creaContours.git/blobdiff - lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx
no message
[creaContours.git] / lib / Interface_ManagerContour_NDimensions / wxContourMainFrame.cxx
index 7017b47744d204e1472a795fb877356bad65c384..0b9b0093ca848863a0138a948bc5c5e52e9132bc 100644 (file)
@@ -835,10 +835,10 @@ void wxContourMainFrame :: createMirrorContourOf ( std::string anExistingKName,
 
 //EED04
 void wxContourMainFrame ::loadState(std::string filename){
-       
+
        deleteAllContours();
        onLoadContours(filename,false);
-       
+
        /* EED Borrame
        char tmp[255];
        FILE *pFile=fopen(filename.c_str(),"r+");
@@ -997,7 +997,7 @@ void wxContourMainFrame::onLoadContours(std::string fileNameContourROI, bool int
                        openContours(pFile,pFileData,false);
                        openContours(pFile,pFileData,true);     //Load StaticContours
                }
-               
+
                if (version=="1.0.2")
                {
 //EED001
@@ -1224,7 +1224,7 @@ void wxContourMainFrame::readDimSpc(FILE *pFile, bool interactiveOption)
                        dial->ShowModal();
 
                        int _tmpReadFileTypeOfTransformation = -1;
-                       bool transform = false;
+//EED                  bool transform = false;
 
                        if (dial->GetReturnCode() == wxID_OK)
                        {
@@ -2300,32 +2300,83 @@ void wxContourMainFrame::onChangeInstant(std::string name,int actual){
        _instantPanel->setConceptValue( name, actual );
 }
 
+
 void wxContourMainFrame::resetAppend(){
        kernelManager->resetAppend();
 
 }
 
+
 void wxContourMainFrame::onSpreadAdd(){
        std::vector<double> vecX;
        std::vector<double> vecY;
        std::vector<double> vecZ;
        _theViewPanel->GetPointsOfActualContour(&vecX , &vecY , &vecZ );
+       std::vector<int> tempVector;
+       _instantPanel->getInstant( tempVector );
+       std::string val = kernelManager->onSpreadAdd(&vecX , &vecY , &vecZ, tempVector);
+       interfMainPanel::getInstance()->appendStringSpread(val);
+}
+
+
+void wxContourMainFrame::onSpreadAddAll(){
+    printf("EED wxContourMainFrame::onSpreadAddAll \n");
+//EED02
 
        std::vector<int> tempVector;
        _instantPanel->getInstant( tempVector );
 
-       std::string val = kernelManager->onSpreadAdd(&vecX , &vecY , &vecZ, tempVector);
+       int minZ,maxZ;
+    minZ       = 0;
+    maxZ       = interfMainPanel::getInstance()->GetImageDataSizeZ();
 
-       interfMainPanel::getInstance()->appendStringSpread(val);
+       int z;
+       int sizeLstContourThings;
+
+       for ( z=minZ ; z<=maxZ ; z++ )
+       {
+               tempVector[1]=z;
+               Instant instant(&tempVector);
+               std::vector<ContourThing**> lstContourThings = kernelManager->getOutlinesAtInstant( &instant );
+               sizeLstContourThings = lstContourThings.size();
+
+               printf("EED wxContourMainFrame::onSpreadAddAll z=%d size=%d\n",z,sizeLstContourThings);
+
+               if (sizeLstContourThings>=1)
+        {
+
+            std::vector<double> vecX;
+            std::vector<double> vecY;
+            std::vector<double> vecZ;
+
+            ContourThing **contourthing = lstContourThings[0];
+                       manualBaseModel *cModel                         =  (*contourthing)->getModel();
+                       int i,size = cModel->GetNumberOfPointsSpline();
+                       double x,y,z;
+                       for (i=0; i<size; i++)
+                       {
+                               cModel->GetSpline_i_Point(i, &x, &y, &z);
+                               vecX.push_back(x);
+                               vecY.push_back(y);
+                               vecZ.push_back(z);
+                       }
+
+            std::string val = kernelManager->onSpreadAdd(&vecX , &vecY , &vecZ, tempVector);
+            interfMainPanel::getInstance()->appendStringSpread(val);
+
+               printf("EED wxContourMainFrame::onSpreadAddAll       ->  val=%s\n",val.c_str() );
+
+        }
+
+    }
 
 }
 
-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
-
        wxBusyCursor wait;
        std::vector<double> vecCtrlPointX;
        std::vector<double> vecCtrlPointY;