[Insight-users] Get-methods in itk::BoundingBox

Luis Ibanez luis.ibanez at kitware.com
Fri, 30 Jan 2004 19:16:59 -0500


Hi Ivo,

Thanks for pointing this out.

This was entered as Bug # 559
http://www.itk.org/Bug/bug.php?op=show&bugid=559&pos=0
and has now been fixed in CVS.


The following methods where changed

 >   bool ComputeBoundingBox(void) const;
 >   PointType GetCenter(void) const;
 >   PointType GetMinimum(void) const;
 >   PointType GetMaximum(void) const;
 >   AccumulateType GetDiagonalLength2(void) const;
 >   bool IsInside( const PointType & ) const;

and the ivars were made mutable:


 >   mutable  BoundsArrayType    m_Bounds;
 >   mutable  TimeStamp          m_BoundsMTime;


Please let us know if you find any further
problems,


    Thanks


       Luis



-----------------------
Ivo Wolf wrote:

> Hello,
> 
> most of the Get-methods of itk::BoundingBox are not const.
> 
> The reason is probably that they are calling ComputeBoundingBox(),
> which changes m_Bounds and therefore cannot be const
> (as long as m_Bounds is not defined mutable).
> 
> Two methods do not call ComputeBoundingBox():
> GetBounds (which is const and generated by a macro) and IsInside.
> 
> Is this deliberately so?
> 
> It would be nice to some const Get-methods (or at least keep GetBounds
> const), because otherwise the bounding-box can not be used in
> other const-methods.
> 
> Regards,
> 
> Ivo
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>