[vtkusers] How to compile vtk for Python 2.0?

mrfx mrfx at 263.net
Wed Oct 18 22:51:17 EDT 2000


When I compiled vtk for Python 2.0, following error occured:

vtkImageDecomposeFilterPython.cxx
src\vtkImageDecomposeFilterPython.cxx(47) : error C2146: syntax error : missing ';' before identifier 'loop'
....

How to do it?

Following is the source of vtkImageDecomposeFilterPython.cxx

///////////////////////////////////////////////////////////////////
Into loop
/*
return(*yyfnd++); 1
=========================================================================

  Program:   Visualization Toolkit
  Module:    $RCSfile: vtkImageDecomposeFilter.h,v $
  Language:  C++
  Date:      $Date: 2000/02/04 17:08:16 $
  Version:   $Revision: 1.9 $
  Thanks:    Thanks to C. Charles Law who developed this class.

Copyright (c) 1993-2000 Ken Martin, Will Schroeder, Bill Lorensen 
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

 * Redistributions of source code must retain the above copyright notice,
   this list of conditions and the following disclaimer.

 * Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

 * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
   of any contributors may be used to endorse or promote products derived
   from this software without specific prior written permission.

 * Modified source versions must be plainly marked as such, and must not be
   misrepresented as being the original software.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

=========================================================================*/

return(*yyfnd++); 65
// .NAME vtkImageDecomposeFilter - Filters that execute axes in series.

return(*yyfnd++); 3


return(*yyfnd++); 65
// .SECTION Description

return(*yyfnd++); 4


return(*yyfnd++); 65
// This superclass molds the vtkImageIterateFilter superclass so

return(*yyfnd++); 10


return(*yyfnd++); 65
// it iterates over the axes.  The filter uses dimensionality to 

return(*yyfnd++); 10


return(*yyfnd++); 65
// determine how many axes to execute (starting from x).  

return(*yyfnd++); 10


return(*yyfnd++); 65
// The filter also provides convenience methods for permuting information

return(*yyfnd++); 10


return(*yyfnd++); 65
// retrieved from input, output and vtkImageData.

return(*yyfnd++); 10


return(*yyfnd++); 65


return(*yyfnd++); 9
#ifndef __vtkImageDecomposeFilter_h

return(*yyfnd++); 62


return(*yyfnd++); 65
#define __vtkImageDecomposeFilter_h

return(*yyfnd++); 62


return(*yyfnd++); 65


return(*yyfnd++); 9


return(*yyfnd++); 9
#include "vtkImageIterateFilter.h"

return(*yyfnd++); 62


return(*yyfnd++); 65


return(*yyfnd++); 9
class V
return(*yyfnd++); 21
 
return(*yyfnd++); 65
VTK_EXPORT 
return(*yyfnd++); 12
 
return(*yyfnd++); 65
vtkImageDecomposeFilter 
return(*yyfnd++); 63
 
return(*yyfnd++); 65
:
return(*yyfnd++); 68
 
return(*yyfnd++); 65
public 
return(*yyfnd++); 22
 
return(*yyfnd++); 65
vtkImageIterateFilter

return(*yyfnd++); 63


return(*yyfnd++); 65
{
return(*yyfnd++); 68


return(*yyfnd++); 65
public:
return(*yyfnd++); 22
:
return(*yyfnd++); 68


return(*yyfnd++); 65
  // Description:

return(*yyfnd++); 8


return(*yyfnd++); 65
  // Construct an instance of vtkImageDecomposeFilter fitler with default

return(*yyfnd++); 10


return(*yyfnd++); 65
  // dimensionality 3.

return(*yyfnd++); 10


return(*yyfnd++); 65
  s
return(*yyfnd++); 65
 
return(*yyfnd++); 65
static 
return(*yyfnd++); 37
 
return(*yyfnd++); 65
vtkImageDecomposeFilter 
return(*yyfnd++); 63
 
return(*yyfnd++); 65
*
return(*yyfnd++); 68
New(
return(*yyfnd++); 64
(
return(*yyfnd++); 68
)
return(*yyfnd++); 68
;
return(*yyfnd++); 68


return(*yyfnd++); 65
  v
return(*yyfnd++); 65
 
return(*yyfnd++); 65
vtkTypeMacro(
return(*yyfnd++); 59
(
return(*yyfnd++); 68
vtkImageDecomposeFilter,
return(*yyfnd++); 63
,
return(*yyfnd++); 68
vtkImageIterateFilter)
return(*yyfnd++); 63
)
return(*yyfnd++); 68
;
return(*yyfnd++); 68


return(*yyfnd++); 65
  v
return(*yyfnd++); 65
 
return(*yyfnd++); 65
void P
return(*yyfnd++); 30
 
return(*yyfnd++); 65
PrintSelf(
return(*yyfnd++); 64
(
return(*yyfnd++); 68
ostream&
return(*yyfnd++); 64
&
return(*yyfnd++); 68
 
return(*yyfnd++); 65
os,
return(*yyfnd++); 64
,
return(*yyfnd++); 68
 
return(*yyfnd++); 65
vtkIndent 
return(*yyfnd++); 63
 
return(*yyfnd++); 65
indent)
return(*yyfnd++); 64
)
return(*yyfnd++); 68
;
return(*yyfnd++); 68


return(*yyfnd++); 65


return(*yyfnd++); 9
  // Description:

return(*yyfnd++); 8


return(*yyfnd++); 65
  // Dimensionality is the number of axes which are considered durring

return(*yyfnd++); 10


return(*yyfnd++); 65
  // execution. To process images dimensionality would be set to 2.

return(*yyfnd++); 10


return(*yyfnd++); 65
  v
return(*yyfnd++); 65
 
return(*yyfnd++); 65
void S
return(*yyfnd++); 30
 
return(*yyfnd++); 65
SetDimensionality(
return(*yyfnd++); 64
(
return(*yyfnd++); 68
int d
return(*yyfnd++); 25
 
return(*yyfnd++); 65
dim)
return(*yyfnd++); 64
)
return(*yyfnd++); 68
;
return(*yyfnd++); 68


return(*yyfnd++); 65
  v
return(*yyfnd++); 65
 
return(*yyfnd++); 65
vtkGetMacro(
return(*yyfnd++); 39
(
return(*yyfnd++); 68
Dimensionality,
return(*yyfnd++); 64
,
return(*yyfnd++); 68
int)
return(*yyfnd++); 25
)
return(*yyfnd++); 68
;
return(*yyfnd++); 68


return(*yyfnd++); 65


return(*yyfnd++); 9
  // Description:

return(*yyfnd++); 8


return(*yyfnd++); 65
  // Obsolete legacy methods.

return(*yyfnd++); 10


return(*yyfnd++); 65
  v
return(*yyfnd++); 65
 
return(*yyfnd++); 65
void S
return(*yyfnd++); 30
 
return(*yyfnd++); 65
SetFilteredAxes(
return(*yyfnd++); 64
(
return(*yyfnd++); 68
int a
return(*yyfnd++); 25
 
return(*yyfnd++); 65
axis0)
return(*yyfnd++); 64
)
return(*yyfnd++); 68
;
return(*yyfnd++); 68


return(*yyfnd++); 65
  v
return(*yyfnd++); 65
 
return(*yyfnd++); 65
void S
return(*yyfnd++); 30
 
return(*yyfnd++); 65
SetFilteredAxes(
return(*yyfnd++); 64
(
return(*yyfnd++); 68
int a
return(*yyfnd++); 25
 
return(*yyfnd++); 65
axis0,
return(*yyfnd++); 64
,
return(*yyfnd++); 68
 
return(*yyfnd++); 65
int a
return(*yyfnd++); 25
 
return(*yyfnd++); 65
axis2)
return(*yyfnd++); 64
)
return(*yyfnd++); 68
;
return(*yyfnd++); 68


return(*yyfnd++); 65
  v
return(*yyfnd++); 65
 
return(*yyfnd++); 65
void S
return(*yyfnd++); 30
 
return(*yyfnd++); 65
SetFilteredAxes(
return(*yyfnd++); 64
(
return(*yyfnd++); 68
int a
return(*yyfnd++); 25
 
return(*yyfnd++); 65
axis0,
return(*yyfnd++); 64
,
return(*yyfnd++); 68
 
return(*yyfnd++); 65
int a
return(*yyfnd++); 25
 
return(*yyfnd++); 65
axis2,
return(*yyfnd++); 64
,
return(*yyfnd++); 68
 
return(*yyfnd++); 65
int a
return(*yyfnd++); 25
 
return(*yyfnd++); 65
axis3)
return(*yyfnd++); 64
)
return(*yyfnd++); 68
;
return(*yyfnd++); 68


return(*yyfnd++); 65


return(*yyfnd++); 9
  // Description:

return(*yyfnd++); 8


return(*yyfnd++); 65
  // Private methods kept public for template execute functions.

return(*yyfnd++); 10


return(*yyfnd++); 65
  v
return(*yyfnd++); 65
 
return(*yyfnd++); 65
void P
return(*yyfnd++); 30
 
return(*yyfnd++); 65
PermuteIncrements(
return(*yyfnd++); 64
(
return(*yyfnd++); 68
int *
return(*yyfnd++); 25
 
return(*yyfnd++); 65
*
return(*yyfnd++); 68
increments,
return(*yyfnd++); 64
,
return(*yyfnd++); 68
 
return(*yyfnd++); 65
int &
return(*yyfnd++); 25
 
return(*yyfnd++); 65
&
return(*yyfnd++); 68
inc0,
return(*yyfnd++); 64
,
return(*yyfnd++); 68
 
return(*yyfnd++); 65
int &
return(*yyfnd++); 25
 
return(*yyfnd++); 65
&
return(*yyfnd++); 68
inc1,
return(*yyfnd++); 64
,
return(*yyfnd++); 68
 
return(*yyfnd++); 65
int &
return(*yyfnd++); 25
 
return(*yyfnd++); 65
&
return(*yyfnd++); 68
inc2)
return(*yyfnd++); 64
)
return(*yyfnd++); 68
;
return(*yyfnd++); 68


return(*yyfnd++); 65
  v
return(*yyfnd++); 65
 
return(*yyfnd++); 65
void P
return(*yyfnd++); 30
 
return(*yyfnd++); 65
PermuteExtent(
return(*yyfnd++); 64
(
return(*yyfnd++); 68
int *
return(*yyfnd++); 25
 
return(*yyfnd++); 65
*
return(*yyfnd++); 68
extent,
return(*yyfnd++); 64
,
return(*yyfnd++); 68
 
return(*yyfnd++); 65
int &
return(*yyfnd++); 25
 
return(*yyfnd++); 65
&
return(*yyfnd++); 68
min0,
return(*yyfnd++); 64
,
return(*yyfnd++); 68
 
return(*yyfnd++); 65
int &
return(*yyfnd++); 25
 
return(*yyfnd++); 65
&
return(*yyfnd++); 68
max0,
return(*yyfnd++); 64
,
return(*yyfnd++); 68
 
return(*yyfnd++); 65
int &
return(*yyfnd++); 25
 
return(*yyfnd++); 65
&
return(*yyfnd++); 68
min1,
return(*yyfnd++); 64
,
return(*yyfnd++); 68
 
return(*yyfnd++); 65
int &
return(*yyfnd++); 25
 
return(*yyfnd++); 65
&
return(*yyfnd++); 68
max1,
return(*yyfnd++); 64
,
return(*yyfnd++); 68


return(*yyfnd++); 65
       i
return(*yyfnd++); 65
 
return(*yyfnd++); 65
 
return(*yyfnd++); 65
 
return(*yyfnd++); 65
 
return(*yyfnd++); 65
 
return(*yyfnd++); 65
 
return(*yyfnd++); 65
int &
return(*yyfnd++); 25
 
return(*yyfnd++); 65
&
return(*yyfnd++); 68
min2,
return(*yyfnd++); 64
,
return(*yyfnd++); 68
 
return(*yyfnd++); 65
int &
return(*yyfnd++); 25
 
return(*yyfnd++); 65
&
return(*yyfnd++); 68
max2)
return(*yyfnd++); 64
)
return(*yyfnd++); 68
;
return(*yyfnd++); 68


return(*yyfnd++); 65
  

return(*yyfnd++); 9
protected:
return(*yyfnd++); 24
:
return(*yyfnd++); 68


return(*yyfnd++); 65
  v
return(*yyfnd++); 65
 
return(*yyfnd++); 65
vtkImageDecomposeFilter(
return(*yyfnd++); 63
(
return(*yyfnd++); 68
)
return(*yyfnd++); 68
;
return(*yyfnd++); 68


return(*yyfnd++); 65
  ~
return(*yyfnd++); 65
 
return(*yyfnd++); 65
~
return(*yyfnd++); 68
vtkImageDecomposeFilter(
return(*yyfnd++); 63
(
return(*yyfnd++); 68
)
return(*yyfnd++); 68
 
return(*yyfnd++); 65
{
return(*yyfnd++); 68
}
return(*yyfnd++); 68
;
return(*yyfnd++); 68


return(*yyfnd++); 65
  v
return(*yyfnd++); 65
 
return(*yyfnd++); 65
vtkImageDecomposeFilter(
return(*yyfnd++); 63
(
return(*yyfnd++); 68
const 
return(*yyfnd++); 33
 
return(*yyfnd++); 65
vtkImageDecomposeFilter&
return(*yyfnd++); 63
&
return(*yyfnd++); 68
)
return(*yyfnd++); 68
 
return(*yyfnd++); 65
{
return(*yyfnd++); 68
}
return(*yyfnd++); 68
;
return(*yyfnd++); 68


return(*yyfnd++); 65
  v
return(*yyfnd++); 65
 
return(*yyfnd++); 65
void o
return(*yyfnd++); 30
 
return(*yyfnd++); 65
operator=
return(*yyfnd++); 34
=
return(*yyfnd++); 68
(
return(*yyfnd++); 68
const 
return(*yyfnd++); 33
 
return(*yyfnd++); 65
vtkImageDecomposeFilter&
return(*yyfnd++); 63
&
return(*yyfnd++); 68
)
return(*yyfnd++); 68
 
return(*yyfnd++); 65
{
return(*yyfnd++); 68
}
return(*yyfnd++); 68
;
return(*yyfnd++); 68


return(*yyfnd++); 65


return(*yyfnd++); 9
  i
return(*yyfnd++); 65
 
return(*yyfnd++); 65
int D
return(*yyfnd++); 25
 
return(*yyfnd++); 65
Dimensionality;
return(*yyfnd++); 64
;
return(*yyfnd++); 68


return(*yyfnd++); 65


return(*yyfnd++); 9


return(*yyfnd++); 9
}
return(*yyfnd++); 68
;
return(*yyfnd++); 68


return(*yyfnd++); 65


return(*yyfnd++); 9
#endif

return(*yyfnd++); 62


return(*yyfnd++); 65


return(*yyfnd++); 9


return(*yyfnd++); 9


return(*yyfnd++); 9


return(*yyfnd++); 9


return(*yyfnd++); 9


return(*yyfnd++); 9


return(*yyfnd++); 9


return(*yyfnd++); 9


return(*yyfnd++); 9


return(*yyfnd++); 9
 
yytext[0] == 0
  

Accept
// python wrapper for vtkImageDecomposeFilter object
//
#include "vtkImageDecomposeFilter.h"
#include "vtkPythonUtil.h"

PyObject *PyvtkImageIterateFilter_PyGetAttr(PyObject *self,char *name);
extern PyTypeObject PyvtkImageDecomposeFilterType;

extern void *vtkImageIterateFilter_Typecast(void *op,char *dType);

void *vtkImageDecomposeFilter_Typecast(void *me,char *dType)
{
  if (!strcmp("vtkImageDecomposeFilter",dType))
    {
    return me;
    }
  else
    {
    if (vtkImageIterateFilter_Typecast(((void *)((vtkImageIterateFilter *)me)),dType) != NULL)
      {
      return vtkImageIterateFilter_Typecast(((void *)((vtkImageIterateFilter *)me)),dType);
      }
    }
  return NULL;
}


static PyObject *PyvtkImageDecomposeFilter_GetClassName(PyObject *self, PyObject *args)
{
  int error;
  vtkImageDecomposeFilter *op;
  op = (vtkImageDecomposeFilter *)vtkPythonGetPointerFromObject(self,"vtkImageDecomposeFilter");

  /* handle an occurrence */
  {
  const char    *temp20;

  PyErr_Clear();
  error = 0;
  if (PyArg_ParseTuple(args, ""))
    {
    if (!error)
      {
      temp20 = op->GetClassName();
      return PyString_FromString(temp20);
      }
    }
  }
  return NULL;
}


static PyObject *PyvtkImageDecomposeFilter_SetDimensionality(PyObject *self, PyObject *args)
{
  int error;
  vtkImageDecomposeFilter *op;
  op = (vtkImageDecomposeFilter *)vtkPythonGetPointerFromObject(self,"vtkImageDecomposeFilter");

  /* handle an occurrence */
  {
  int      temp0;

  PyErr_Clear();
  error = 0;
  if (PyArg_ParseTuple(args, "i", &temp0))
    {
    if (!error)
      {
      op->SetDimensionality(temp0);
      Py_INCREF(Py_None);
      return Py_None;
      }
    }
  }
  return NULL;
}


static PyObject *PyvtkImageDecomposeFilter_GetDimensionality(PyObject *self, PyObject *args)
{
  int error;
  vtkImageDecomposeFilter *op;
  op = (vtkImageDecomposeFilter *)vtkPythonGetPointerFromObject(self,"vtkImageDecomposeFilter");

  /* handle an occurrence */
  {
  int      temp20;

  PyErr_Clear();
  error = 0;
  if (PyArg_ParseTuple(args, ""))
    {
    if (!error)
      {
      temp20 = op->GetDimensionality();
      return PyInt_FromLong(temp20);
      }
    }
  }
  return NULL;
}


static PyObject *PyvtkImageDecomposeFilter_SetFilteredAxes(PyObject *self, PyObject *args)
{
  int error;
  vtkImageDecomposeFilter *op;
  op = (vtkImageDecomposeFilter *)vtkPythonGetPointerFromObject(self,"vtkImageDecomposeFilter");

  /* handle an occurrence */
  {
  int      temp0;

  PyErr_Clear();
  error = 0;
  if (PyArg_ParseTuple(args, "i", &temp0))
    {
    if (!error)
      {
      op->SetFilteredAxes(temp0);
      Py_INCREF(Py_None);
      return Py_None;
      }
    }
  }
  /* handle an occurrence */
  {
  int      temp0;
  int      temp1;

  PyErr_Clear();
  error = 0;
  if (PyArg_ParseTuple(args, "ii", &temp0, &temp1))
    {
    if (!error)
      {
      op->SetFilteredAxes(temp0,temp1);
      Py_INCREF(Py_None);
      return Py_None;
      }
    }
  }
  /* handle an occurrence */
  {
  int      temp0;
  int      temp1;
  int      temp2;

  PyErr_Clear();
  error = 0;
  if (PyArg_ParseTuple(args, "iii", &temp0, &temp1, &temp2))
    {
    if (!error)
      {
      op->SetFilteredAxes(temp0,temp1,temp2);
      Py_INCREF(Py_None);
      return Py_None;
      }
    }
  }
  return NULL;
}

static PyMethodDef PyvtkImageDecomposeFilterMethods[] = {
  {"GetClassName",  (PyCFunction)PyvtkImageDecomposeFilter_GetClassName, 1},
  {"SetDimensionality",  (PyCFunction)PyvtkImageDecomposeFilter_SetDimensionality, 1},
  {"GetDimensionality",  (PyCFunction)PyvtkImageDecomposeFilter_GetDimensionality, 1},
  {"SetFilteredAxes",  (PyCFunction)PyvtkImageDecomposeFilter_SetFilteredAxes, 1},
  {NULL,         NULL}
};

extern int PyvtkImageIterateFilter_PyPrint(PyObject *,FILE *,int);
int PyvtkImageDecomposeFilter_PyPrint(PyObject *self, FILE *fp, int)
{
  return PyvtkImageIterateFilter_PyPrint(self, fp, 0);
}

extern PyObject *PyvtkImageIterateFilter_PyRepr(PyObject *);
PyObject *PyvtkImageDecomposeFilter_PyRepr(PyObject *self)
{
  return PyvtkImageIterateFilter_PyRepr(self);
}

static void PyvtkImageDecomposeFilter_PyDelete(PyObject *self)
{
  vtkImageDecomposeFilter *op;
  op = (vtkImageDecomposeFilter *)vtkPythonGetPointerFromObject(self,"vtkImageDecomposeFilter");
  vtkPythonDeleteObjectFromHash(self);
  op->Delete();
  PyMem_DEL(self);
}

PyObject *PyvtkImageDecomposeFilter_PyGetAttr(PyObject *self, char *name)
{
  PyObject *result;

  result = Py_FindMethod(PyvtkImageDecomposeFilterMethods, self, name);
  if (!result) return PyvtkImageIterateFilter_PyGetAttr(self,name);
  return result;
}

PyTypeObject PyvtkImageDecomposeFilterType = {
  PyObject_HEAD_INIT(NULL)
  0,
  "vtkImageDecomposeFilter",sizeof(PyObject),
  0,
  (destructor)PyvtkImageDecomposeFilter_PyDelete,
   (printfunc)PyvtkImageDecomposeFilter_PyPrint,
  (getattrfunc)PyvtkImageDecomposeFilter_PyGetAttr,
  0, 0, (reprfunc)PyvtkImageDecomposeFilter_PyRepr, 0, 0, 0,
};

static PyObject *PyvtkImageDecomposeFilter_PyNew(PyObject *vtkNotUsed(self),PyObject *vtkNotUsed(args))
  {
  PyObject *obj;

  if ((obj = PyObject_NEW(PyObject, &PyvtkImageDecomposeFilterType)) == NULL)
    return NULL;

  vtkPythonAddObjectToHash(obj,(void *)(vtkImageDecomposeFilter::New()),(void *)vtkImageDecomposeFilter_Typecast);
  return obj;
}

static PyMethodDef PyvtkImageDecomposeFilter_ClassMethods[] = {
  {"New", (PyCFunction)PyvtkImageDecomposeFilter_PyNew},
  {NULL, NULL}
};

extern "C" { void initvtkImageDecomposeFilter();}
void initvtkImageDecomposeFilter()
{
  Py_InitModule("vtkImageDecomposeFilter", PyvtkImageDecomposeFilter_ClassMethods);
}


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20001019/ce84389f/attachment.htm>


More information about the vtkusers mailing list