]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourExtractData.cxx
no newline at end of file
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / Contour / ContourExtractData.cxx
index 974b1680c0bd83937490f92ac71dadefcd7dd8bb..10e04156dc251ce1914f30ecb440173da28a4e72 100644 (file)
@@ -34,7 +34,7 @@ void ContourExtractData::SetZtoBeAnalys( int z )
   }
 
 //------------------------------------------------------------------------
-  void ContourExtractData::SetLstManualContourModel( std::vector<manualContourModel*> lstManConMod)
+  void ContourExtractData::SetLstManualContourModel( std::vector<manualBaseModel*> lstManConMod)
   {
          this->lstManConMod = lstManConMod;
   }
@@ -43,12 +43,12 @@ void ContourExtractData::SetZtoBeAnalys( int z )
 //------------------------------------------------------------------------
 void ContourExtractData::GetMinMaxPoint(int *minPoint, 
                                                                                  int *maxPoint, 
-                                                                                 manualContourModel *manualcontourmodel
+                                                                                 manualBaseModel *manualcontourmodel
                                                                                  )
 {
        int i;
        //int   np              = manualcontourmodel->GetSizeLstPoints( );  // number of control points // JPRx
-
+               
 // JSTG 26-02-08 ---------------------------------------------------------------------------------------
        //int nps = manualviewbaseecontour->GetNumberOfPointsSpline(); // number of points in the spline
        int nps = manualcontourmodel->GetNumberOfPointsSpline(); // number of points in the spline
@@ -83,6 +83,7 @@ void ContourExtractData::GetMinMaxPoint_Of_LstManConMod(      int *minPoint,
 
 {
        int i,size = lstManConMod.size();
+
        for(i=0 ; i<size ; i++)
        {
                GetMinMaxPoint(minPoint,maxPoint,lstManConMod[i]);
@@ -197,27 +198,71 @@ bool ContourExtractData::isInside(int x, int y, int typeOperation)
                {
                        for (i=0;i<size;i++)
                        {
-                               numberLeft =  AnalisisContourInsideV2(x,y, i );
+                               // To process the statistics of the Points contour the procedure is different
+                               // RaC 19-09-09
+                               manualBaseModel *mbm = lstManConMod[i];
+                               if(mbm->GetTypeModel()==7)
+                               {
+                                       if(mbm->IsPoint(x,y)==true)
+                                       {
+                                               numberLeft=1;
+                                       }
+                               }//if
+                               else
+                               {
+                                       numberLeft =  AnalisisContourInsideV2(x,y, i );
+                               }//else
+
                                if ( (numberLeft % 2) ==1){         numberInside++;  }
                        }
                        if ( numberInside == (size) ){ result=true; }
                } // AND  Intersection
 
+               numberLeft=0;
 
                if (typeOperation==1)  // OR  All
                {
                        for (i=0;i<size;i++)
                        {
-                               numberLeft =  AnalisisContourInsideV2(x,y, i );
+                               // To process the statistics of the Points contour the procedure is different
+                               // RaC 19-09-09
+                               manualBaseModel *mbm = lstManConMod[i];
+                               if(mbm->GetTypeModel()==7)
+                               {
+                                       if(mbm->IsPoint(x,y)==true)
+                                       {
+                                               numberLeft=1;
+                                       }
+                               }//if
+                               else
+                               {
+                                       numberLeft =  AnalisisContourInsideV2(x,y, i );
+                               }//else
                                if ( (numberLeft % 2) ==1){ result=true;  }
                        }
                } // OR  All
 
+               numberLeft=0;
+
                if (typeOperation==2)  // XOR  crown
                {
                        for (i=0;i<size;i++)
                        {
-                               numberLeft = numberLeft + AnalisisContourInsideV2(x,y, i );
+                               // To process the statistics of the Points contour the procedure is different
+                               // RaC 19-09-09
+                               manualBaseModel *mbm = lstManConMod[i];
+                               if(mbm->GetTypeModel()==7)
+                               {
+                                       if(mbm->IsPoint(x,y)==true)
+                                       {
+                                               numberLeft=1;
+                                       }
+                               }//if
+                               else
+                               {
+                                       numberLeft =  numberLeft + AnalisisContourInsideV2(x,y, i );
+                               }//else
+                               
                        }
                        if ( numberLeft % 2 ==1){       result = true;  } 
                }// XOR  crown
@@ -425,7 +470,6 @@ void ContourExtractData::GetValuesInsideCrown(std::vector<double> *pLstValue,
                } // for
        } // for
 
-
 // Borrame
 //     if (this->okImagesResults==true){
 //             imagedataValueResult->Modified();
@@ -606,7 +650,7 @@ void ContourExtractData::Fill_lstlstlstVecXY(int iContour, int sizeY)
 {
        int i,y;
        double x1,y1,z1,x2,y2,z2;
-       manualContourModel *manualcontourmodel= lstManConMod[iContour]; 
+       manualBaseModel *manualcontourmodel= lstManConMod[iContour];    
        int nps = manualcontourmodel->GetNumberOfPointsSpline(); // number of points in the spline
        manualcontourmodel->UpdateSpline();
        //------------------------------------------------------------------------------------------------------