Commit 12947cd1 authored by Brad King's avatar Brad King

ENH: Three sweeping changes.

1.) vtkTypeRevisionMacro is now used in all VTK classes in place of
    vtkTypeMacro.  It invokes the original vtkTypeMacro and then adds
    a protected CollectRevisions method for future use in serialization.
    A corresponding vtkCxxRevisionMacro has been added to every .cxx file
    to implement the CollectRevisions method for each class.  This will
    allow collection of every class revision at run time.  Any new VTK class
    should use vtkTypeRevisionMacro instead of vtkTypeMacro.  The .cxx
    implementation should then have the following line:
      vtkCxxRevisionMacro(vtkFoo, "$Revision: 1.1 $");
    CVS should insert the correct revision number when the class is commited.

2.) vtkTypeMacro now also adds a typedef called "Superclass" to refer to
    the superclass of any VTK class.  All PrintSelf methods have been
    updated to call their superclass's PrintSelf like this:
      this->Superclass::PrintSelf(os,indent);
    This should reduce the number of places that refer to a superclass
    by its actual name.

3.) The standard ::New() method implementation has been replaced with a
    macro.  Instead of an explicitly written implementation to try the
    object factory and then call the new operator, VTK classes should
    instead use the following macro unless they have a special New() method:
      vtkStandardNewMacro(vtkFoo);
    This will implement the New() method in the standard way.  The line
    should appear in the .cxx implementation file, not in the header.
    Using the macro will make it easier to change the standard
    implementation of the method.

Also removed tabs from many files.
parent 316b9b16

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

......@@ -16,10 +16,13 @@ public:
{
}
vtkTypeMacro(vtkTestVertex,vtkVertex);
vtkTypeRevisionMacro(vtkTestVertex,vtkVertex);
static vtkTestVertex* New() { return new vtkTestVertex; }
vtkTestVertex() { }
};
vtkCxxRevisionMacro(vtkTestVertex, "1.13");
class vtkTestVertex2 : public vtkVertex
{
public:
......@@ -28,11 +31,13 @@ public:
}
// Methods from vtkObject
vtkTypeMacro(vtkTestVertex2,vtkVertex);
vtkTypeRevisionMacro(vtkTestVertex2,vtkVertex);
static vtkTestVertex2* New() { return new vtkTestVertex2; }
vtkTestVertex2() { }
};
vtkCxxRevisionMacro(vtkTestVertex2, "1.13");
VTK_CREATE_CREATE_FUNCTION(vtkTestVertex);
VTK_CREATE_CREATE_FUNCTION(vtkTestVertex2);
......
......@@ -69,9 +69,9 @@ void Test(ostream& strm)
polyVertex->CellBoundary (k, polyVertexCoords[j], ids);
strm << "vtkPolyVertex \t(" << polyVertexCoords[j][0] << ") \t= ";
for (i = 0; i < ids->GetNumberOfIds(); i++)
{
strm << ids->GetId(i) << ", ";
}
{
strm << ids->GetId(i) << ", ";
}
strm << endl;
}
}
......@@ -114,9 +114,9 @@ void Test(ostream& strm)
polyLine->CellBoundary (k, polyLineCoords[j], ids);
strm << "vtkPolyLine \t(" << polyLineCoords[j][0] << ") = \t";
for (i = 0; i < ids->GetNumberOfIds(); i++)
{
strm << ids->GetId(i) << ", ";
}
{
strm << ids->GetId(i) << ", ";
}
strm << endl;
}
}
......@@ -163,9 +163,9 @@ void Test(ostream& strm)
triangleStrip->CellBoundary (k, triangleStripCoords[j], ids);
strm << "vtkTriangleStrip \t(" << triangleStripCoords[j][0] << ", " << triangleStripCoords[j][1] << ") = \t";
for (i = 0; i < ids->GetNumberOfIds(); i++)
{
strm << ids->GetId(i) << ", ";
}
{
strm << ids->GetId(i) << ", ";
}
strm << endl;
}
}
......
......@@ -70,9 +70,9 @@ void Test(ostream& strm)
polyVertex->CellBoundary (k, polyVertexCoords[j], ids);
strm << "vtkPolyVertex \t(" << polyVertexCoords[j][0] << ") \t= ";
for (i = 0; i < ids->GetNumberOfIds(); i++)
{
strm << ids->GetId(i) << ", ";
}
{
strm << ids->GetId(i) << ", ";
}
strm << endl;
}
}
......@@ -115,9 +115,9 @@ void Test(ostream& strm)
polyLine->CellBoundary (k, polyLineCoords[j], ids);
strm << "vtkPolyLine \t(" << polyLineCoords[j][0] << ") = \t";
for (i = 0; i < ids->GetNumberOfIds(); i++)
{
strm << ids->GetId(i) << ", ";
}
{
strm << ids->GetId(i) << ", ";
}
strm << endl;
}
}
......@@ -164,9 +164,9 @@ void Test(ostream& strm)
triangleStrip->CellBoundary (k, triangleStripCoords[j], ids);
strm << "vtkTriangleStrip \t(" << triangleStripCoords[j][0] << ", " << triangleStripCoords[j][1] << ") = \t";
for (i = 0; i < ids->GetNumberOfIds(); i++)
{
strm << ids->GetId(i) << ", ";
}
{
strm << ids->GetId(i) << ", ";
}
strm << endl;
}
}
......
......@@ -324,8 +324,8 @@ void Test(ostream& strm)
vtkVoxel *voxel = vtkVoxel::New();
float voxelCoords[3], voxelWeights[8], voxelPosition[3];
float voxelPoint[9][3] = {{10, 10, 10}, {12, 10, 10}, {12, 12, 10}, {10, 12, 10},
{10, 10, 12}, {12, 10, 12}, {12, 12, 12}, {10, 12, 12},
{11, 11, 11}};
{10, 10, 12}, {12, 10, 12}, {12, 12, 12}, {10, 12, 12},
{11, 11, 11}};
float voxelClosest[3];
voxel->GetPointIds()->SetNumberOfIds(8);
......@@ -365,8 +365,8 @@ void Test(ostream& strm)
vtkHexahedron *hexahedron = vtkHexahedron::New();
float hexahedronCoords[3], hexahedronWeights[8], hexahedronPosition[3];
float hexahedronPoint[9][3] = {{10, 10, 10}, {12, 10, 10}, {12, 12, 10}, {10, 12, 10},
{10, 10, 12}, {12, 10, 12}, {12, 12, 12}, {10, 12, 12},
{11, 11, 11}};
{10, 10, 12}, {12, 10, 12}, {12, 12, 12}, {10, 12, 12},
{11, 11, 11}};
float hexahedronClosest[3];
hexahedron->GetPointIds()->SetNumberOfIds(8);
......
......@@ -83,12 +83,12 @@ void Test(ostream& strm)
for (j = 0; j < 20; j++)
{
for (i = 0; i < 20; i++)
{
shortScalars3D->InsertComponent(l,0,i);
shortScalars3D->InsertComponent(l,0,j);
shortScalars3D->InsertComponent(l,0,k);
l++;
}
{
shortScalars3D->InsertComponent(l,0,i);
shortScalars3D->InsertComponent(l,0,j);
shortScalars3D->InsertComponent(l,0,k);
l++;
}
}
}
......
......@@ -38,12 +38,12 @@ void Test(ostream& strm)
for (k = 0; k < 20; k++)
{
for (j = 0; j < 20; j++)
{
for (i = 0; i < 20; i++)
{
xyzpoints->InsertNextPoint((float) i, (float) j, (float) k);
}
}
{
for (i = 0; i < 20; i++)
{
xyzpoints->InsertNextPoint((float) i, (float) j, (float) k);
}
}
}
sg3D->SetDimensions(20,20,20);
sg3D->SetPoints(xyzpoints); xyzpoints->Delete();
......@@ -124,12 +124,12 @@ void Test(ostream& strm)
for (j = 0; j < 20; j++)
{
for (i = 0; i < 20; i++)
{
shortScalars3D->InsertComponent(l,0,i);
shortScalars3D->InsertComponent(l,0,j);
shortScalars3D->InsertComponent(l,0,k);
l++;
}
{
shortScalars3D->InsertComponent(l,0,i);
shortScalars3D->InsertComponent(l,0,j);
shortScalars3D->InsertComponent(l,0,k);
l++;
}
}
}
......
......@@ -17,7 +17,7 @@ struct vtkTestUtilities
// If slash is true, appends a slash to the resulting string.
// The returned string has to be deleted (with delete[]) by the user.
static char* ExpandDataFileName(int argc, char* argv[],
const char* fname,
const char* fname,
int slash = 0);
// Description:
// Function returning either a command line argument, an environment
......@@ -52,7 +52,7 @@ char* vtkTestUtilities::GetDataRoot(int argc, char* argv[])
}
char* vtkTestUtilities::ExpandDataFileName(int argc, char* argv[],
const char* fname,
const char* fname,
int slash)
{
return vtkTestUtilities::ExpandFileNameWithArgOrEnvOrDefault(
......
......@@ -44,6 +44,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "vtkObjectFactory.h"
#include "vtkPlanes.h"
vtkCxxRevisionMacro(vtkAbstractMapper, "1.22");
// Construct object.
vtkAbstractMapper::vtkAbstractMapper()
{
......@@ -122,7 +124,7 @@ void vtkAbstractMapper::SetClippingPlanes(vtkPlanes *planes)
vtkDataArray *vtkAbstractMapper::GetScalars(vtkDataSet *input,
int scalarMode,
int arrayAccessMode,
int arrayAccessMode,
int arrayId,
const char *arrayName,
int& offset)
......@@ -205,7 +207,7 @@ void vtkAbstractMapper::ShallowCopy(vtkAbstractMapper *mapper)
void vtkAbstractMapper::PrintSelf(ostream& os, vtkIndent indent)
{
this->vtkProcessObject::PrintSelf(os,indent);
this->Superclass::PrintSelf(os,indent);
os << indent << "TimeToDraw: " << this->TimeToDraw << "\n";
......
......@@ -73,7 +73,7 @@ class vtkDataSet;
class VTK_COMMON_EXPORT vtkAbstractMapper : public vtkProcessObject
{
public:
vtkTypeMacro(vtkAbstractMapper,vtkProcessObject);
vtkTypeRevisionMacro(vtkAbstractMapper,vtkProcessObject);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
......
......@@ -46,6 +46,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "vtkDebugLeaks.h"
#include "vtkCriticalSection.h"
vtkCxxRevisionMacro(vtkAbstractTransform, "1.20");
//----------------------------------------------------------------------------
vtkAbstractTransform::vtkAbstractTransform()
{
......@@ -76,7 +78,7 @@ vtkAbstractTransform::~vtkAbstractTransform()
//----------------------------------------------------------------------------