[Paraview] vtkCompositeDataIterator and GoToFirstItem()

Adriano Gagliardi agagliardi at ara.co.uk
Wed Mar 31 12:12:20 EDT 2010


I'm using the vtkCompositeDataIterator to iterate over a multiblock data-set
multiple times. I'd like to reuse the iterator I create in the first
instance by using GoToFirstItem after it has finished the traversal, but I'm
getting a segmentation fault. Is this possible or am I doing this wrong?
Example code below:

      for ( vtkIdType i = 0; i != max; ++i ) {
	  vtkCompositeDataIterator* iter = test->NewIterator();
        iter->GoToFirstItem();
        for ( int j = 0; j != test->GetNumberOfBlocks(); ++j ) {
          //do something here
        }
        iter->GoToNextItem();
      }
      iter->Delete();

It works when the for loops are switched around. I'm just interested to see
what the performance difference is between them:

	vtkCompositeDataIterator* iter = test->NewIterator();
      iter->GoToFirstItem();
	for ( int j = 0; j != test->GetNumberOfBlocks(); ++j ) {
        for ( vtkIdType i = 0; i != max; ++i ) {
          //do something here
        }
        iter->GoToNextItem();
      }
      iter->Delete();

Cheers,

Adriano

===================================

Adriano Gagliardi MEng PhD
Business Sector Leader
Computational Aerodynamics
Aircraft Research Association Ltd.
Manton Lane
Bedford

Tel: 01234 32 4644
E-mail: agagliardi at ara.co.uk
Url: www.ara.co.uk 


---------------------------
This email contains information that is private and confidential and is intended only for the addressee.  If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender.
Note: All email sent to or from this address may be accessed by someone other than the recipient, for system management and security reasons.
Aircraft Research Association Ltd.  Registered in England, Registration No 503668 Registered Office: Manton Lane, Bedford MK41 7PF England VAT No GB 196351245




More information about the ParaView mailing list