[vtk-developers] New method fot vtkBoundingBox

Will Schroeder will.schroeder at kitware.com
Thu Jun 14 05:25:46 EDT 2018


I'll add it in. I've got a large MR pending #4281 with some additions to
vtkBoundingBox.

On Wed, Jun 13, 2018 at 9:45 PM Patrick Bergeron <pbergeron at spiria.com>
wrote:

> It's funny how sometimes you think a method exists, but doesn't (or I'm
> not looking at the right spot?)
>
>
> I'm not currently registered for pushing submits to the git repo, would
> someone be kind enough to PR this for me for inclusion?
>
>
> I currently have this code as a helper function, but it would be nice if
> it would be in vtk...
>
> (I use this as a means to project all points of a bbox against a plane, so
> I need to iterate over all corners of the box)
>
>
>
> inline void vtkBoundingBox::GetCorner(int corner, double p[3]) const
> {
> if ((corner < 0) || (corner > 7))
> {
> p[0] = VTK_DOUBLE_MAX;
> p[1] = VTK_DOUBLE_MAX;
> p[2] = VTK_DOUBLE_MAX;
> return; // out of bounds
> }
>
> int ix = (corner & 1)        ? 1 : 0;  // 0,1,0,1,0,1,0,1
> int iy = ((corner >> 1) & 1) ? 1 : 0;  // 0,0,1,1,0,0,1,1
> int iz = (corner >> 2)       ? 1 : 0;  // 0,0,0,0,1,1,1,1
>
> const double* pts[2] = { this->MinPnt, this->MaxPnt };
> p[0] = pts[ix][0];
> p[1] = pts[iy][1];
> p[2] = pts[iz][2];
> }
>
>
> Thank you !
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>
> Follow this link to subscribe/unsubscribe:
> https://public.kitware.com/mailman/listinfo/vtk-developers
>
>

-- 
William J. Schroeder, PhD
Kitware, Inc. - Building the World's Technical Computing Software
28 Corporate Drive
Clifton Park, NY 12065
will.schroeder at kitware.com
http://www.kitware.com
(518) 881-4902
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtk-developers/attachments/20180614/82c98d13/attachment.html>


More information about the vtk-developers mailing list