]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourModel.cpp
v1.0.3 BUG 1404
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / manualContour / manualContourModel.cpp
index 3a4353a63c671e4cd88d6f4f376a557d4cbed75c..f8369751bf63a9c61c893790852361d8776a308e 100644 (file)
@@ -31,6 +31,12 @@ manualContourModel::manualContourModel()
 
        _delta_JSTG                     = 0.0;
 //---------------------------------------------------------------------------------------------------------------
+
+//CMRU 17-08-09 -------------------------------------------------------------------------------------------------
+       _realSize                       = 0.0;
+       _label                          = "";
+//---------------------------------------------------------------------------------------------------------------
+
 }
 
 // ----------------------------------------------------------------------------
@@ -260,7 +266,6 @@ void manualContourModel::SetNumberOfPointsSpline(int size)
        _sizePointsContour = size;
 }
 
-
 // ----------------------------------------------------------------------------
 
 void manualContourModel::SetCloseContour(bool closeContour)
@@ -645,7 +650,36 @@ void manualContourModel::Save(FILE *ff) // virtual
                fprintf(ff,"%f %f %f\n", mp->GetX(), mp->GetY(), mp->GetZ() );
        }
 }
+//CMRU 03-09-09-----------------------------------------------------------------------------------------------
+void manualContourModel::SaveData(FILE *ff)
+{
+       std::string etiqueta = GetLabel();
+       if(etiqueta.empty())
+               fprintf(ff,"Label: NO_LABEL\n");
+       else
+               fprintf(ff,"Label: %s\n",etiqueta.c_str());
+       fprintf(ff,"Real_Size: %f\n",GetRealSize());
+}
+
+void manualContourModel::OpenData(FILE *ff)
+{
+       char tmp[255];
+
+       fscanf(ff,"%s",tmp); // Label:
+       fscanf(ff,"%s",tmp); // value
+       std::cout<<tmp<<std::endl;
+       //if(strcmp(tmp != "NO_LABEL") // JPR
+       if(strcmp(tmp,"NO_LABEL") != 0)
+               SetLabel(tmp);
+
+       fscanf(ff,"%s",tmp); // Real_size
+       fscanf(ff,"%s",tmp);// #
+
+       //tmp.ToDouble(&tmp);
+       SetRealSize(atof(tmp));
+}
 
+//------------------------------------------------------------------------------------------------------------
 
 // ---------------------------------------------------------------------------
 
@@ -672,9 +706,9 @@ void manualContourModel::AddManualPoint( manualPoint* theManualPoint )//private
        _lstPoints.push_back( theManualPoint );
 }
 
-std::vector<manualContourModel*> manualContourModel::ExploseModel(  )
+std::vector<manualBaseModel*> manualContourModel::ExploseModel(  )
 {
-       std::vector<manualContourModel*> lstTmp;
+       std::vector<manualBaseModel*> lstTmp;
        lstTmp.push_back(this);
        return lstTmp;
 }
@@ -695,3 +729,26 @@ void manualContourModel::Transform_Ax_Plus_B (double Ax, double Bx, double Ay, d
                mp->SetPointY( mp->GetY()*Ay + By );
        }
 }
+
+
+//CMRU 17-08-09----------------------------------------------------------------------------
+void manualContourModel::SetLabel(std::string newLabel)
+{
+       _label = newLabel;
+}
+
+void manualContourModel::SetRealSize(double newRealSize) 
+{
+       _realSize = newRealSize;
+}
+
+double manualContourModel::GetRealSize()
+{
+       return _realSize;
+}
+
+std::string manualContourModel::GetLabel()
+{
+       return _label;
+}
+//----------------------------------------------------------------------------