[vtk-developers] Tests failing on Borland builds
    Sebastien BARRE 
    sebastien at barre.nom.fr
       
    Mon Dec  8 15:38:55 EST 2003
    
    
  
At 12/8/2003 03:20 PM, Ken Martin wrote:
>I can live with FLOAT_MAX or honestly -1 1 just as well. The only thing to
>be careful of is that some codes look at the values to determine if they are
>initialized. So if the initialization of the bounds is changed to FLOAT_MAX
>the matching code must also be changed to consider FLOAT_MAX as the
>uninitialized value.
Yes but you really don't want to do that, it's kind of sad to rely on 
hard-coded values and duplicate them all over, it's bad practice. If Ken 
was here, he would be angry abo... oh wait, who posted that ? :)
Maybe we could add a predicate method:
         int AreBoundsInitialized();
and a symmetric method to unintialize bounds:
         void UnitializeBounds();
By doing so, we would encapsulate those hard-coded values in only one 
specific place.
Or eventually make those methods static in vtkMath and pass an array of 
something representing the bounds to test or uninitialize, in case you just 
want to have a local variable "bounds"  and unitialize it, say:
int vtkMath::AreBoundsInitialized(double bounds[6]);
int vtkMath::UnInitializeBounds(double bounds[6]);
    
    
More information about the vtk-developers
mailing list