<br>I'm using a clipping example of GPURenderDemo, with a Box and a Callback, the boxWidget has only InsideOutOff() and InsideOutOn() options, and no one of then work like I want.<br><div class="gmail_quote">I'm doing anything wrong?<br>
<br>//---------------------------------------------------------------------------<br>
<br>class vtkBoxWidgetCallback : public vtkCommand<br>{<br>public:<br> static vtkBoxWidgetCallback *New()<br> { return new vtkBoxWidgetCallback; }<br> virtual void Execute(vtkObject *caller, unsigned long, void*)<br>
{<br> vtkBoxWidget *widget = reinterpret_cast<vtkBoxWidget*>(caller);<br> if (this->Mapper)<br> {<br> vtkPlanes *planes = vtkPlanes::New();<br> widget->GetPlanes(planes);<br>
this->Mapper->SetClippingPlanes(planes);<br> planes->Delete();<br> }<br> }<br><br> void SetMapper(vtkSmartVolumeMapper* m)<br> { this->Mapper = m; }<br><br>protected:<br> vtkBoxWidgetCallback()<br>
{ this->Mapper = 0; }<br><br> vtkSmartVolumeMapper *Mapper;<br>};<br><br>//---------------------------------------------------------------------------<br><br><br> vtkBoxWidget *box = vtkBoxWidget::New();<br>
<br> box->SetInteractor(vtkWindow1->GetInteractor());<br> box->SetPlaceFactor(1.01);<br> box->SetInput(mapperG->GetInput());<br> box->SetDefaultRenderer(vtkWindow1->GetRenderer());<br>
box->TranslationEnabledOn();<br> box->ScalingEnabledOn();<br> box->RotationEnabledOn();<br> box->PlaceWidget();<br> vtkPlanes *planes = vtkPlanes::New();<br> box->GetPlanes(planes);<br>
box->InsideOutOn();<br> mapperG->SetClippingPlanes(planes);<br> planes->Delete();<br> vtkBoxWidgetCallback *callback = vtkBoxWidgetCallback::New();<br> callback->SetMapper(mapperG);<br>
box->AddObserver(vtkCommand::InteractionEvent, callback);<br> callback->Delete();<br> box->EnabledOn();<br> box->GetSelectedFaceProperty()->SetOpacity(0.0);<div><div></div><div class="h5">
<br><br><br><div class="gmail_quote">
On Mon, Aug 9, 2010 at 9:53 PM, Sebastien Jourdain <span dir="ltr"><<a href="mailto:sebastien.jourdain@kitware.com" target="_blank">sebastien.jourdain@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
If you are using an implicit function for your selection, then you can<br>
use the Clip filter and just set the InsideOut value to 1.<br>
<br>
Seb<br>
<div><div></div><div><br>
On Mon, Aug 9, 2010 at 6:52 PM, Alessandro Martini<br>
<<a href="mailto:alessandromartini@gmail.com" target="_blank">alessandromartini@gmail.com</a>> wrote:<br>
> Hello All,<br>
><br>
> I need to do a inverted crop in a volume, mantain the content external to<br>
> box ( selection ) and hide the internal content, make any like a "hole".<br>
> What is the correct way? Have any example of this ?<br>
><br>
> Thank's,<br>
> --<br>
> Alessandro Martini<br>
> <a href="mailto:alessandromartini@gmail.com" target="_blank">alessandromartini@gmail.com</a><br>
> -------------------------------------------------<br>
> 'Existem 10 tipos de pessoas no mundo:<br>
> aquelem que entendem binário, e aqueles que não!'<br>
><br>
</div></div>> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
><br>
><br>
</blockquote></div><br><br clear="all"><br></div></div>-- <br><div><div></div><div class="h5">Alessandro Martini<br><a href="mailto:alessandromartini@gmail.com" target="_blank">alessandromartini@gmail.com</a><br>-------------------------------------------------<br>
'Existem 10 tipos de pessoas no mundo:<br>
aquelem que entendem binário, e aqueles que não!'<br>
</div></div></div><br><br clear="all"><br>-- <br>Alessandro Martini<br><a href="mailto:alessandromartini@gmail.com">alessandromartini@gmail.com</a><br>-------------------------------------------------<br>'Existem 10 tipos de pessoas no mundo:<br>
aquelem que entendem binário, e aqueles que não!'<br>