Commit ead196b8 authored by David Gobbi's avatar David Gobbi Committed by Marcus D. Hanwell
Browse files

COMP: Add some header-file exceptions to vtkParse.c

In general, header files are named after the main class inside them,
but sometimes a header file contains multiple class definitions.
I have added a map for some of these extra classes to the header
files that contain them.  Down the road, I will have the wrappers
generate a list of the exceptions automatically.
parent 79307d76
......@@ -2709,6 +2709,34 @@ static void vtkWrapPython_ClassDoc(
static void vtkWrapPython_GenerateSpecialHeaders(
FILE *fp, FileInfo *data)
{
/* Some special types aren't in header files named after themselves. */
/* Later, the wrappers will find these exceptions automatically. */
const char *headers[][2] = {
{ "vtkCollectionSimpleIterator", "vtkCollection" },
{ "vtkLibHandle", "vtkDynamicLoader" },
{ "vtkMultiThreaderIDType", "vtkMultiThreader" },
{ "vtkThreadFunctionType", "vtkMultiThreader" },
{ "vtkEdgeType", "vtkGraph" },
{ "vtkInEdgeType", "vtkGraph" },
{ "vtkOutEdgeType", "vtkGraph" },
{ "vtkVertexPedigreeIdDistribution", "vtkDistributedGraphHelper" },
{ "vtkOpenGLExtensionManagerFunctionPointer", "vtkOpenGLExtensionManager"},
{ "vtkExodusIICacheKey", "vtkExodusIICache" },
{ "vtkProcessFunctionType", "vtkMultiProcessController" },
{ "vtkRMIFunctionType", "vtkMultiProcessController" },
{ "vtkContextMouseEvent", "vtkBlockItem" },
{ "vtkColor3ub", "vtkColor" }, { "vtkColor4ub", "vtkColor" },
{ "vtkColor3f", "vtkColor" }, { "vtkColor4f", "vtkColor" },
{ "vtkColor3d", "vtkColor" }, { "vtkColor4d", "vtkColor" },
{ "vtkVector2i", "vtkVector" }, { "vtkVector3i", "vtkVector" },
{ "vtkVector2f", "vtkVector" }, { "vtkVector3f", "vtkVector" },
{ "vtkVector2f", "vtkVector" }, { "vtkVector3d", "vtkVector" },
{ "vtkRect", "vtkVector" }, { "vtkRecti", "vtkVector" },
{ "vtkRectf", "vtkVector" }, { "vtkRectd", "vtkVector" },
{ "vtkValue", "vtkDataValue" },
{ 0, 0 }
};
const char *types[1000];
int numTypes = 0;
FunctionInfo *currentFunction;
......@@ -2772,10 +2800,23 @@ static void vtkWrapPython_GenerateSpecialHeaders(
}
for (i = 0; i < numTypes; i++)
{
const char *incfile = types[i];
for (j = 0; headers[j][0] != 0; j++)
{
if (strcmp(types[i], headers[j][0]) == 0)
{
incfile = headers[j][1];
break;
}
}
if (strcmp(incfile, data->ClassName) != 0)
{
fprintf(fp,
"#include \"%s.h\"\n",
types[i]);
incfile);
}
}
}
......
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