Commit a7be0e24 authored by Ken Martin's avatar Ken Martin

updated collections

parent 8c8a3e20
......@@ -115,7 +115,7 @@ public:
vtkPushPipeline *PushPipeline;
};
vtkCxxRevisionMacro(vtkPushPipeline, "1.19");
vtkCxxRevisionMacro(vtkPushPipeline, "1.20");
vtkStandardNewMacro(vtkPushPipeline);
vtkPushPipeline::vtkPushPipeline()
......@@ -725,9 +725,9 @@ int vtkPushPipeline::IsRendererReady(vtkRenderer *ren)
// check for other props
vtkPropCollection *pc = ren->GetProps();
vtkProp *prop;
for (pc->InitTraversal(); (prop = pc->GetNextProp()) != NULL;)
vtkCollectionSimpleIterator pit;
for (pc->InitTraversal(pit); (prop = pc->GetNextProp(pit)) != NULL;)
{
// look for image actors
vtkImageActor *ia = vtkImageActor::SafeDownCast(prop);
if (ia)
......@@ -780,7 +780,8 @@ void vtkPushPipeline::ConsumeRendererInputs(vtkRenderer *ren)
// check for other props
vtkPropCollection *pc = ren->GetProps();
vtkProp *prop;
for (pc->InitTraversal(); (prop = pc->GetNextProp()) != NULL;)
vtkCollectionSimpleIterator pit;
for (pc->InitTraversal(pit); (prop = pc->GetNextProp(pit)) != NULL;)
{
vtkImageActor *ia = vtkImageActor::SafeDownCast(prop);
if (ia)
......@@ -823,7 +824,8 @@ void vtkPushPipeline::SetupRenderer(vtkRenderer *ren)
// check for other props
vtkPropCollection *pc = ren->GetProps();
vtkProp *prop;
for (pc->InitTraversal(); (prop = pc->GetNextProp()) != NULL;)
vtkCollectionSimpleIterator pit;
for (pc->InitTraversal(pit); (prop = pc->GetNextProp(pit)) != NULL;)
{
// look for image actors
......
......@@ -40,7 +40,7 @@
#include "vtkTIFFWriter.h"
#include "vtkTexture.h"
vtkCxxRevisionMacro(vtkRIBExporter, "1.61");
vtkCxxRevisionMacro(vtkRIBExporter, "1.62");
vtkStandardNewMacro(vtkRIBExporter);
typedef double RtColor[3];
......@@ -129,7 +129,8 @@ void vtkRIBExporter::WriteData()
// All textures must be made first
//
ac = ren->GetActors();
for ( ac->InitTraversal (); (anActor = ac->GetNextActor()); )
vtkCollectionSimpleIterator ait;
for ( ac->InitTraversal (ait); (anActor = ac->GetNextActor(ait)); )
{
// see if the actor has a mapper. it could be an assembly
if (anActor->GetMapper() == NULL)
......@@ -193,7 +194,7 @@ void vtkRIBExporter::WriteData()
vtkAssemblyNode *node;
ac = ren->GetActors();
vtkAssemblyPath *apath;
for (ac->InitTraversal(); (anActor = ac->GetNextActor()); )
for (ac->InitTraversal(ait); (anActor = ac->GetNextActor(ait)); )
{
for (anActor->InitPathTraversal(); (apath=anActor->GetNextPath()); )
{
......
......@@ -41,7 +41,7 @@
#include <mpi.h>
#endif
vtkCxxRevisionMacro(vtkCompositeManager, "1.57");
vtkCxxRevisionMacro(vtkCompositeManager, "1.58");
vtkStandardNewMacro(vtkCompositeManager);
......@@ -1022,8 +1022,9 @@ void vtkCompositeManager::InitializePieces()
while ( (ren = rens->GetNextRenderer(sit)) )
{
actors = ren->GetActors();
actors->InitTraversal();
while ( (actor = actors->GetNextItem()) )
vtkCollectionSimpleIterator ait;
actors->InitTraversal(ait);
while ( (actor = actors->GetNextActor(ait)) )
{
mapper = actor->GetMapper();
pdMapper = vtkPolyDataMapper::SafeDownCast(mapper);
......
......@@ -70,7 +70,7 @@ const int vtkParallelRenderManager::REN_INFO_DOUBLE_SIZE =
const int vtkParallelRenderManager::LIGHT_INFO_DOUBLE_SIZE =
sizeof(vtkParallelRenderManager::LightInfoDouble)/sizeof(double);
vtkCxxRevisionMacro(vtkParallelRenderManager, "1.26");
vtkCxxRevisionMacro(vtkParallelRenderManager, "1.27");
vtkParallelRenderManager::vtkParallelRenderManager()
{
......@@ -373,8 +373,9 @@ void vtkParallelRenderManager::InitializePieces()
while ( (ren = rens->GetNextRenderer(rsit)) )
{
actors = ren->GetActors();
actors->InitTraversal();
while ( (actor = actors->GetNextItem()) )
vtkCollectionSimpleIterator ait;
actors->InitTraversal(ait);
while ( (actor = actors->GetNextActor(ait)) )
{
mapper = actor->GetMapper();
pdMapper = vtkPolyDataMapper::SafeDownCast(mapper);
......
......@@ -22,7 +22,7 @@
#include "vtkRenderWindow.h"
#include "vtkVolume.h"
vtkCxxRevisionMacro(vtkAssembly, "1.55");
vtkCxxRevisionMacro(vtkAssembly, "1.56");
vtkStandardNewMacro(vtkAssembly);
// Construct object with no children.
......@@ -64,10 +64,11 @@ void vtkAssembly::ShallowCopy(vtkProp *prop)
if ( a != NULL )
{
this->Parts->RemoveAllItems();
a->Parts->InitTraversal();
vtkCollectionSimpleIterator pit;
a->Parts->InitTraversal(pit);
for (int i=0; i<0; i++)
{
this->Parts->AddItem(a->Parts->GetNextProp3D());
this->Parts->AddItem(a->Parts->GetNextProp3D(pit));
}
}
......@@ -156,8 +157,9 @@ void vtkAssembly::ReleaseGraphicsResources(vtkWindow *renWin)
{
vtkProp3D *prop3D;
for ( this->Parts->InitTraversal();
(prop3D = this->Parts->GetNextProp3D()); )
vtkCollectionSimpleIterator pit;
for ( this->Parts->InitTraversal(pit);
(prop3D = this->Parts->GetNextProp3D(pit)); )
{
prop3D->ReleaseGraphicsResources(renWin);
}
......@@ -248,8 +250,9 @@ void vtkAssembly::UpdatePaths()
// Add nodes as we proceed down the hierarchy
vtkProp3D *prop3D;
for ( this->Parts->InitTraversal();
(prop3D = this->Parts->GetNextProp3D()); )
vtkCollectionSimpleIterator pit;
for ( this->Parts->InitTraversal(pit);
(prop3D = this->Parts->GetNextProp3D(pit)); )
{
path->AddNode(prop3D,prop3D->GetMatrix());
......@@ -272,8 +275,9 @@ void vtkAssembly::BuildPaths(vtkAssemblyPaths *paths, vtkAssemblyPath *path)
{
vtkProp3D *prop3D;
for ( this->Parts->InitTraversal();
(prop3D = this->Parts->GetNextProp3D()); )
vtkCollectionSimpleIterator pit;
for ( this->Parts->InitTraversal(pit);
(prop3D = this->Parts->GetNextProp3D(pit)); )
{
path->AddNode(prop3D,prop3D->GetMatrix());
......@@ -353,7 +357,9 @@ unsigned long int vtkAssembly::GetMTime()
unsigned long time;
vtkProp3D *prop;
for (this->Parts->InitTraversal(); (prop = this->Parts->GetNextProp3D()); )
vtkCollectionSimpleIterator pit;
for (this->Parts->InitTraversal(pit);
(prop = this->Parts->GetNextProp3D(pit)); )
{
time = prop->GetMTime();
mTime = ( time > mTime ? time : mTime );
......
......@@ -34,7 +34,7 @@
#include "vtkTransform.h"
#include "vtkUnsignedCharArray.h"
vtkCxxRevisionMacro(vtkIVExporter, "1.59");
vtkCxxRevisionMacro(vtkIVExporter, "1.60");
vtkStandardNewMacro(vtkIVExporter);
vtkIVExporter::vtkIVExporter()
......@@ -167,7 +167,8 @@ void vtkIVExporter::WriteData()
// do the actors now
ac = ren->GetActors();
vtkAssemblyPath *apath;
for (ac->InitTraversal(); (anActor = ac->GetNextActor()); )
vtkCollectionSimpleIterator ait;
for (ac->InitTraversal(ait); (anActor = ac->GetNextActor(ait)); )
{
for (anActor->InitPathTraversal(); (apath=anActor->GetNextPath()); )
{
......
......@@ -32,7 +32,7 @@
#include "vtkRenderer.h"
#include "vtkTextProperty.h"
vtkCxxRevisionMacro(vtkInteractorStyle, "1.94");
vtkCxxRevisionMacro(vtkInteractorStyle, "1.95");
vtkStandardNewMacro(vtkInteractorStyle);
//----------------------------------------------------------------------------
......@@ -728,7 +728,8 @@ void vtkInteractorStyle::OnChar()
this->FindPokedRenderer(rwi->GetEventPosition()[0],
rwi->GetEventPosition()[1]);
ac = this->CurrentRenderer->GetActors();
for (ac->InitTraversal(); (anActor = ac->GetNextItem()); )
vtkCollectionSimpleIterator ait;
for (ac->InitTraversal(ait); (anActor = ac->GetNextActor(ait)); )
{
for (anActor->InitPathTraversal(); (path=anActor->GetNextPath()); )
{
......@@ -749,7 +750,8 @@ void vtkInteractorStyle::OnChar()
this->FindPokedRenderer(rwi->GetEventPosition()[0],
rwi->GetEventPosition()[1]);
ac = this->CurrentRenderer->GetActors();
for (ac->InitTraversal(); (anActor = ac->GetNextItem()); )
vtkCollectionSimpleIterator ait;
for (ac->InitTraversal(ait); (anActor = ac->GetNextActor(ait)); )
{
for (anActor->InitPathTraversal(); (path=anActor->GetNextPath()); )
{
......
......@@ -30,7 +30,7 @@
#include "vtkRendererCollection.h"
#include "vtkTransform.h"
vtkCxxRevisionMacro(vtkOBJExporter, "1.54");
vtkCxxRevisionMacro(vtkOBJExporter, "1.55");
vtkStandardNewMacro(vtkOBJExporter);
vtkOBJExporter::vtkOBJExporter()
......@@ -103,7 +103,8 @@ void vtkOBJExporter::WriteData()
ac = ren->GetActors();
vtkAssemblyPath *apath;
for (ac->InitTraversal(); (anActor = ac->GetNextActor()); )
vtkCollectionSimpleIterator ait;
for (ac->InitTraversal(ait); (anActor = ac->GetNextActor(ait)); )
{
for (anActor->InitPathTraversal(); (apath=anActor->GetNextPath()); )
{
......
......@@ -36,7 +36,7 @@
#include "vtkTriangleStrip.h"
#include "vtkVersion.h"
vtkCxxRevisionMacro(vtkOOGLExporter, "1.27");
vtkCxxRevisionMacro(vtkOOGLExporter, "1.28");
vtkStandardNewMacro(vtkOOGLExporter);
vtkOOGLExporter::vtkOOGLExporter()
......@@ -221,7 +221,8 @@ void vtkOOGLExporter::WriteData()
ac = ren->GetActors();
vtkAssemblyPath *apath;
count = 0;
for (ac->InitTraversal(); (anActor = ac->GetNextActor()); )
vtkCollectionSimpleIterator ait;
for (ac->InitTraversal(ait); (anActor = ac->GetNextActor(ait)); )
{
for (anActor->InitPathTraversal(); (apath=anActor->GetNextPath()); )
{
......
......@@ -35,7 +35,7 @@
#include "vtkVolumeMapper.h"
#include "vtkBox.h"
vtkCxxRevisionMacro(vtkPicker, "1.84");
vtkCxxRevisionMacro(vtkPicker, "1.85");
vtkStandardNewMacro(vtkPicker);
// Construct object with initial tolerance of 1/40th of window. There are no
......@@ -269,7 +269,8 @@ int vtkPicker::Pick(double selectionX, double selectionY, double selectionZ,
vtkAssemblyPath *path;
vtkProperty *tempProperty;
this->Transform->PostMultiply();
for ( props->InitTraversal(); (prop=props->GetNextProp()); )
vtkCollectionSimpleIterator pit;
for ( props->InitTraversal(pit); (prop=props->GetNextProp(pit)); )
{
for ( prop->InitPathTraversal(); (path=prop->GetNextPath()); )
{
......
......@@ -46,6 +46,14 @@ public:
// Get the last actor in the list.
vtkProp3D *GetLastProp3D();
//BTX
// Description:
// Reentrant safe way to get an object in a collection. Just pass the
// same cookie back and forth.
vtkProp3D *GetNextProp3D(vtkCollectionSimpleIterator &cookie) {
return static_cast<vtkProp3D *>(this->GetNextItemAsObject(cookie));};
//ETX
protected:
vtkProp3DCollection() {};
~vtkProp3DCollection() {};
......
......@@ -33,7 +33,7 @@
#include "vtkTimerLog.h"
#include "vtkVolume.h"
vtkCxxRevisionMacro(vtkRenderer, "1.203");
vtkCxxRevisionMacro(vtkRenderer, "1.204");
//----------------------------------------------------------------------------
// Needed when we don't use the vtkStandardNewMacro.
......@@ -156,8 +156,9 @@ void vtkRenderer::Render(void)
goto completed_mod_check;
}
}
for (this->Props->InitTraversal();
(aProp = this->Props->GetNextProp()); )
vtkCollectionSimpleIterator pit;
for (this->Props->InitTraversal(pit);
(aProp = this->Props->GetNextProp(pit)); )
{
// if it's invisible, we can skip the rest
if (aProp->GetVisibility())
......@@ -206,8 +207,9 @@ void vtkRenderer::Render(void)
}
this->PropArrayCount = 0;
for ( i = 0, this->Props->InitTraversal();
(aProp = this->Props->GetNextProp());i++ )
vtkCollectionSimpleIterator pit;
for ( i = 0, this->Props->InitTraversal(pit);
(aProp = this->Props->GetNextProp(pit));i++ )
{
if ( aProp->GetVisibility() )
{
......@@ -539,8 +541,9 @@ vtkActorCollection *vtkRenderer::GetActors()
// clear the collection first
this->Actors->RemoveAllItems();
for (this->Props->InitTraversal();
(aProp = this->Props->GetNextProp()); )
vtkCollectionSimpleIterator pit;
for (this->Props->InitTraversal(pit);
(aProp = this->Props->GetNextProp(pit)); )
{
aProp->GetActors(this->Actors);
}
......@@ -555,8 +558,9 @@ vtkVolumeCollection *vtkRenderer::GetVolumes()
// clear the collection first
this->Volumes->RemoveAllItems();
for (this->Props->InitTraversal();
(aProp = this->Props->GetNextProp()); )
vtkCollectionSimpleIterator pit;
for (this->Props->InitTraversal(pit);
(aProp = this->Props->GetNextProp(pit)); )
{
aProp->GetVolumes(this->Volumes);
}
......@@ -627,7 +631,9 @@ void vtkRenderer::ComputeVisiblePropBounds( double allBounds[6] )
allBounds[1] = allBounds[3] = allBounds[5] = -VTK_DOUBLE_MAX;
// loop through all props
for (this->Props->InitTraversal(); (prop = this->Props->GetNextProp()); )
vtkCollectionSimpleIterator pit;
for (this->Props->InitTraversal(pit);
(prop = this->Props->GetNextProp(pit)); )
{
// if it's invisible, or has no geometry, we can skip the rest
if ( prop->GetVisibility() )
......@@ -920,10 +926,11 @@ void vtkRenderer::SetRenderWindow(vtkRenderWindow *renwin)
// this information needs to be passed to the renderer's actors and
// volumes so they can release and render window specific (or graphics
// context specific) information (such as display lists and texture ids)
this->Props->InitTraversal();
for ( aProp = this->Props->GetNextProp();
vtkCollectionSimpleIterator pit;
this->Props->InitTraversal(pit);
for ( aProp = this->Props->GetNextProp(pit);
aProp != NULL;
aProp = this->Props->GetNextProp() )
aProp = this->Props->GetNextProp(pit) )
{
aProp->ReleaseGraphicsResources(this->RenderWindow);
}
......@@ -1131,8 +1138,9 @@ int vtkRenderer::VisibleActorCount()
int count = 0;
// loop through Props
for (this->Props->InitTraversal();
(aProp = this->Props->GetNextProp()); )
vtkCollectionSimpleIterator pit;
for (this->Props->InitTraversal(pit);
(aProp = this->Props->GetNextProp(pit)); )
{
if (aProp->GetVisibility())
{
......@@ -1148,8 +1156,9 @@ int vtkRenderer::VisibleVolumeCount()
vtkProp *aProp;
// loop through volumes
for (this->Props->InitTraversal();
(aProp = this->Props->GetNextProp()); )
vtkCollectionSimpleIterator pit;
for (this->Props->InitTraversal(pit);
(aProp = this->Props->GetNextProp(pit)); )
{
if (aProp->GetVisibility())
{
......@@ -1260,7 +1269,8 @@ void vtkRenderer::PickRender(vtkPropCollection *props)
// This collection will be further culled by using a bounding box
// pick later (vtkPicker). Things that are not vtkProp3D will get
// put into the Paths list directly.
for ( props->InitTraversal(); (aProp = props->GetNextProp()); )
vtkCollectionSimpleIterator pit;
for ( props->InitTraversal(pit); (aProp = props->GetNextProp(pit)); )
{
if ( aProp->GetPickable() && aProp->GetVisibility() )
{
......@@ -1286,7 +1296,7 @@ void vtkRenderer::PickRender(vtkPropCollection *props)
// Create a picker to do the culling process
vtkPicker* cullPicker = vtkPicker::New();
// Add each of the Actors from the pickFrom list into the picker
for ( pickFrom->InitTraversal(); (aProp = pickFrom->GetNextProp()); )
for ( pickFrom->InitTraversal(pit); (aProp = pickFrom->GetNextProp(pit)); )
{
cullPicker->AddPickList(aProp);
}
......@@ -1300,7 +1310,9 @@ void vtkRenderer::PickRender(vtkPropCollection *props)
// Put all the ones that were picked by the cull process
// into the PathArray to be picked from
for (cullPicked->InitTraversal(); (aProp = cullPicked->GetNextProp3D());)
vtkCollectionSimpleIterator p3dit;
for (cullPicked->InitTraversal(p3dit);
(aProp = cullPicked->GetNextProp3D(p3dit));)
{
if ( aProp != NULL )
{
......
......@@ -23,7 +23,7 @@
#include "vtkRenderer.h"
#include "vtkUnsignedCharArray.h"
vtkCxxRevisionMacro(vtkRendererSource, "1.51");
vtkCxxRevisionMacro(vtkRendererSource, "1.52");
vtkStandardNewMacro(vtkRendererSource);
vtkCxxSetObjectMacro(vtkRendererSource,Input,vtkRenderer);
......@@ -260,8 +260,9 @@ void vtkRendererSource::UpdateInformation()
t1 = t2;
}
actors = ren->GetActors();
actors->InitTraversal();
while ( (actor = actors->GetNextItem()) )
vtkCollectionSimpleIterator ait;
actors->InitTraversal(ait);
while ( (actor = actors->GetNextActor(ait)) )
{
t2 = actor->GetMTime();
if (t2 > t1)
......
......@@ -33,7 +33,7 @@
#include "vtkTexture.h"
#include "vtkTransform.h"
vtkCxxRevisionMacro(vtkVRMLExporter, "1.76");
vtkCxxRevisionMacro(vtkVRMLExporter, "1.77");
vtkStandardNewMacro(vtkVRMLExporter);
vtkVRMLExporter::vtkVRMLExporter()
......@@ -164,7 +164,8 @@ void vtkVRMLExporter::WriteData()
// do the actors now
ac = ren->GetActors();
vtkAssemblyPath *apath;
for (ac->InitTraversal(); (anActor = ac->GetNextActor()); )
vtkCollectionSimpleIterator ait;
for (ac->InitTraversal(ait); (anActor = ac->GetNextActor(ait)); )
{
for (anActor->InitPathTraversal(); (apath=anActor->GetNextPath()); )
{
......
......@@ -53,6 +53,14 @@ class VTK_RENDERING_EXPORT vtkVolumeCollection : public vtkPropCollection
// where possible.
vtkVolume *GetNextItem() { return this->GetNextVolume(); };
//BTX
// Description:
// Reentrant safe way to get an object in a collection. Just pass the
// same cookie back and forth.
vtkVolume *GetNextVolume(vtkCollectionSimpleIterator &cookie) {
return static_cast<vtkVolume *>(this->GetNextItemAsObject(cookie));};
//ETX
protected:
vtkVolumeCollection() {};
~vtkVolumeCollection() {};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment