[Paraview] Small bug creating Custom Reader

Mike Jackson mike.jackson at imts.us
Wed Nov 22 09:54:31 EST 2006


I _think_ I am.. Here is my RequestInformation Method.

int vtkParadisReader::RequestInformation(
   vtkInformation *vtkNotUsed(request),
   vtkInformationVector **vtkNotUsed(inputVector),
   vtkInformationVector *outputVector)
{
   int newFile = (vtkParadisReader::StringsEqual(this->FileName, this- 
 >CurrentFileName) == 0);
   vtkInformation* outInfo = outputVector->GetInformationObject(0);
   outInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_INDEX 
(), this->GetTimeStep() );
   if ( !newFile ) //The file has NOT changed
   {
     return 1;
   }
   if (NULL != FileOffsets) { // FileOffsets keeps some information  
about our file
       FileOffsets->UnRegister(this);
   }
   FileOffsets = vtkUnsignedLongLongArray::New();
   FileOffsets->SetNumberOfComponents(1);
   //File has changed OR file has Never been opened...
   this->SetCurrentFileName(this->GetFileName());
   //we want to walk the file and get all the timestep values and  
timestep indices
   if (NULL == this->reader) {  // Lazy instantiation of our helper  
class
     reader = vtkDislReaderLE::New();
   }
   reader->SetFileName(this->FileName);
   reader->SetFileOffsets(this->FileOffsets);
   reader->SetDebug(this->GetDebug());

   std::vector<double> timevalues; // Array to hold our time values
   vtkTypeUInt64 numTimesteps = 0;
  	
   reader->ExtractTimeInfo(timevalues, numTimesteps); // Gets the  
time Values from the file
   this->SetTimeStepRange(0, numTimesteps-1);
   outInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_STEPS(),
              &timevalues.front(),
              (vtkTypeUInt32)numTimesteps);
   return 1;
}

Did I miss something?

-- 
Mike Jackson   Senior Research Engineer
Innovative Management & Technology Services


On Nov 22, 2006, at 9:35 AM, Berk Geveci wrote:

> Is your reader reporting the number of timesteps in  
> RequestInformation() ?
>
> -berk
>
> On 11/21/06, Mike Jackson <mike.jackson at imts.us> wrote:
>> I am well on my way to completing a custom reader for Paraview. I  
>> have one last annoyance that I am trying to figure out.
>>    The problem occurs when my file is read initially. The number  
>> of timesteps that is reported is always 100 even though that is  
>> not correct. I noticed that the Ensight reader some how gets this  
>> setting correct.
>>   I was wondering what the secret variable or method to call is?  
>> This is the last bit I am trying to fix before I let this go to my  
>> customer.
>>   The strange thing is that if you click on the "Play" button in  
>> the animation controls the timesteps field and slider will  
>> suddenly report the correct number of timesteps. I am wondering if  
>> the problem is the order that I am calling methods?
>>
>> Any help would be appreciated.
>> --
>> Mike Jackson
>> IMTS
>>
>> _______________________________________________
>> ParaView mailing list
>> ParaView at paraview.org
>> http://www.paraview.org/mailman/listinfo/paraview
>>
>
>
> -- 
> Berk Geveci
> Kitware Inc.
> 28 Corporate Drive
> Clifton Park, NY, 12309




More information about the ParaView mailing list