[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vtk-developers
Subject:    Re: [vtk-developers] New method fot vtkBoundingBox
From:       Will Schroeder <will.schroeder () kitware ! com>
Date:       2018-06-14 10:10:47
Message-ID: CAEiDrtWMq0Ew61BjGEne4KDy+tjVcNNpC6Oq_fhS98rabrA3Xg () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Patrick do you have a test available, I'd like to cover the code....

On Thu, Jun 14, 2018 at 5:25 AM Will Schroeder <will.schroeder@kitware.com>
wrote:

> 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@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@kitware.com
> http://www.kitware.com
> (518) 881-4902
>


-- 
William J. Schroeder, PhD
Kitware, Inc. - Building the World's Technical Computing Software
28 Corporate Drive
Clifton Park, NY 12065
will.schroeder@kitware.com
http://www.kitware.com
(518) 881-4902

[Attachment #5 (text/html)]

<div dir="ltr"><div class="gmail_default" \
style="font-family:verdana,sans-serif">Patrick do you have a test available, I&#39;d \
like to cover the code....</div></div><br><div class="gmail_quote"><div dir="ltr">On \
Thu, Jun 14, 2018 at 5:25 AM Will Schroeder &lt;<a \
href="mailto:will.schroeder@kitware.com">will.schroeder@kitware.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div \
class="gmail_default" style="font-family:verdana,sans-serif">I&#39;ll add it in. \
I&#39;ve got a large MR pending #4281 with some additions to \
vtkBoundingBox.</div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jun \
13, 2018 at 9:45 PM Patrick Bergeron &lt;<a href="mailto:pbergeron@spiria.com" \
target="_blank">pbergeron@spiria.com</a>&gt; wrote:<br></div><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">




<div dir="ltr">
<div id="m_7096637282647293033m_-3937733080824644592divtagdefaultwrapper" \
style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif" \
dir="ltr"> <p style="margin-top:0;margin-bottom:0">It&#39;s funny how sometimes you \
think a method exists, but doesn&#39;t (or I&#39;m not looking at the right \
spot?)</p> <p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">I&#39;m not currently registered for pushing \
submits to the git repo, would someone be kind enough to PR  this for me for \
inclusion?</p> <p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">I currently have this code as a helper \
function, but it would be nice if it would be in vtk...  </p> <p \
style="margin-top:0;margin-bottom:0">(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)</p> <p \
style="margin-top:0;margin-bottom:0"><br> </p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"></p>
<div>inline void vtkBoundingBox::GetCorner(int corner, double p[3]) const</div>
<div>{</div>
<div><span style="white-space:pre-wrap"></span>if ((corner &lt; 0) || (corner &gt; \
7))</div> <div><span style="white-space:pre-wrap"></span>{</div>
<div><span style="white-space:pre-wrap"></span>p[0] = VTK_DOUBLE_MAX;</div>
<div><span style="white-space:pre-wrap"></span>p[1] = VTK_DOUBLE_MAX;</div>
<div><span style="white-space:pre-wrap"></span>p[2] = VTK_DOUBLE_MAX;</div>
<div><span style="white-space:pre-wrap"></span>return; // out  of bounds</div>
<div><span style="white-space:pre-wrap"></span>}</div>
<div><br>
</div>
<div><span style="white-space:pre-wrap"></span>int ix = (corner &amp; 1)            ? \
1 : 0;   // 0,1,0,1,0,1,0,1</div> <div><span style="white-space:pre-wrap"></span>int \
iy = ((corner &gt;&gt; 1) &amp; 1) ? 1 : 0;   // 0,0,1,1,0,0,1,1</div> <div><span \
style="white-space:pre-wrap"></span>int iz = (corner &gt;&gt; 2)           ? 1 : 0;   \
// 0,0,0,0,1,1,1,1</div> <div><br>
</div>
<div><span style="white-space:pre-wrap"></span>const double* pts[2] = { \
this-&gt;MinPnt, this-&gt;MaxPnt };</div> <div><span \
style="white-space:pre-wrap"></span>p[0] = pts[ix][0];</div> <div><span \
style="white-space:pre-wrap"></span>p[1] = pts[iy][1];</div> <div><span \
style="white-space:pre-wrap"></span>p[2] = pts[iz][2];</div> <div>}</div>
<div><br>
</div>
<br>
<p></p>
<p style="margin-top:0;margin-bottom:0">Thank you !</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<div id="m_7096637282647293033m_-3937733080824644592Signature">
<div id="m_7096637282647293033m_-3937733080824644592divtagdefaultwrapper" dir="ltr" \
style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,&quot;Apple \
Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,NotoColorEmoji,&quot;Segoe UI \
Symbol&quot;,&quot;Android Emoji&quot;,EmojiSymbols"> <p></p>
</div>
</div>
</div>
</div>

_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" \
target="_blank">www.kitware.com</a><br> <br>
Visit other Kitware open-source projects at <a \
href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" \
target="_blank">http://www.kitware.com/opensource/opensource.html</a><br> <br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" \
rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtk-developers</a><br> \
<br> Follow this link to subscribe/unsubscribe:<br>
<a href="https://public.kitware.com/mailman/listinfo/vtk-developers" rel="noreferrer" \
target="_blank">https://public.kitware.com/mailman/listinfo/vtk-developers</a><br> \
<br> </blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" \
class="m_7096637282647293033gmail_signature" data-smartmail="gmail_signature"><div \
dir="ltr"><div>William J. Schroeder, PhD<br>Kitware, Inc. - Building the World&#39;s \
Technical Computing Software<br>28 Corporate Drive<br>Clifton Park, NY 12065<br><a \
href="mailto:will.schroeder@kitware.com" \
target="_blank">will.schroeder@kitware.com</a><br><a href="http://www.kitware.com" \
target="_blank">http://www.kitware.com</a><br>(518) 881-4902</div></div></div> \
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" \
class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>William \
J. Schroeder, PhD<br>Kitware, Inc. - Building the World&#39;s Technical Computing \
Software<br>28 Corporate Drive<br>Clifton Park, NY 12065<br><a \
href="mailto:will.schroeder@kitware.com" \
target="_blank">will.schroeder@kitware.com</a><br><a href="http://www.kitware.com" \
target="_blank">http://www.kitware.com</a><br>(518) 881-4902</div></div></div>



_______________________________________________
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



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic