Commit a94dd291 authored by Ken Martin's avatar Ken Martin
Browse files

cleaned up collections some

parent e0f29f66
......@@ -90,7 +90,7 @@ public:
// GetNextItemAsObject (or GetNextItem in derived class). The list WILL
// be shortened if a valid index is given! If this->Current is equal to the
// element being removed, have it point to then next element in the list.
virtual void RemoveItem(int i);
void RemoveItem(int i);
// Description:
// Remove an object from the list. Removes the first object found, not
......
......@@ -60,17 +60,6 @@ public:
void AddItem(vtkDataSet *ds) {
this->vtkCollection::AddItem((vtkObject *)ds);};
// Description:
// Remove a dataset from the list.
void RemoveItem(vtkDataSet *ds) {
this->vtkCollection::RemoveItem((vtkObject *)ds);};
// Description:
// Determine whether a particular dataset is present. Returns its position
// in the list.
int IsItemPresent(vtkDataSet *ds) {
return this->vtkCollection::IsItemPresent((vtkObject *)ds);};
// Description:
// Get the next dataset in the list.
vtkDataSet *GetNextItem() {
......
......@@ -62,15 +62,6 @@ public:
// Add an implicit function to the list.
void AddItem(vtkImplicitFunction *);
// Description:
// Remove an implicit function from the list.
void RemoveItem(vtkImplicitFunction *);
// Description:
// Determine whether a particular implicit function is present. Returns its
// position in the list.
int IsItemPresent(vtkImplicitFunction *);
// Description:
// Get the next implicit function in the list.
vtkImplicitFunction *GetNextItem();
......@@ -88,16 +79,6 @@ inline void vtkImplicitFunctionCollection::AddItem(vtkImplicitFunction *f)
this->vtkCollection::AddItem((vtkObject *)f);
}
inline void vtkImplicitFunctionCollection::RemoveItem(vtkImplicitFunction *f)
{
this->vtkCollection::RemoveItem((vtkObject *)f);
}
inline int vtkImplicitFunctionCollection::IsItemPresent(vtkImplicitFunction *f)
{
return this->vtkCollection::IsItemPresent((vtkObject *)f);
}
inline vtkImplicitFunction *vtkImplicitFunctionCollection::GetNextItem()
{
return (vtkImplicitFunction *)(this->GetNextItemAsObject());
......
......@@ -62,15 +62,6 @@ public:
// Add a plane to the list.
void AddItem(vtkPlane *);
// Description:
// Remove an plane from the list.
void RemoveItem(vtkPlane *);
// Description:
// Determine whether a particular plane is present. Returns its
// position in the list.
int IsItemPresent(vtkPlane *);
// Description:
// Get the next plane in the list.
vtkPlane *GetNextItem();
......@@ -88,16 +79,6 @@ inline void vtkPlaneCollection::AddItem(vtkPlane *f)
this->vtkCollection::AddItem((vtkObject *)f);
}
inline void vtkPlaneCollection::RemoveItem(vtkPlane *f)
{
this->vtkCollection::RemoveItem((vtkObject *)f);
}
inline int vtkPlaneCollection::IsItemPresent(vtkPlane *f)
{
return this->vtkCollection::IsItemPresent((vtkObject *)f);
}
inline vtkPlane *vtkPlaneCollection::GetNextItem()
{
return (vtkPlane *)(this->GetNextItemAsObject());
......
......@@ -63,15 +63,6 @@ class VTK_EXPORT vtkPropCollection : public vtkCollection
// Add an Prop to the list.
void AddItem(vtkProp *a);
// Description:
// Remove an Prop from the list.
void RemoveItem(vtkProp *a);
// Description:
// Determine whether a particular Prop is present. Returns its position
// in the list.
int IsItemPresent(vtkProp *a);
// Description:
// Get the next Prop in the list.
vtkProp *GetNextProp();
......@@ -93,16 +84,6 @@ inline void vtkPropCollection::AddItem(vtkProp *a)
this->vtkCollection::AddItem((vtkObject *)a);
}
inline void vtkPropCollection::RemoveItem(vtkProp *a)
{
this->vtkCollection::RemoveItem((vtkObject *)a);
}
inline int vtkPropCollection::IsItemPresent(vtkProp *a)
{
return this->vtkCollection::IsItemPresent((vtkObject *)a);
}
inline vtkProp *vtkPropCollection::GetNextProp()
{
return (vtkProp *)(this->GetNextItemAsObject());
......
......@@ -63,15 +63,6 @@ public:
// Add a Transform to the list.
void AddItem(vtkTransform *);
// Description:
// Remove a Transform from the list.
void RemoveItem(vtkTransform *);
// Description:
// Determine whether a particular Transform is present. Returns its position
// in the list.
int IsItemPresent(vtkTransform *);
// Description:
// Get the next Transform in the list. Return NULL when the end of the
// list is reached.
......@@ -90,16 +81,6 @@ inline void vtkTransformCollection::AddItem(vtkTransform *t)
this->vtkCollection::AddItem((vtkObject *)t);
}
inline void vtkTransformCollection::RemoveItem(vtkTransform *t)
{
this->vtkCollection::RemoveItem((vtkObject *)t);
}
inline int vtkTransformCollection::IsItemPresent(vtkTransform *t)
{
return this->vtkCollection::IsItemPresent((vtkObject *)t);
}
inline vtkTransform *vtkTransformCollection::GetNextItem()
{
return (vtkTransform *)(this->GetNextItemAsObject());
......
......@@ -122,6 +122,11 @@ vtkViewport::~vtkViewport()
}
}
void vtkViewport::RemoveActor2D(vtkProp* p)
{
this->Actors2D->RemoveItem(p);
this->RemoveProp(p);
}
void vtkViewport::AddProp(vtkProp *p)
{
this->Props->AddItem(p);
......
......@@ -85,7 +85,7 @@ public:
// These methods are all synonyms to AddProp and RemoveProp.
// They are here for convinience and backwards compatability.
void AddActor2D(vtkProp* p) {this->AddProp(p);};
void RemoveActor2D(vtkProp* p) {this->Actors2D->RemoveItem(p);this->RemoveProp(p);};
void RemoveActor2D(vtkProp* p);
vtkActor2DCollection *GetActors2D();
// Description:
......
......@@ -63,15 +63,6 @@ public:
// Add an actor to the list.
void AddItem(vtkActor *a);
// Description:
// Remove an actor from the list.
void RemoveItem(vtkActor *a);
// Description:
// Determine whether a particular actor is present. Returns its position
// in the list.
int IsItemPresent(vtkActor *a);
// Description:
// Get the next actor in the list.
vtkActor *GetNextActor();
......@@ -100,16 +91,6 @@ inline void vtkActorCollection::AddItem(vtkActor *a)
this->vtkCollection::AddItem((vtkObject *)a);
}
inline void vtkActorCollection::RemoveItem(vtkActor *a)
{
this->vtkCollection::RemoveItem((vtkObject *)a);
}
inline int vtkActorCollection::IsItemPresent(vtkActor *a)
{
return this->vtkCollection::IsItemPresent((vtkObject *)a);
}
inline vtkActor *vtkActorCollection::GetNextActor()
{
return (vtkActor *)(this->GetNextItemAsObject());
......
......@@ -64,17 +64,6 @@ class VTK_EXPORT vtkCullerCollection : public vtkCollection
void AddItem(vtkCuller *a) {
this->vtkCollection::AddItem((vtkObject *)a);};
// Description:
// Remove an Culler from the list.
void RemoveItem(vtkCuller *a) {
this->vtkCollection::RemoveItem((vtkObject *)a);};
// Description:
// Determine whether a particular Culler is present. Returns its position
// in the list.
int IsItemPresent(vtkCuller *a) {
return this->vtkCollection::IsItemPresent((vtkObject *)a);};
// Description:
// Get the next Culler in the list.
vtkCuller *GetNextItem() {
......
......@@ -49,19 +49,6 @@ void vtkLightCollection::AddItem(vtkLight *a)
this->vtkCollection::AddItem((vtkObject *)a);
}
// Remove a light from the list.
void vtkLightCollection::RemoveItem(vtkLight *a)
{
this->vtkCollection::RemoveItem((vtkObject *)a);
}
// Determine whether a particular light is present. Returns its position
// in the list.
int vtkLightCollection::IsItemPresent(vtkLight *a)
{
return this->vtkCollection::IsItemPresent((vtkObject *)a);
}
// Get the next light in the list. NULL is returned when the collection is
// exhausted.
vtkLight *vtkLightCollection::GetNextItem()
......
......@@ -63,15 +63,6 @@ class VTK_EXPORT vtkLightCollection : public vtkCollection
// Add a light to the list.
void AddItem(vtkLight *a);
// Description:
// Remove a light from the list.
void RemoveItem(vtkLight *a);
// Description:
// Determine whether a particular light is present. Returns its position
// in the list.
int IsItemPresent(vtkLight *a);
// Description:
// Get the next light in the list. NULL is returned when the collection is
// exhausted.
......
......@@ -64,17 +64,6 @@ class VTK_EXPORT vtkMapperCollection : public vtkCollection
void AddItem(vtkMapper *a) {
this->vtkCollection::AddItem((vtkObject *)a);};
// Description:
// Remove an mapper from the list.
void RemoveItem(vtkMapper *a) {
this->vtkCollection::RemoveItem((vtkObject *)a);};
// Description:
// Determine whether a particular mapper is present. Returns its position
// in the list.
int IsItemPresent(vtkMapper *a) {
return this->vtkCollection::IsItemPresent((vtkObject *)a);};
// Description:
// Get the next mapper in the list.
vtkMapper *GetNextItem() {
......
......@@ -63,17 +63,6 @@ public:
void AddItem(vtkPolyData *pd) {
this->vtkCollection::AddItem((vtkObject *)pd);};
// Description:
// Remove an poly data from the list.
void RemoveItem(vtkPolyData *pd) {
this->vtkCollection::RemoveItem((vtkObject *)pd);};
// Description:
// Determine whether a particular poly data is present. Returns its position
// in the list.
int IsItemPresent(vtkPolyData *pd) {
return this->vtkCollection::IsItemPresent((vtkObject *)pd);};
// Description:
// Get the next poly data in the list.
vtkPolyData *GetNextItem() {
......
......@@ -65,17 +65,6 @@ class VTK_EXPORT vtkRenderWindowCollection : public vtkCollection
void AddItem(vtkRenderWindow *a) {
this->vtkCollection::AddItem((vtkObject *)a);};
// Description:
// Remove a RenderWindow from the list.
void RemoveItem(vtkRenderWindow *a) {
this->vtkCollection::RemoveItem((vtkObject *)a);};
// Description:
// Determine whether a particular RenderWindow is present. Returns its
// position in the list.
int IsItemPresent(vtkRenderWindow *a) {
return this->vtkCollection::IsItemPresent((vtkObject *)a);};
// Description:
// Get the next RenderWindow in the list. Return NULL when at the end of the
// list.
......
......@@ -93,8 +93,8 @@ public:
// They are here for convinience and backwards compatability.
void AddActor(vtkProp *p) {this->AddProp(p);};
void AddVolume(vtkProp *p) {this->AddProp(p);};
void RemoveActor(vtkProp *p) {this->Actors->RemoveItem((vtkActor *) p);this->RemoveProp(p);};
void RemoveVolume(vtkProp *p) {this->Volumes->RemoveItem((vtkVolume *) p);this->RemoveProp(p);};
void RemoveActor(vtkProp *p) {this->Actors->RemoveItem(p);this->RemoveProp(p);};
void RemoveVolume(vtkProp *p) {this->Volumes->RemoveItem(p);this->RemoveProp(p);};
// Description:
// Remove a light from the list of lights.
......
......@@ -64,17 +64,6 @@ class VTK_EXPORT vtkRendererCollection : public vtkCollection
void AddItem(vtkRenderer *a) {
this->vtkCollection::AddItem((vtkObject *)a);};
// Description:
// Remove a Renderer from the list.
void RemoveItem(vtkRenderer *a) {
this->vtkCollection::RemoveItem((vtkObject *)a);};
// Description:
// Determine whether a particular Renderer is present. Returns its
// position in the list.
int IsItemPresent(vtkRenderer *a) {
return this->vtkCollection::IsItemPresent((vtkObject *)a);};
// Description:
// Get the next Renderer in the list. Return NULL when at the end of the
// list.
......
......@@ -62,18 +62,6 @@ public:
void AddItem(vtkStructuredPoints *ds) {
this->vtkCollection::AddItem((vtkObject *)ds);};
// Description:
// Remove a pointer to a vtkStructuredPoints from the list.
void RemoveItem(vtkStructuredPoints *ds) {
this->vtkCollection::RemoveItem((vtkObject *)ds);};
// Description:
// Determine whether a particular pointer to a vtk StructuredPoints is in
// the list.
// Returns its position in the list.
int IsItemPresent(vtkStructuredPoints *ds) {
return this->vtkCollection::IsItemPresent((vtkObject *)ds);};
// Description:
// Get the next item in the collection. NULL is returned if the collection
// is exhausted.
......
......@@ -65,17 +65,6 @@ class VTK_EXPORT vtkVolumeCollection : public vtkPropCollection
void AddItem(vtkVolume *a) {
this->vtkCollection::AddItem((vtkObject *)a);};
// Description:
// Remove a Volume from the list.
void RemoveItem(vtkVolume *a) {
this->vtkCollection::RemoveItem((vtkObject *)a);};
// Description:
// Determine whether a particular Volume is present. Returns its
// position in the list.
int IsItemPresent(vtkVolume *a) {
return this->vtkCollection::IsItemPresent((vtkObject *)a);};
// Description:
// Get the next Volume in the list. Return NULL when at the end of the
// list.
......
......@@ -61,8 +61,6 @@ class VTK_EXPORT vtkImagerCollection : public vtkCollection
// Description:
// Standard methods for manipulating the collection.
void AddItem(vtkImager *a);
void RemoveItem(vtkImager *a);
int IsItemPresent(vtkImager *a);
vtkImager *GetNextItem();
vtkImager *GetLastItem();
......@@ -78,16 +76,6 @@ inline void vtkImagerCollection::AddItem(vtkImager *a)
this->vtkCollection::AddItem((vtkObject *)a);
}
inline void vtkImagerCollection::RemoveItem(vtkImager *a)
{
this->vtkCollection::RemoveItem((vtkObject *)a);
}
inline int vtkImagerCollection::IsItemPresent(vtkImager *a)
{
return this->vtkCollection::IsItemPresent((vtkObject *)a);
}
inline vtkImager *vtkImagerCollection::GetNextItem()
{
return (vtkImager *)(this->GetNextItemAsObject());
......
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