I don't think these classes exist in the 4.4. Plus alot of stuff has changed between 4.4 & 5.0 (This isn't CVS head, it's the 5.0 Branch that's supposed to be pretty stable), that makes it pretty difficult for me to backport.
<br><br><div><span class="gmail_quote">On 12/28/05, <b class="gmail_sendername">Dominik Szczerba</b> <<a href="mailto:domi@vision.ee.ethz.ch">domi@vision.ee.ethz.ch</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Did you try with the "official" 4.4? I often have problems with the CVS<br>version.<br>--domi<br><br>Randall Hand wrote:<br>> I'm attempting to render an unstructured dataset that contains 1 vector<br>> field and 7 scalar fields. I want to map Color & Opacity to one of the 1
<br>> scalar fields (both to the same one) and volume render it. I can do this in<br>> Paraview easily (screenie attached), but my VTK code returns a blank black<br>> window everytime. Am I missing something here?
<br>><br>> I'm doing it all offscreen on an SGI Irix box (Onyx340) with the VTK<br>> 5.0Branch installed & MangledMesa. The code I'm using is below:<br>><br>> ==============================<br>> #include <
vtkColorTransferFunction.h ><br>> #include <vtkDataSetReader.h><br>> #include <vtkPiecewiseFunction.h><br>> #include <vtkUnstructuredGridVolumeRayCastMapper.h><br>> #include <vtkUnstructuredGrid.h
><br>> #include < vtkDataSet.h><br>> #include <vtkRenderWindow.h><br>> #include <vtkRenderer.h><br>> #include <vtkRenderLargeImage.h><br>> #include <vtkPNGWriter.h><br>> #include <
vtkVolumeProperty.h><br>> #include <vtkDataSetTriangleFilter.h ><br>> #include <vtkImagingFactory.h><br>> #include <vtkGraphicsFactory.h><br>> void main(void) {<br>> vtkGraphicsFactory *factGraphics = vtkGraphicsFactory::New();
<br>> factGraphics->SetUseMesaClasses(1);<br>> factGraphics->SetOffScreenOnlyMode(1);<br>> factGraphics->Delete();<br>> vtkImagingFactory *factImage = vtkImagingFactory::New();<br>> factImage->SetUseMesaClasses(1);
<br>> factImage->Delete();<br>> vtkDataSetReader *reader = vtkDataSetReader::New();<br>> reader->SetFileName("../VTK/step_127.vtk");<br>> reader->ReadAllScalarsOn();<br>><br>
> vtkDataSetTriangleFilter *tri = vtkDataSetTriangleFilter::New();<br>> tri->SetInput(reader->GetOutput());<br>><br>><br>> vtkColorTransferFunction *color = vtkColorTransferFunction::New();
<br>><br>> color->AddRGBPoint(250, 0, 0, 1);<br>> color->AddRGBPoint(450, 1, 0, 0);<br>> color->AddRGBPoint(2600, 1, 1, 0);<br>> color->AddRGBPoint(5000, 1, 1, 1);<br>><br>> vtkPiecewiseFunction *opacity = vtkPiecewiseFunction::New();
<br>> opacity->AddPoint(250, 0.1);<br>> opacity->AddPoint(450, 0.1);<br>> opacity->AddPoint(2600, 0.25);<br>> opacity->AddPoint(5000, 1.0);<br>><br>> vtkVolumeProperty *volProp = vtkVolumeProperty::New();
<br>> volProp->SetColor(color);<br>> volProp->SetScalarOpacity(opacity);<br>> volProp->SetInterpolationTypeToLinear();<br>><br>> vtkUnstructuredGridVolumeRayCastMapper *mapper =<br>
> vtkUnstructuredGridVolumeRayCastMapper::New();<br>> mapper->SetScalarModeToUsePointFieldData();<br>> mapper->SelectScalarArray("Temperature");<br>> mapper->SetInput(tri->GetOutput());
<br>><br>> vtkVolume *volume = vtkVolume::New();<br>> volume->SetMapper(mapper);<br>> volume->SetProperty(volProp);<br>> volume->Update();<br>> vtkRenderWindow *renWin = vtkRenderWindow::New();
<br>> vtkRenderer *ren1 = vtkRenderer::New();<br>> renWin->OffScreenRenderingOn();<br>> renWin->AddRenderer(ren1);<br>><br>> ren1->AddVolume(volume);<br>> ren1->ResetCamera();
<br>> renWin->SetSize(1024, 1024);<br>> renWin->Modified();<br>><br>> vtkRenderLargeImage *w2if = vtkRenderLargeImage::New();<br>> w2if->SetInput(ren1);<br>> w2if->SetMagnification(1);
<br>><br>> vtkPNGWriter *png = vtkPNGWriter::New();<br>> png->SetInput(w2if->GetOutput());<br>> png->SetFileName("output.png");<br>> png->Write();<br>> }<br>> ===============
<br>><br>><br>> --<br>> Randall Hand<br>> Visualization Scientist,<br>> ERDC-MSRC Vicksburg, MS<br>> Homepage: <a href="http://www.yeraze.com">http://www.yeraze.com</a><br>><br>><br>><br>> ------------------------------------------------------------------------
<br>><br>><br>> ------------------------------------------------------------------------<br>><br>> _______________________________________________<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">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">http://www.vtk.org/mailman/listinfo/vtkusers
</a><br><br>--<br>Dominik Szczerba, Dr.<br>Computer Vision Lab CH-8092 Zurich<br><a href="http://www.vision.ee.ethz.ch/~domi">http://www.vision.ee.ethz.ch/~domi</a><br></blockquote></div><br><br clear="all"><br>-- <br>Randall Hand
<br>Visualization Scientist, <br>ERDC-MSRC Vicksburg, MS<br>Homepage: <a href="http://www.yeraze.com">http://www.yeraze.com</a>