]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/LogicalColorBar.cxx
open dialog y ya funciona el NV
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / pPlotter / LogicalColorBar.cxx
index d94b7560abb78d3b44b0bb4d4ffc648d8d3219d2..feaf8f776dda817359931a00d4aa963b474f13af 100644 (file)
                        {
                                logicColorPoints.push_back(newColorPoint);
                                addedPoint = true;
-                       }
-                       for ( iter = logicColorPoints.begin(); i<=maxIndex && !addedPoint; iter++ )
-                       {
-                               nextIter = iter;
-                               int before = (*iter)->getRealX() ;
-                               if(before>xRealValue && i==0)
-                               {
-                                       //Is the first point
-                                       logicColorPoints.insert( iter, newColorPoint );
-                                       addedPoint =true;
-                                       lastAddedPoint = newColorPoint;
-                               }
-                               else if(before<xRealValue && i==maxIndex)
+                       }else{                          
+                               iter = logicColorPoints.begin();
+                               for (i=0; i<=maxIndex && !addedPoint; i++)
                                {
-                                       //Is the last point 
-                                       logicColorPoints.insert( iter+1, newColorPoint );       
-                                       addedPoint =true;
-                                       lastAddedPoint = newColorPoint;
-                               }
-                               else if(i<maxIndex)
-                               {
-                                       //
-                                       nextIter++;                     
-                                       int after = (*nextIter)->getRealX();                            
-                                       if( before < xRealValue && after> xRealValue)
+                                       nextIter = iter;
+                                       int before = (*iter)->getRealX() ;
+                                       if(before>xRealValue && i==0)
+                                       {
+                                               //Is the first point
+                                               logicColorPoints.insert( iter, newColorPoint );
+                                               addedPoint =true;
+                                               lastAddedPoint = newColorPoint;
+                                       }
+                                       else if(before<xRealValue && i==maxIndex)
                                        {
-                                               logicColorPoints.insert( nextIter, newColorPoint );     
+                                               //Is the last point 
+                                               logicColorPoints.push_back(newColorPoint );     
                                                addedPoint =true;
                                                lastAddedPoint = newColorPoint;
                                        }
-                               }                               
-                               i++;
-                       }               
+                                       else if(i<maxIndex)
+                                       {
+                                               //
+                                               nextIter++;                     
+                                               int after = (*nextIter)->getRealX();                            
+                                               if( before < xRealValue && after> xRealValue)
+                                               {
+                                                       logicColorPoints.insert( nextIter, newColorPoint );     
+                                                       addedPoint =true;
+                                                       lastAddedPoint = newColorPoint;
+                                               }
+                                       }               
+                                       //std::cout<<"JCPaddColorPoint iterator "<<*iter<<std::endl;
+                                       if(!addedPoint)
+                                               ++iter;
+                               }               
+                       }                       
                }
                return addedPoint;              
        }