[vtkusers] DATA_NOT_GENERATED() and multiple executions

Matt McCormick mmmccormick at wisc.edu
Thu Sep 11 20:06:02 EDT 2008


Hi vtkers,

I am writing a multiple output port reader algorithm.

I am catching the vtkDemandDrivenPipeline::REQUEST_DATA_NOT_GENERATED()

and acting on it with 
...
vtkInformation* outInfo->Set( vtkDemandDrivenPipeline::DATA_NOT_GENERATED(), 	
1);
on some ports.
...

However, this is causing problems because the reader is getting a 
RequestData() every time the pipeline gets an Update().

47 //----------------------------------------------------------------------------                                                                                                                    
 48 void vtkInformationIntegerKey::Set(vtkInformation* info, int value)                                                                                                                                
49 {                                                                                                                                                                                                  
50   if(vtkInformationIntegerValue* oldv =                                                                                                                                                            
51      static_cast<vtkInformationIntegerValue *>                                                                                                                                                     
52      (this->GetAsObjectBase(info)))                                                                                                                                                               
 53     {                                                                                                                                                                                              
54     // Replace the existing value.                                                                                                                                                                 
55     oldv->Value = value;                                                                                                                                                                           
56     // Since this sets a value without call SetAsObjectBase(),                                                                                                                                     
57     // the info has to be modified here (instead of                                                                                                                                               
 58     // vtkInformation::SetAsObjectBase()                                                                                                                                                           
59     info->Modified();                                                                                                                                                                              
60    }                                                                                                                                                                                               
61   else                                                                                                                                                                                             
62     {                                                                                                                                                                                             
 63     // Allocate a new value.                                                                                                                                                                       
64     vtkInformationIntegerValue* v = new vtkInformationIntegerValue;                                                                                                                                
65     this->ConstructClass("vtkInformationIntegerValue");                                                                                                                                            
66     v->Value = value;                                                                                                                                                                              
67     this->SetAsObjectBase(info, v);                                                                                                                                                               
 68     v->Delete();                                                                                                                                                                                   
69     }                                                                                                                                                                                              
70 }                                                                                                                                                                                                  
71   

I think the info->Modified() is causing the issue.  Is this a bug in the 
Executive?  Is there a way I could work around this by calling 
this->Modified() somewhere else?    There seems to be no methods for setting 
the MTime back.

BTW, using vtk 5.2 with a algorithm that inherits from vtkMedicalImageReader2 
and has a vtkStreamingDemandDrivenPipeline executive.

Thanks.



More information about the vtkusers mailing list