<html>
Hi Radim,<br><br>
To create multiple isosurfaces with a single instance of
vtkMarchingCubes, call the SetValue method of vtkMarchingCubes once per
isosurface with the value of that isosurface.<br><br>
Please take a look at the documentation (in the header files or on-line
VTK documentation) for vtkMarchingCubes (or other classes you are trying
to use) before posting questions like this to the vtkusers list.
You may be able to answer such questions on your own, and people on the
list are generally more willing to help if they can see that you've tried
to resolve the issue yourself first.<br><br>
- Amy<br><br>
At 04:01 PM 3/11/2003 +0100, Radim Kolár wrote:<br>
<blockquote type=cite class=cite cite><font face="arial" size=2>thanks.</font><br>
<font face="arial" size=2>I have another problem:) How to generate a
multiple isosurface with Marching cubes in one render
window?</font><br>
<font face="arial" size=2>thanks radim</font>
<dl>
<dd>----- Original Message -----
<dd>From:</b> <a href="mailto:amy.henderson@kitware.com">Amy
Henderson</a>
<dd>To:</b> <a href="mailto:kolarr@feec.vutbr.cz">Radim Kolář</a> ;
<a href="mailto:vtkusers@public.kitware.com">VTK</a>
<dd>Sent:</b> Tuesday, March 11, 2003 3:15 PM
<dd>Subject:</b> Re: [vtkusers] rendering a sphere problem<br><br>
<dd>The main reason this won't work is that vtkSphereSource produces
vtkPolyData output, not vtkImageData, so you can't volume render it in
VTK. You should use a vtkPolyDataMapper and a vtkActor to render
the output of vtkSphereSource instead.<br><br>
<dd>- Amy<br><br>
<dd>At 09:16 AM 3/11/2003 +0100, Radim Kolář
wrote:<blockquote type=cite class=cite cite><font face="arial" size=2>
<dd>Hi all,</font><font face="arial" size=2>
<dd>please could you help me with this simple
problem?</font><font face="arial" size=2>
<dd>I want to render the sphere with the vtkVolumeRayCastMapper. So I
create sphere, mapper, volume properties and finally vtkVolume and I
render it with vtkRenderWindowInteractor. But the program crash when I
call iren->Render(). Bellow is the short C++ code. Are there some
mistakes?</font><font face="arial" size=2>
<dd>I'm using VTK 4.0 and Borland C++
6</font><font face="arial" size=2>
<dd>Thanks a lot.</font><font face="arial" size=2>
<dd>Radim</font>
<dd> <font face="arial" size=2>
<dd>//---------------------------------------------------------------------------
<dd>#include "vtkSphereSource.h"
<dd>#include "vtkVolumeRayCastMapper.h"
<dd>#include "vtkActor.h"
<dd>#include "vtkRenderer.h"
<dd>#include "vtkRenderWindowInteractor.h"
<dd>#include "vtkRenderWindow.h"
<dd>#include "vtkVolumeRayCastMIPFunction.h"
<dd>#include "vtkImageData.h"
<dd>#include "vtkVolumeProperty.h"
<dd>#include "vtkPiecewiseFunction.h"</font>
<dd> <font face="arial" size=2>
<dd>#include <vcl.h>
<dd>#pragma hdrstop</font><font face="arial" size=2>
<dd>//---------------------------------------------------------------------------</font>
<dd> <font face="arial" size=2>
<dd>#pragma argsused
<dd>int main(int argc, char* argv[])
<dd>{
<dd> vtkSphereSource
*sphere; sphere =
vtkSphereSource::New();</font>
<dd> <font face="arial" size=2>
<dd>
vtkVolumeRayCastMIPFunction *RayCastMethod =
vtkVolumeRayCastMIPFunction::New();
<dd> vtkVolumeRayCastMapper
*mapper = vtkVolumeRayCastMapper::New();</font>
<dd> <font face="arial" size=2>
<dd>
mapper->SetVolumeRayCastFunction( RayCastMethod );</font>
<dd> <font face="arial" size=2>
<dd> vtkImageData
*vol; vol = vtkImageData::New();
<dd> vol->SetSource( sphere
);
<dd> mapper->SetInput( vol
);</font>
<dd> <font face="arial" size=2>
<dd> vtkColorTransferFunction *colorF =
vtkColorTransferFunction::New();
<dd> colorF->AddRGBSegment( 0, 0.0, 0.0, 0.0, 255,
0.5, 0.1, 1.0 );</font>
<dd> <font face="arial" size=2>
<dd> //-------- Mapping from scalar
-> opacity ------------
<dd> vtkPiecewiseFunction *opacityF = vtkPiecewiseFunction::New();
<dd> opacityF->AddPoint( 10, 0.1 );
<dd> opacityF->AddPoint( 200, 0.9 );
<dd> opacityF->ClampingOff();</font>
<dd> <font face="arial" size=2>
<dd>vtkVolumeProperty *volumeP = vtkVolumeProperty::New();
<dd> volumeP->SetColor( colorF );
<dd> volumeP->SetScalarOpacity( opacityF
);</font>
<dd> <font face="arial" size=2>
<dd> vtkVolume *volume = vtkVolume::New();
<dd> volume->SetMapper( mapper );
<dd> volume->SetProperty( volumeP );</font>
<dd> <font face="arial" size=2>
<dd>vtkRenderer *ren1; ren1 =
vtkRenderer::New();
<dd> ren1->AddProp( volume );
<dd>
<dd>vtkRenderWindow *renWin; renWin = vtkRenderWindow::New();
<dd> renWin->AddRenderer( ren1 );
<dd>
<dd>vtkRenderWindowInteractor *iren; iren =
vtkRenderWindowInteractor::New();
<dd> iren->SetRenderWindow( renWin );
<dd>
<dd>
iren->Render(); //here it crash
<dd> iren->Start();
<dd>
<dd> iren->Delete();
<dd> renWin->Delete();
<dd> ren1->Delete();
<dd>
RayCastMethod->Delete();
<dd> volume->Delete();
<dd> vol->Delete();
<dd> mapper->Delete();
<dd> sphere->Delete();
<dd>
<dd> return 0;
<dd>}
<dd>//---------------------------------------------------------------------------</font></blockquote>
</dl></blockquote><br>
</html>