Updates will be applied on October 27th between 12pm - 12:45pm EDT (UTC-0400). Gitlab may be slow during the maintenance window.

Commit 3caa2210 authored by Will Schroeder's avatar Will Schroeder
Browse files

ENH: No more virtual base classes!

parent eee52148
......@@ -41,7 +41,7 @@ public:
void AddInput(vlDataSet& in) {this->AddInput(&in);};
void RemoveInput(vlDataSet *in);
void RemoveInput(vlDataSet& in) {this->RemoveInput(&in);};
vlDataSetCollection *GetInput() {return &(this->Input);};
vlDataSetCollection *GetInput() {return &(this->InputList);};
// filter interface
void Update();
......@@ -50,7 +50,7 @@ protected:
// Usual data generation method
void Execute();
// list of data sets to append together
vlDataSetCollection Input;
vlDataSetCollection InputList;
};
#endif
......
......@@ -41,7 +41,7 @@ public:
void AddInput(vlPolyData& in) {this->AddInput(&in);};
void RemoveInput(vlPolyData *);
void RemoveInput(vlPolyData& in) {this->RemoveInput(&in);};
vlPolyDataCollection *GetInput() {return &(this->Input);};
vlPolyDataCollection *GetInput() {return &(this->InputList);};
// filter interface
void Update();
......@@ -51,7 +51,7 @@ protected:
void Execute();
// list of data sets to append together
vlPolyDataCollection Input;
vlPolyDataCollection InputList;
};
#endif
......
......@@ -43,9 +43,10 @@ public:
void AddInput(vlStructuredPoints &in) {this->AddInput(&in);};
void RemoveInput(vlStructuredPoints *in);
void RemoveInput(vlStructuredPoints &in) {this->RemoveInput(&in);};
vlStructuredPointsCollection *GetInput() {return &(this->Input);};
vlStructuredPointsCollection *GetInput() {return &(this->InputList);};
// filter interface
unsigned long int GetMTime();
void Update();
// alternative method to boolean data
......@@ -70,7 +71,7 @@ protected:
void InitializeBoolean();
// list of data sets to append together
vlStructuredPointsCollection Input;
vlStructuredPointsCollection InputList;
// pointer to operation function
void (vlBooleanStructuredPoints::*Operator)();
......
......@@ -48,6 +48,9 @@ public:
int FindCell(float x[3], vlCell *cell, float tol2, int& subId, float pc[3]) {return this->DataSet->FindCell(x,cell,tol2,subId,pc);};
void ComputeBounds();
void Modified();
unsigned long int GetMTime();
void Update();
protected:
......
......@@ -27,9 +27,12 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
class vlDataSetToPolyFilter : public vlPolyData, public vlDataSetFilter
{
public:
void Update();
char *GetClassName() {return "vlDataSetToPolyFilter";};
void PrintSelf(ostream& os, vlIndent indent);
void Modified();
unsigned long int GetMTime();
void Update();
};
#endif
......
......@@ -28,9 +28,12 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
class vlDataSetToStructuredPointsFilter : public vlStructuredPoints, public vlDataSetFilter
{
public:
void Update();
char *GetClassName() {return "vlDataSetToStructuredPointsFilter";};
void PrintSelf(ostream& os, vlIndent indent);
void Modified();
unsigned long int GetMTime();
void Update();
};
#endif
......
......@@ -28,9 +28,12 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
class vlDataSetToUnstructuredGridFilter : public vlUnstructuredGrid, public vlDataSetFilter
{
public:
void Update();
char *GetClassName() {return "vlDataSetToUnstructuredGridFilter";};
void PrintSelf(ostream& os, vlIndent indent);
void Modified();
unsigned long int GetMTime();
void Update();
};
#endif
......
......@@ -27,9 +27,12 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
class vlPolyToPolyFilter : public vlPolyData, public vlPolyFilter
{
public:
void Update();
char *GetClassName() {return "vlPolyToPolyFilter";};
void PrintSelf(ostream& os, vlIndent indent);
void Modified();
unsigned long int GetMTime();
void Update();
};
#endif
......
......@@ -32,8 +32,8 @@ class vlPointSetToPointSetFilter : public vlPointSet, public vlPointSetFilter
public:
vlPointSetToPointSetFilter();
~vlPointSetToPointSetFilter();
char *GetClassName() {return "vlPointSetToPointSetFilter";};
char *GetDataType() {return this->PointSet->GetDataType();};
char *GetClassName() {return "vlPointSetToPointSetFilter";};
void PrintSelf(ostream& os, vlIndent indent);
// dataset interface
......@@ -48,6 +48,9 @@ public:
void Initialize();
void ComputeBounds();
void Modified();
unsigned long int GetMTime();
void Update();
protected:
......
......@@ -13,25 +13,27 @@ without the express written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
//
// .NAME vlStructuredDataToPolyFilter - abstract filter class
// .NAME vlStructuredGridToPolyFilter - abstract filter class
// .SECTION Description
// vlStructuredDataToPolyFilter are filters whose subclasses take as input
// vlStructuredGridToPolyFilter are filters whose subclasses take as input
// structured data (e.g., structured points, structured grid) and generate
// polygonal data on output.
#ifndef __vlStructuredDataToPolyFilter_h
#define __vlStructuredDataToPolyFilter_h
#ifndef __vlStructuredGridToPolyFilter_h
#define __vlStructuredGridToPolyFilter_h
#include "StrDataF.hh"
#include "SGridF.hh"
#include "PolyData.hh"
class vlStructuredDataToPolyFilter : public vlPolyData, public vlStructuredDataFilter
class vlStructuredGridToPolyFilter : public vlPolyData, public vlStructuredGridFilter
{
public:
void Update();
char *GetClassName() {return "vlStructuredDataToPolyFilter";};
char *GetClassName() {return "vlStructuredGridToPolyFilter";};
void PrintSelf(ostream& os, vlIndent indent);
void Modified();
unsigned long int GetMTime();
void Update();
};
#endif
......
......@@ -13,25 +13,25 @@ without the express written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
// .NAME vlStructuredGeometryFilter - extract geometry for structured data
// .NAME vlStructuredGridGeometryFilter - extract geometry for structured grid
// .SECTION Description
// vlStructuredGeometryFilter is a filter that extracts geometry from
// structured data. By specifying appropriate i-j-k indices, it is possible
// vlStructuredGridGeometryFilter is a filter that extracts geometry from a
// structured grid. By specifying appropriate i-j-k indices, it is possible
// to extract a point, a curve, a surface, or a "volume". Depending upon the
// type of data, the curve and surface may be curved or planar. The volume
// is actually a (n x m x o) region of points.
#ifndef __vlStructuredGeometryFilter_h
#define __vlStructuredGeometryFilter_h
#ifndef __vlStructuredGridGeometryFilter_h
#define __vlStructuredGridGeometryFilter_h
#include "SD2PolyF.hh"
#include "SG2PolyF.hh"
class vlStructuredGeometryFilter : public vlStructuredDataToPolyFilter
class vlStructuredGridGeometryFilter : public vlStructuredGridToPolyFilter
{
public:
vlStructuredGeometryFilter();
~vlStructuredGeometryFilter() {};
char *GetClassName() {return "vlStructuredGeometryFilter";};
vlStructuredGridGeometryFilter();
~vlStructuredGridGeometryFilter() {};
char *GetClassName() {return "vlStructuredGridGeometryFilter";};
void PrintSelf(ostream& os, vlIndent indent);
void SetExtent(int iMin, int iMax, int jMin, int jMax, int kMin, int kMax);
......
......@@ -13,23 +13,23 @@ without the express written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
// .NAME vlStructuredOutlineFilter - create wireframe outline for structured data
// .NAME vlStructuredGridOutlineFilter - create wireframe outline for structured grid
// .SECTION Description
// vlStructuredOutlineFilter is a filter that generates a wireframe outline of
// structured (i.e., topologically regular) data. Structured data is
// vlStructuredGridOutlineFilter is a filter that generates a wireframe
// outline of a structured grid (vlStructuredGrid). Structured data is
// topologically a cube, so the outline will have 12 "edges".
#ifndef __vlStructuredOutlineFilter_h
#define __vlStructuredOutlineFilter_h
#ifndef __vlStructuredGridOutlineFilter_h
#define __vlStructuredGridOutlineFilter_h
#include "SD2PolyF.hh"
#include "SG2PolyF.hh"
class vlStructuredOutlineFilter : public vlStructuredDataToPolyFilter
class vlStructuredGridOutlineFilter : public vlStructuredGridToPolyFilter
{
public:
vlStructuredOutlineFilter() {};
~vlStructuredOutlineFilter() {};
char *GetClassName() {return "vlStructuredOutlineFilter";};
vlStructuredGridOutlineFilter() {};
~vlStructuredGridOutlineFilter() {};
char *GetClassName() {return "vlStructuredGridOutlineFilter";};
protected:
void Execute();
......
......@@ -29,9 +29,12 @@ class vlStructuredPointsToPolyDataFilter : public vlPolyData,
public vlStructuredPointsFilter
{
public:
void Update();
char *GetClassName() {return "vlDataSetToPolyDataFilter";};
void PrintSelf(ostream& os, vlIndent indent);
void Modified();
unsigned long int GetMTime();
void Update();
};
#endif
......
......@@ -29,9 +29,12 @@ class vlStructuredPointsToStructuredPointsFilter : public vlStructuredPoints,
public vlStructuredPointsFilter
{
public:
void Update();
char *GetClassName() {return "vlDataSetToStructuredPointsFilter";};
void PrintSelf(ostream& os, vlIndent indent);
void Modified();
unsigned long int GetMTime();
void Update();
};
#endif
......
......@@ -28,10 +28,10 @@ vlAppendFilter::~vlAppendFilter()
// Add a dataset to the list of data to append.
void vlAppendFilter::AddInput(vlDataSet *ds)
{
if ( ! this->Input.IsItemPresent(ds) )
if ( ! this->InputList.IsItemPresent(ds) )
{
this->Modified();
this->Input.AddItem(ds);
this->InputList.AddItem(ds);
}
}
......@@ -39,10 +39,10 @@ void vlAppendFilter::AddInput(vlDataSet *ds)
// Remove a dataset from the list of data to append.
void vlAppendFilter::RemoveInput(vlDataSet *ds)
{
if ( this->Input.IsItemPresent(ds) )
if ( this->InputList.IsItemPresent(ds) )
{
this->Modified();
this->Input.RemoveItem(ds);
this->InputList.RemoveItem(ds);
}
}
......@@ -52,7 +52,7 @@ void vlAppendFilter::Update()
vlDataSet *ds;
// make sure input is available
if ( this->Input.GetNumberOfItems() < 1 )
if ( this->InputList.GetNumberOfItems() < 1 )
{
vlErrorMacro(<< "No input!\n");
return;
......@@ -62,7 +62,7 @@ void vlAppendFilter::Update()
if (this->Updating) return;
this->Updating = 1;
for (mtime=0, this->Input.InitTraversal(); ds = this->Input.GetNextItem(); )
for (mtime=0, this->InputList.InitTraversal(); ds = this->InputList.GetNextItem(); )
{
ds->Update();
ds_mtime = ds->GetMTime();
......@@ -102,7 +102,7 @@ void vlAppendFilter::Execute()
normalsPresent = 1;
tcoordsPresent = 1;
for ( this->Input.InitTraversal(); ds = this->Input.GetNextItem(); )
for ( this->InputList.InitTraversal(); ds = this->InputList.GetNextItem(); )
{
numPts += ds->GetNumberOfPoints();
numCells += ds->GetNumberOfCells();
......@@ -128,7 +128,7 @@ void vlAppendFilter::Execute()
newPts = new vlFloatPoints(numPts);
for ( ptOffset=0, this->Input.InitTraversal(); ds = this->Input.GetNextItem(); ptOffset+=numPts)
for ( ptOffset=0, this->InputList.InitTraversal(); ds = this->InputList.GetNextItem(); ptOffset+=numPts)
{
numPts = ds->GetNumberOfPoints();
numCells = ds->GetNumberOfCells();
......@@ -157,17 +157,10 @@ void vlAppendFilter::Execute()
void vlAppendFilter::PrintSelf(ostream& os, vlIndent indent)
{
if (this->ShouldIPrint(vlAppendFilter::GetClassName()))
{
this->PrintWatchOn(); // watch for multiple inheritance
vlUnstructuredGrid::PrintSelf(os,indent);
vlFilter::PrintSelf(os,indent);
os << indent << "Input DataSets:\n";
this->Input.PrintSelf(os,indent.GetNextIndent());
vlUnstructuredGrid::PrintSelf(os,indent);
vlFilter::_PrintSelf(os,indent);
this->PrintWatchOff(); // stop worrying about it now
}
os << indent << "Input DataSets:\n";
this->InputList.PrintSelf(os,indent.GetNextIndent());
}
......@@ -17,7 +17,6 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
vlAppendPolyData::vlAppendPolyData()
{
}
vlAppendPolyData::~vlAppendPolyData()
......@@ -28,10 +27,10 @@ vlAppendPolyData::~vlAppendPolyData()
// Add a dataset to the list of data to append.
void vlAppendPolyData::AddInput(vlPolyData *ds)
{
if ( ! this->Input.IsItemPresent(ds) )
if ( ! this->InputList.IsItemPresent(ds) )
{
this->Modified();
this->Input.AddItem(ds);
this->InputList.AddItem(ds);
}
}
......@@ -39,10 +38,10 @@ void vlAppendPolyData::AddInput(vlPolyData *ds)
// Remove a dataset from the list of data to append.
void vlAppendPolyData::RemoveInput(vlPolyData *ds)
{
if ( this->Input.IsItemPresent(ds) )
if ( this->InputList.IsItemPresent(ds) )
{
this->Modified();
this->Input.RemoveItem(ds);
this->InputList.RemoveItem(ds);
}
}
......@@ -52,7 +51,7 @@ void vlAppendPolyData::Update()
vlPolyData *pd;
// make sure input is available
if ( this->Input.GetNumberOfItems() < 1 )
if ( this->InputList.GetNumberOfItems() < 1 )
{
vlErrorMacro(<< "No input!\n");
return;
......@@ -62,7 +61,7 @@ void vlAppendPolyData::Update()
if (this->Updating) return;
this->Updating = 1;
for (mtime=0, this->Input.InitTraversal(); pd = this->Input.GetNextItem(); )
for (mtime=0, this->InputList.InitTraversal(); pd = this->InputList.GetNextItem(); )
{
pd->Update();
pd_mtime = pd->GetMTime();
......@@ -106,7 +105,7 @@ void vlAppendPolyData::Execute()
normalsPresent = 1;
tcoordsPresent = 1;
for ( this->Input.InitTraversal(); ds = this->Input.GetNextItem(); )
for ( this->InputList.InitTraversal(); ds = this->InputList.GetNextItem(); )
{
numPts += ds->GetNumberOfPoints();
numCells += ds->GetNumberOfCells();
......@@ -145,7 +144,7 @@ void vlAppendPolyData::Execute()
newStrips->Allocate(numCells*4);
// loop over all input sets
for ( ptOffset=0, this->Input.InitTraversal(); ds = this->Input.GetNextItem(); ptOffset+=numPts)
for ( ptOffset=0, this->InputList.InitTraversal(); ds = this->InputList.GetNextItem(); ptOffset+=numPts)
{
pd = ds->GetPointData();
......@@ -205,17 +204,10 @@ void vlAppendPolyData::Execute()
void vlAppendPolyData::PrintSelf(ostream& os, vlIndent indent)
{
if (this->ShouldIPrint(vlAppendPolyData::GetClassName()))
{
this->PrintWatchOn(); // watch for multiple inheritance
vlPolyData::PrintSelf(os,indent);
vlFilter::PrintSelf(os,indent);
vlPolyData::PrintSelf(os,indent);
vlFilter::_PrintSelf(os,indent);
os << indent << "Input DataSets:\n";
this->Input.PrintSelf(os,indent.GetNextIndent());
this->PrintWatchOff(); // stop worrying about it now
}
os << indent << "Input DataSets:\n";
this->InputList.PrintSelf(os,indent.GetNextIndent());
}
......@@ -39,14 +39,21 @@ vlBooleanStructuredPoints::~vlBooleanStructuredPoints()
{
}
unsigned long int vlBooleanStructuredPoints::GetMTime()
{
unsigned long dtime = this->vlStructuredPoints::GetMTime();
unsigned long ftime = this->vlFilter::_GetMTime();
return (dtime > ftime ? dtime : ftime);
}
// Description:
// Add another structured point set to the list of objects to boolean.
void vlBooleanStructuredPoints::AddInput(vlStructuredPoints *sp)
{
if ( ! this->Input.IsItemPresent(sp) )
if ( ! this->InputList.IsItemPresent(sp) )
{
this->Modified();
this->Input.AddItem(sp);
this->InputList.AddItem(sp);
}
}
......@@ -54,10 +61,10 @@ void vlBooleanStructuredPoints::AddInput(vlStructuredPoints *sp)
// Remove an object from the list of objects to boolean.
void vlBooleanStructuredPoints::RemoveInput(vlStructuredPoints *sp)
{
if ( this->Input.IsItemPresent(sp) )
if ( this->InputList.IsItemPresent(sp) )
{
this->Modified();
this->Input.RemoveItem(sp);
this->InputList.RemoveItem(sp);
}
}
......@@ -67,13 +74,13 @@ void vlBooleanStructuredPoints::Update()
vlDataSet *ds;
// make sure input is available
if ( this->Input.GetNumberOfItems() < 1 ) return;
if ( this->InputList.GetNumberOfItems() < 1 ) return;
// prevent chasing our tail
if (this->Updating) return;
this->Updating = 1;
for (mtime=0, this->Input.InitTraversal(); ds = this->Input.GetNextItem(); )
for (mtime=0, this->InputList.InitTraversal(); ds = this->InputList.GetNextItem(); )
{
ds->Update();
ds_mtime = ds->GetMTime();
......@@ -109,11 +116,11 @@ void vlBooleanStructuredPoints::InitializeBoolean()
this->ModelBounds[2] >= this->ModelBounds[3] ||
this->ModelBounds[4] >= this->ModelBounds[5] )
{
if ( this->Input.GetNumberOfItems() > 0 )
if ( this->InputList.GetNumberOfItems() > 0 )
{
this->ModelBounds[0] = this->ModelBounds[2] = this->ModelBounds[4] = LARGE_FLOAT;
this->ModelBounds[1] = this->ModelBounds[3] = this->ModelBounds[5] = -LARGE_FLOAT;
for ( this->Input.InitTraversal(); sp = this->Input.GetNextItem(); )
for ( this->InputList.InitTraversal(); sp = this->InputList.GetNextItem(); )
{
bounds = sp->GetBounds();
for (j=0; j < 3; j++)
......@@ -142,9 +149,9 @@ void vlBooleanStructuredPoints::InitializeBoolean()
}
// Create output scalar (same type as input)
if ( this->Input.GetNumberOfItems() > 0 )
if ( this->InputList.GetNumberOfItems() > 0 )
{
this->Input.InitTraversal(); sp = this->Input.GetNextItem();
this->InputList.InitTraversal(); sp = this->InputList.GetNextItem();
inScalars = sp->GetPointData()->GetScalars();
}
......@@ -167,7 +174,7 @@ void vlBooleanStructuredPoints::Execute()
this->InitializeBoolean();
for ( this->Input.InitTraversal(); sp = this->Input.GetNextItem(); )
for ( this->InputList.InitTraversal(); sp = this->InputList.GetNextItem(); )
{
this->Append(sp);
}
......@@ -246,18 +253,11 @@ void vlBooleanStructuredPoints::Append(vlStructuredPoints *sp)
void vlBooleanStructuredPoints::PrintSelf(ostream& os, vlIndent indent)
{
if (this->ShouldIPrint(vlBooleanStructuredPoints::GetClassName()))
{
this->PrintWatchOn(); // watch for multiple inheritance
vlStructuredPoints::PrintSelf(os,indent);
vlFilter::PrintSelf(os,indent);
os << indent << "Input DataSets:\n";
this->Input.PrintSelf(os,indent.GetNextIndent());
vlStructuredPoints::PrintSelf(os,indent);
vlFilter::_PrintSelf(os,indent);
this->PrintWatchOff(); // stop worrying about it now
}
os << indent << "Input DataSets:\n";
this->InputList.PrintSelf(os,indent.GetNextIndent());
}
// Description:
......
......@@ -33,7 +33,8 @@ vlCleanPolyData::~vlCleanPolyData()
void vlCleanPolyData::Execute()
{
int numPts=this->Input->GetNumberOfPoints();
vlPolyData *input=(vlPolyData *)this->Input;
int numPts=input->GetNumberOfPoints();
vlFloatPoints *newPts;
int numNewPts;
......@@ -42,21 +43,21 @@ void vlCleanPolyData::Execute()
int *Index;
int i, j, count;
int npts, *pts, updatedPts[MAX_CELL_SIZE];
vlCellArray *inVerts=this->Input->GetVerts(), *newVerts=NULL;
vlCellArray *inLines=this->Input->GetLines(), *newLines=NULL;
vlCellArray *inPolys=this->Input->GetPolys(), *newPolys=NULL;
vlCellArray *inStrips=this->Input->GetStrips(), *newStrips=NULL;
vlCellArray *inVerts=input->GetVerts(), *newVerts=NULL;
vlCellArray *inLines=input->GetLines(), *newLines=NULL;
vlCellArray *inPolys=input->GetPolys(), *newPolys=NULL;
vlCellArray *inStrips=input->GetStrips(), *newStrips=NULL;
vlDebugMacro(<<"Cleaning data");
this->Initialize();
if ( numPts < 1 || (inPts=this->Input->GetPoints()) == NULL )
if ( numPts < 1 || (inPts=input->GetPoints()) == NULL )
{
vlErrorMacro(<<"No data to clean!");
return;
}
pd = this->Input->GetPointData();
pd = input->GetPointData();
this->PointData.CopyAllocate(pd);
if ( this->Locator == NULL ) this->CreateDefaultLocator();
......@@ -64,7 +65,7 @@ void vlCleanPolyData::Execute()
this->Locator->SetPoints(inPts);
// compute absolute tolerance from relative given
this->Locator->SetTolerance(this->Tolerance*this->Input->GetLength());
this->Locator->SetTolerance(this->Tolerance*input->GetLength());
// compute merge list
Index = this->Locator->MergePoints();
......
......@@ -6,8 +6,6 @@
Date: $Date$
Version: $Revision$
Description:
---------------------------------------------------------------------------
This file is part of the Visualization Library. No part of this file
or its contents may be copied, reproduced or altered in any way
without the express written consent of the authors.
......@@ -47,6 +45,7 @@ void vlDividingCubes::Execute()
float len2;
vlCellArray *newVerts;