<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Thank you David for your response.<br>
I had already took a look to TestPriorityStreaming in vtk and to
Paraview StreamingView code but i can't get it work...<br>
Here is a sample code I use for test, am I doing something wrong ?<br>
<br>
<br>
// Dummy clipper only used to set bounding box of pieces to read<br>
// Only ProcessRequest method is redefined<br>
<br>
class VtkClipDataSetExtend : public vtkClipDataSet<br>
{<br>
public:<br>
vtkTypeMacro(VtkClipDataSetExtend,vtkClipDataSet);<br>
<br>
static VtkClipDataSetExtend *New();<br>
<br>
<br>
protected:<br>
VtkClipDataSetExtend() {}<br>
virtual ~VtkClipDataSetExtend() {}<br>
<br>
int VtkClipDataSetExtend::ProcessRequest(vtkInformation*
request,<br>
vtkInformationVector** inputVector,<br>
vtkInformationVector* outputVector)<br>
{<br>
<br>
vtkInformation *outInfo =
outputVector->GetInformationObject(0);<br>
<br>
vtkStreamingDemandDrivenPipeline *sdd = <br>
vtkStreamingDemandDrivenPipeline::SafeDownCast(this->GetExecutive());<br>
<br>
if (sdd == NULL)<br>
{<br>
return -1;<br>
}<br>
<br>
// Bounds of pieces to read<br>
int extent[6];<br>
<br>
extent[0] = 0;<br>
extent[1] = 1;<br>
extent[2] = 0;<br>
extent[3] = 1;<br>
extent[4] = 0;<br>
extent[5] = 1;<br>
<br>
vtkDebugMacro(<<"SetUpdateExtent " <br>
<< extent[0] << " " << extent[1]
<< " " <br>
<< extent[2] << " " << extent[3]
<< " "<br>
<< extent[4] << " " << extent[5]
<< " ");<br>
<br>
// Set these bounds in pipeline<br>
sdd->SetUpdateExtent(outInfo, extent);<br>
<br>
<br>
<br>
return 1;<br>
}<br>
<br>
};<br>
<br>
vtkStandardNewMacro(VtkClipDataSetExtend);<br>
<br>
..........<br>
<br>
{<br>
..........<br>
//----------------------------------------------------------------------------------------------------//<br>
// writer<br>
// generate a pieces splitted image file <br>
if(writeFile)<br>
{<br>
vtkImageGridSource* const source =
vtkImageGridSource::New();<br>
source->SetDataScalarTypeToShort();<br>
source->SetFillValue((double)0xAAAA);<br>
source->SetDataExtent(0, DATASOURCESIZE-1, 0,
DATASOURCESIZE-1, 0, DATASOURCESIZE-1);<br>
<br>
// parallel image writer<br>
vtkSmartPointer<vtkXMLPImageDataWriter> writer =
vtkSmartPointer<vtkXMLPImageDataWriter>::New();<br>
<br>
// connect data source<br>
writer->SetInputConnection(source->GetOutputPort());<br>
source->Delete();<br>
<br>
// settings<br>
writer->SetFileName("PartShortVolume16.pvti");<br>
writer->SetNumberOfPieces(NUMPIECES);<br>
<br>
// range of pieces assigned to this writer<br>
writer->SetStartPiece(0);<br>
writer->SetEndPiece(NUMPIECES-1);<br>
<br>
// split xml ref / data<br>
writer->SetWriteSummaryFile(TRUE); <br>
<br>
// write<br>
writer->Update();<br>
writer->Write();<br>
}<br>
<br>
// reader<br>
vtkSmartPointer<vtkXMLPImageDataReader> reader =
vtkSmartPointer<vtkXMLPImageDataReader>::New();<br>
reader->SetFileName("PartShortVolume16.pvti");<br>
<br>
reader->ReleaseDataFlagOn();<br>
<br>
reader->DebugOn();<br>
<br>
// clipping<br>
vtkSmartPointer<VtkClipDataSetExtend> clipper =
vtkSmartPointer<VtkClipDataSetExtend>::New();<br>
vtkSmartPointer<vtkPlane> plane =
vtkSmartPointer<vtkPlane>::New();<br>
plane ->SetNormal(1.0,0.0,0.0);<br>
plane >SetOrigin(5.5,5.5,5.5);<br>
clipper ->SetClipFunction(plane);<br>
<br>
// pipeline connections<br>
vtkSmartPointer<vtkDataSetMapper> mapper =
vtkSmartPointer<vtkDataSetMapper>::New();<br>
clipper ->SetInputConnection(reader->GetOutputPort());<br>
mapper ->SetInputConnection(clipper
->GetOutputPort());<br>
<br>
// Send the request of update to the reader<br>
// The reader should only read pieces include in bounds
defined by extent set in clipper<br>
// But all pieces are loaded ... custom extent is not
retrieved by reader ?<br>
mapper->Update();<br>
}<br>
<br>
Is somewhere maybe a documentation explaining the mechanism of
pieces streaming and how to use it ? ...<br>
<br>
Thank you again !<br>
<br>
Le 08/06/2011 19:09, David E DeMarle a écrit :
<blockquote
cite="mid:BANLkTi=cf_x+DLJtfO7UaDmkSBCC+5ahzw@mail.gmail.com"
type="cite">Look in the ParaView source code under the
directory Plugins/StreamingView/VTK. That directory does not need
ParaView, ie you can compile it against a standalone VTK build.
The tests should be particularly helpful.
<div><br>
</div>
<div>I have not tried vtkXMLPImageDataReader so it might take some
work to use the files you have at hand. However,
vtkXMLImageDataReader (note the lack of P) does work with
streaming. Instead of separate files streaming takes advantage
of the little exercised sub pieces within a single vti file
feature to do what it needs to with this file format.</div>
<div><br>
</div>
<div>See VTK/Rendering/Testing/Cxx/TestPriorityStreaming for more
information.</div>
<div><br>
</div>
<div>David E DeMarle<br>
Kitware, Inc..<br>
R&D Engineer<br>
28 Corporate Drive<br>
Clifton Park, NY 12065-8662<br>
Phone: 518-371-3971 x109<br>
<br>
<br>
<div class="gmail_quote">2011/6/8 Frédéric Speisser <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:frederic.speisser@grooviz.com">frederic.speisser@grooviz.com</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
All,<br>
<br>
I have a data object stored in pvti format (splitted in
several pieces) and I would like to be able to stream only
pieces involved in rendering. This should be possible in
vtk, referring documentation.<br>
I use vtkStreamindDemandDrivenPipeline and
vtkStreamindDemandDrivenPipeline::UPDATE_EXTENT, but despite
the fact I set bounds defining only a little part of my
dataobject in update_extent key, the
reader(vtkXMLPImageDataReader) always loads all pieces...<br>
I have made plenty of tests but I'm not able to make this
mechanism working.<br>
<br>
I need some help/hints !<br>
<br>
Thank you<br>
<br>
_______________________________________________<br>
Powered by <a moz-do-not-send="true"
href="http://www.kitware.com" target="_blank">www.kitware..com</a><br>
<br>
Visit other Kitware open-source projects at <a
moz-do-not-send="true"
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: <a
moz-do-not-send="true"
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 moz-do-not-send="true"
href="http://www.vtk.org/mailman/listinfo/vtkusers"
target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote>
</div>
<br>
</div>
<hr noshade="noshade" size="1">
<p class="avgcert" color="#000000" align="left">Aucun virus trouvé
dans ce message.<br>
Analyse effectuée par AVG - <a moz-do-not-send="true"
href="http://www.avg.fr">www.avg.fr</a><br>
Version: 10.0.1382 / Base de données virale: 1511/3688 - Date:
08/06/2011</p>
</blockquote>
<br>
</body>
</html>