Hi,<br>
<br>
I use vtkBoxWidget but this don't clip or cut the volume<br>
The Code is:<br>
<br>
#include &quot;vtkActor.h&quot;<br>
#include &quot;vtkCamera.h&quot;<br>
#include &quot;vtkClipPolyData.h&quot;<br>
#include &quot;vtkDebugLeaks.h&quot;<br>
#include &quot;vtkPlanes.h&quot;<br>
#include &quot;vtkPolyDataMapper.h&quot;<br>
#include &quot;vtkProperty.h&quot;<br>
#include &quot;vtkRegressionTestImage.h&quot;<br>
#include &quot;vtkRenderWindow.h&quot;<br>
#include &quot;vtkRenderWindowInteractor.h&quot;<br>
#include &quot;vtkRenderer.h&quot;<br>
#include &quot;vtkBoxWidget.h&quot;<br>
#include &quot;vtkSphereSource.h&quot;<br>
#include &quot;vtkConeSource.h&quot;<br>
#include &quot;vtkGlyph3D.h&quot;<br>
#include &quot;vtkAppendPolyData.h&quot;<br>
#include &quot;vtkLODActor.h&quot;<br>
#include &quot;vtkCommand.h&quot;<br>
<br>
class vtkMyCallback : public vtkCommand<br>
{<br>
public:<br>
&nbsp; vtkPlanes *planes;<br>
&nbsp; vtkActor *a;&nbsp;&nbsp;&nbsp; <br>
&nbsp; void SetPlane(vtkPlanes * planes)<br>
&nbsp; {<br>
&nbsp;&nbsp;&nbsp; this-&gt;planes=planes;<br>
&nbsp; }<br>
<br>
&nbsp; void SetActor(vtkActor * a)<br>
&nbsp; {<br>
&nbsp;&nbsp;&nbsp; this-&gt;a=a;<br>
&nbsp; }<br>
&nbsp; static vtkMyCallback *New() <br>
&nbsp;&nbsp;&nbsp; { return new vtkMyCallback; }<br>
&nbsp; void Delete()<br>
&nbsp;&nbsp;&nbsp; { delete this; }<br>
&nbsp; virtual void Execute(vtkObject *caller, unsigned long, void*)<br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkBoxWidget *widget = reinterpret_cast&lt;vtkBoxWidget*&gt;(caller);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //widget-&gt;GetTransform(t);<br>
&nbsp;&nbsp;&nbsp; &nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; widget-&gt;GetPlanes(planes);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; this-&gt;a-&gt;VisibilityOn();<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //widget-&gt;GetProp3D()-&gt;SetUserTransform(t);<br>
&nbsp;&nbsp;&nbsp; }<br>
};<br>
<br>
<br>
<br>
void main()<br>
{<br>
// Create a mace out of filters.<br>
vtkSphereSource *sphere = vtkSphereSource::New();<br>
vtkConeSource *cone = vtkConeSource::New();<br>
vtkGlyph3D *glyph = vtkGlyph3D::New();<br>
&nbsp; glyph-&gt;SetInput((vtkDataSet *)sphere-&gt;GetOutput());<br>
&nbsp; glyph-&gt;SetSource(cone-&gt;GetOutput());<br>
&nbsp; glyph-&gt;SetVectorModeToUseNormal();<br>
&nbsp; glyph-&gt;SetScaleModeToScaleByVector();<br>
&nbsp; glyph-&gt;SetScaleFactor(0.25);<br>
<br>
// The sphere and spikes are appended into a single polydata. This just<br>
// makes things simpler to manage.<br>
vtkAppendPolyData *apd = vtkAppendPolyData::New();<br>
&nbsp; apd-&gt;AddInput(glyph-&gt;GetOutput());<br>
&nbsp; apd-&gt;AddInput(sphere-&gt;GetOutput());<br>
vtkPolyDataMapper *maceMapper = vtkPolyDataMapper::New();<br>
&nbsp; maceMapper-&gt;SetInput(apd-&gt;GetOutput());<br>
vtkLODActor *maceActor = vtkLODActor::New();<br>
&nbsp; maceActor-&gt;SetMapper(maceMapper);<br>
&nbsp; maceActor-&gt;VisibilityOn();<br>
<br>
// This portion of the code clips the mace with the vtkPlanes implicit<br>
// function.&nbsp; The clipped region is colored green.<br>
vtkPlanes *planes = vtkPlanes::New();<br>
vtkClipPolyData *clipper = vtkClipPolyData::New();<br>
&nbsp; clipper-&gt;SetInput(apd-&gt;GetOutput());<br>
&nbsp; clipper-&gt;SetClipFunction(planes);<br>
&nbsp; clipper-&gt;InsideOutOff();&nbsp; <br>
&nbsp; <br>
vtkPolyDataMapper *selectMapper = vtkPolyDataMapper::New();<br>
<br>
&nbsp;&nbsp; selectMapper-&gt;SetInput(clipper-&gt;GetOutput());<br>
&nbsp;&nbsp; selectMapper-&gt;CroppingOn();<br>
vtkLODActor *selectActor = vtkLODActor::New();<br>
&nbsp; selectActor-&gt;SetMapper(selectMapper);<br>
&nbsp; selectActor-&gt;GetProperty()-&gt;SetColor(0, 1, 0);<br>
&nbsp; selectActor-&gt;VisibilityOff();<br>
&nbsp; selectActor-&gt;SetScale(1.01, 1.01, 1.01);<br>
<br>
// Create the RenderWindow, Renderer and both Actors<br>
vtkRenderer *ren = vtkRenderer::New();<br>
vtkRenderWindow *renWin = vtkRenderWindow::New();<br>
&nbsp; renWin-&gt;AddRenderer(ren);<br>
<br>
vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();<br>
&nbsp; iren-&gt;SetRenderWindow(renWin);<br>
<br>
// The SetInteractor method is how 3D widgets are associated with the<br>
// render window interactor.&nbsp; Internally, SetInteractor sets up a bunch<br>
// of callbacks using the Command/Observer mechanism (AddObserver()).<br>
vtkBoxWidget *boxWidget = vtkBoxWidget::New();<br>
&nbsp; boxWidget-&gt;SetInteractor(iren);<br>
&nbsp; boxWidget-&gt;SetPlaceFactor(1.25);<br>
<br>
&nbsp; ren-&gt;AddActor(maceActor);<br>
&nbsp; ren-&gt;AddActor(selectActor);<br>
<br>
// Add the actors to the renderer, set the background and size<br>
&nbsp; ren-&gt;SetBackground(0.1, 0.2, 0.4);<br>
&nbsp; renWin-&gt;SetSize(300, 300);<br>
<br>
// This callback funciton does the actual work: updates the vtkPlanes<br>
// implicit function.&nbsp; This in turn causes the pipeline to update.<br>
/*de&lt;f SelectPolygons(object, event):<br>
&nbsp;&nbsp;&nbsp; // object will be the boxWidget<br>
&nbsp;&nbsp;&nbsp; global selectActor, planes<br>
&nbsp;&nbsp;&nbsp; object.GetPlanes(planes)<br>
&nbsp;&nbsp;&nbsp; selectActor.VisibilityOn()*/<br>
<br>
// Place the interactor initially. The input to a 3D widget is used to<br>
// initially position and scale the widget. The &quot;EndInteractionEvent&quot; is<br>
// observed which invokes the SelectPolygons callback.<br>
&nbsp; boxWidget-&gt;SetInput((vtkDataSet *)glyph-&gt;GetOutput());<br>
&nbsp; boxWidget-&gt;PlaceWidget();<br>
&nbsp; vtkMyCallback *callback = vtkMyCallback::New(); <br>
&nbsp; callback-&gt;SetActor(selectActor);<br>
&nbsp; callback-&gt;SetPlane(planes);<br>
&nbsp; boxWidget-&gt;AddObserver(vtkCommand::InteractionEvent, callback);<br>
<br>
&nbsp; iren-&gt;Initialize();<br>
&nbsp; renWin-&gt;Render();<br>
&nbsp; iren-&gt;Start();<br>
}<br><br><div><span class="gmail_quote">2005/11/28, Darshan Pai &lt;<a href="mailto:darshanpai@gmail.com">darshanpai@gmail.com</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Try Using vtkPlaneWidget .. Should Work<br><br>
<div><div><span class="e" id="q_107d8ca38ba739a9_1"><span class="gmail_quote">On 11/25/05, <b class="gmail_sendername">Diego Parada</b> &lt;<a href="mailto:icebishop@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
icebishop@gmail.com</a>&gt; wrote:</span>
</span></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;"><div><span class="e" id="q_107d8ca38ba739a9_3">Hi,<br><br>How i can do the cutter that appears in the image attach?
<br clear="all"><span><br>-- 
<br>Diego Armando Parada Cuervo<br>Estudiante de Ingeniería de Sistemas y Computación<br>Universidad Pedagógica y Tecnológica de Colombia </span><br></span></div>_______________________________________________<br>This is the private VTK discussion list.
<br>Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.vtk.org/Wiki/VTK_FAQ</a><br>Follow this link to subscribe/unsubscribe:
<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.vtk.org/mailman/listinfo/vtkusers</a><br><br><br><br clear="all"></blockquote></div>

<br>

</blockquote></div><br><br clear="all"><br>-- <br>Diego Armando Parada Cuervo<br>Estudiante de Ingeniería de Sistemas y Computación<br>Universidad Pedagógica y Tecnológica de Colombia