Bertwim, I'm not sure that the volume renderer can handle VTK_HEXAHEDRON elements. Try the "Tetrahedralize" filter on your source and see if the Volume representation works.
Thanks, Cory On Mon, Oct 13, 2014 at 10:19 AM, B.W.H. van Beest <[email protected]> wrote: > Hi, > > I'm struggling to get a proper 3D view of my model system (yes, > embarrassing!) > but must admit my defeat. > After stripping almost everything, keeping the minimum to exhibit the > issue, > I'm left with the following: > > I have created a simple box source. To get a 3D representation, I > sub-classed > the code for this Source from vtkUnstructuredGridAlgorithm. > > In the RequestData method, I define the 8 point of the unit cube. I > added the points to the > underlying unstructed grid, and I specified the cell topology. > > This all seems to work: when instantiating this box Source, I *do* get the > expected cube in the representations (Surface, wireframe, Points). > > However, when I select the "Volume" representation, *the image disappears* > What am I doing wrong? > > As the code is not too long and very simple, I take the freedom to paste > it below. > > Kind regards. > Bertwim > > ========================================= > > int sphBoxSourceC::RequestData( vtkInformation *vtkNotUsed(request), > vtkInformationVector > **vtkNotUsed(inputVector), > vtkInformationVector *outputVector) > { > // Get the info object > vtkInformation *outInfo = outputVector->GetInformationObject(0); > vtkUnstructuredGrid *umesh = vtkUnstructuredGrid::SafeDownCast( > outInfo->Get( vtkDataObject::DATA_OBJECT() ) ); > > // Pre-allocate some memory > umesh->Allocate( 1024 ); > > // Specify points. > double r0[] = { 0.0, 0.0, 0.0 }; > double r1[] = { 1.0, 0.0, 0.0 }; > double r2[] = { 0.0, 1.0, 0.0 }; > double r3[] = { 1.0, 1.0, 0.0 }; > double r4[] = { 0.0, 0.0, 1.0 }; > double r5[] = { 1.0, 0.0, 1.0 }; > double r6[] = { 0.0, 1.0, 1.0 }; > double r7[] = { 1.0, 1.0, 1.0 }; > > // Collect the points in a vtk data structures. > { > vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New(); > points->SetDataType( VTK_DOUBLE ); > > points->InsertNextPoint( r0 ); > points->InsertNextPoint( r1 ); > points->InsertNextPoint( r2 ); > points->InsertNextPoint( r3 ); > points->InsertNextPoint( r4 ); > points->InsertNextPoint( r5 ); > points->InsertNextPoint( r6 ); > points->InsertNextPoint( r7 ); > > // Transfer points to umesh. > umesh->SetPoints( points ); > } > > // Cell Topology > vtkIdType vtx[8] = { 0, 1, 3, 2, 4, 5, 7, 6 }; > umesh->InsertNextCell( VTK_HEXAHEDRON, 8, vtx ); > > return 1; > } > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the ParaView Wiki at: > http://paraview.org/Wiki/ParaView > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/paraview _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview
