Back to index

salome-paravis  6.5.0
Functions
vtkWrap.h File Reference
#include "vtkParse.h"
#include "vtkParseHierarchy.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define VTK_WRAP_RETURN   1
 vtkWrap provides useful functions for generating wrapping code.
#define VTK_WRAP_ARG   2
#define VTK_WRAP_NOSEMI   4

Functions

int vtkWrap_IsVTKObjectBaseType (HierarchyInfo *hinfo, const char *classname)
 Check whether the class is derived from vtkObjectBase.
int vtkWrap_IsSpecialType (HierarchyInfo *hinfo, const char *classname)
 Check if the WRAP_SPECIAL flag is set for the class.
int vtkWrap_IsTypeOf (HierarchyInfo *hinfo, const char *classname, const char *superclass)
 Check if the class is derived from superclass.
int vtkWrap_IsClassWrapped (HierarchyInfo *hinfo, const char *classname)
 Check whether a class is wrapped.
int vtkWrap_HasPublicDestructor (ClassInfo *data)
 Check whether the destructor is public.
int vtkWrap_HasPublicCopyConstructor (ClassInfo *data)
 Check whether the copy constructor is public.
void vtkWrap_ExpandTypedefs (ClassInfo *data, HierarchyInfo *hinfo)
 Expand all typedef types that are used in function arguments.
void vtkWrap_FindCountHints (ClassInfo *data, HierarchyInfo *hinfo)
 Apply any hints about array sizes, e.g.
void vtkWrap_FindNewInstanceMethods (ClassInfo *data, HierarchyInfo *hinfo)
 Apply any hints about methods that return a new object instance, i.e.
const char * vtkWrap_GetTypeName (ValueInfo *val)
 Get the name of a type.
int vtkWrap_IsConstructor (ClassInfo *c, FunctionInfo *f)
 True if the method a constructor of the class.
int vtkWrap_IsDestructor (ClassInfo *c, FunctionInfo *f)
 True if the method a destructor of the class.
int vtkWrap_IsSetVectorMethod (FunctionInfo *f)
 Check if a method is from a SetVector method.
int vtkWrap_IsGetVectorMethod (FunctionInfo *f)
 Check if a method is from a GetVector method.
int vtkWrap_CountWrappedArgs (FunctionInfo *f)
 Count the number of args that are wrapped.
int vtkWrap_CountRequiredArgs (FunctionInfo *f)
 Count the number of args that are required.
void vtkWrap_DeclareVariable (FILE *fp, ValueInfo *v, const char *name, int idx, int flags)
 Write a variable declaration to a file.
void vtkWrap_DeclareVariableSize (FILE *fp, ValueInfo *v, const char *name, int idx)
 Write an "int" size variable for arrays, initialized to the array size if the size is greater than zero.
int vtkWrap_IsVoid (ValueInfo *val)
 Check for common types.
int vtkWrap_IsVoidFunction (ValueInfo *val)
int vtkWrap_IsVoidPointer (ValueInfo *val)
int vtkWrap_IsCharPointer (ValueInfo *val)
int vtkWrap_IsVTKObject (ValueInfo *val)
int vtkWrap_IsSpecialObject (ValueInfo *val)
int vtkWrap_IsQtObject (ValueInfo *val)
int vtkWrap_IsQtEnum (ValueInfo *val)
int vtkWrap_IsObject (ValueInfo *val)
 The basic types, all are mutually exclusive.
int vtkWrap_IsFunction (ValueInfo *val)
int vtkWrap_IsStream (ValueInfo *val)
int vtkWrap_IsNumeric (ValueInfo *val)
int vtkWrap_IsString (ValueInfo *val)
int vtkWrap_IsBool (ValueInfo *val)
 Subcategories of numeric types.
int vtkWrap_IsChar (ValueInfo *val)
int vtkWrap_IsInteger (ValueInfo *val)
int vtkWrap_IsRealNumber (ValueInfo *val)
int vtkWrap_IsScalar (ValueInfo *val)
 Arrays and pointers.
int vtkWrap_IsPointer (ValueInfo *val)
int vtkWrap_IsArray (ValueInfo *val)
int vtkWrap_IsNArray (ValueInfo *val)
int vtkWrap_IsNonConstRef (ValueInfo *val)
 Properties that can combine with other properties.
int vtkWrap_IsConstRef (ValueInfo *val)
int vtkWrap_IsRef (ValueInfo *val)
int vtkWrap_IsConst (ValueInfo *val)
int vtkWrap_IsNewInstance (ValueInfo *val)
 Hints.

Define Documentation

#define VTK_WRAP_ARG   2

Definition at line 31 of file vtkWrap.h.

#define VTK_WRAP_NOSEMI   4

Definition at line 32 of file vtkWrap.h.

#define VTK_WRAP_RETURN   1

vtkWrap provides useful functions for generating wrapping code.

For use with vtkWrap_DeclareVariable.

Definition at line 30 of file vtkWrap.h.


Function Documentation

int vtkWrap_CountRequiredArgs ( FunctionInfo *  f)

Count the number of args that are required.

This counts to the last argument that does not have a default value. Array args are not allowed to have default values.

Definition at line 363 of file vtkWrap.c.

{
  int requiredArgs = 0;
  int totalArgs;
  int i;

  totalArgs = vtkWrap_CountWrappedArgs(f);

  for (i = 0; i < totalArgs; i++)
    {
    if (f->Arguments[i]->Value == NULL ||
        vtkWrap_IsArray(f->Arguments[i]) ||
        vtkWrap_IsNArray(f->Arguments[i]))
      {
      requiredArgs = i+1;
      }
    }

  return requiredArgs;
}

Here is the call graph for this function:

int vtkWrap_CountWrappedArgs ( FunctionInfo *  f)

Count the number of args that are wrapped.

This skips the "void *" argument that follows wrapped function pointer arguments.

Definition at line 343 of file vtkWrap.c.

{
  int totalArgs = f->NumberOfArguments;

  if (totalArgs > 0 &&
      (f->Arguments[0]->Type & VTK_PARSE_BASE_TYPE)
       == VTK_PARSE_FUNCTION)
    {
    totalArgs = 1;
    }
  else if (totalArgs == 1 &&
           (f->Arguments[0]->Type & VTK_PARSE_UNQUALIFIED_TYPE)
            == VTK_PARSE_VOID)
    {
    totalArgs = 0;
    }

  return totalArgs;
}

Here is the caller graph for this function:

void vtkWrap_DeclareVariable ( FILE *  fp,
ValueInfo *  v,
const char *  name,
int  idx,
int  flags 
)

Write a variable declaration to a file.

Void is automatically ignored, and nothing is written for function pointers Set "idx" to -1 to avoid writing an idx. Set "flags" to VTK_WRAP_RETURN to write a return value, or to VTK_WRAP_ARG to write a temp argument variable. The following rules apply:

  • if VTK_WRAP_NOSEMI is set, then no semicolon/newline is printed
  • if VTK_WRAP_RETURN is set, then "&" becomes "*"
  • if VTK_WRAP_ARG is set, "&" becomes "*" only for object types, and is removed for all other types.
  • "const" is removed except for return values with "&" or "*".

Definition at line 793 of file vtkWrap.c.

{
  unsigned int aType;
  int j;

  if (val == NULL)
    {
    return;
    }

  aType = (val->Type & VTK_PARSE_UNQUALIFIED_TYPE);

  /* do nothing for void */
  if (aType == VTK_PARSE_VOID ||
      (aType & VTK_PARSE_BASE_TYPE) == VTK_PARSE_FUNCTION)
    {
    return;
    }

  /* add a couple spaces */
  fprintf(fp,"  ");

  /* for const * return types, prepend with const */
  if ((flags & VTK_WRAP_RETURN) != 0)
    {
    if ((val->Type & VTK_PARSE_CONST) != 0 &&
        (aType & VTK_PARSE_INDIRECT) != 0)
      {
      fprintf(fp,"const ");
      }
    }
  /* do the same for "const char *" with initializer */
  else
    {
    if ((val->Type & VTK_PARSE_CONST) != 0 &&
        aType == VTK_PARSE_CHAR_PTR &&
        val->Value &&
        strcmp(val->Value, "0") != 0 &&
        strcmp(val->Value, "NULL") != 0)
      {
      fprintf(fp,"const ");
      }
    }

  /* print the type name */
  fprintf(fp, "%s ", vtkWrap_GetTypeName(val));

  /* indirection */
  if ((flags & VTK_WRAP_RETURN) != 0)
    {
    /* ref and pointer return values are stored as pointers */
    if ((aType & VTK_PARSE_INDIRECT) == VTK_PARSE_POINTER ||
        (aType & VTK_PARSE_INDIRECT) == VTK_PARSE_REF)
      {
      fprintf(fp, "*");
      }
    }
  else
    {
    /* objects refs and pointers are always handled via pointers,
     * other refs are passed by value */
    if (aType == VTK_PARSE_CHAR_PTR ||
        aType == VTK_PARSE_VOID_PTR ||
        aType == VTK_PARSE_OBJECT_PTR ||
        aType == VTK_PARSE_OBJECT_REF ||
        aType == VTK_PARSE_OBJECT ||
        vtkWrap_IsQtObject(val))
      {
      fprintf(fp, "*");
      }
    /* arrays of unknown size are handled via pointers */
    else if (val->CountHint)
      {
      fprintf(fp, "*");
      }
    }

  /* the variable name */
  if (i >= 0)
    {
    fprintf(fp,"%s%i", name, i);
    }
  else
    {
    fprintf(fp,"%s", name);
    }

  if ((flags & VTK_WRAP_ARG) != 0)
    {
    /* print the array decorators */
    if (((aType & VTK_PARSE_POINTER_MASK) != 0) &&
        aType != VTK_PARSE_CHAR_PTR &&
        aType != VTK_PARSE_VOID_PTR &&
        aType != VTK_PARSE_OBJECT_PTR &&
        !vtkWrap_IsQtObject(val) &&
        val->CountHint == NULL)
      {
      if (val->NumberOfDimensions == 1 && val->Count > 0)
        {
        fprintf(fp, "[%d]", val->Count);
        }
      else
        {
        for (j = 0; j < val->NumberOfDimensions; j++)
          {
          fprintf(fp, "[%s]", val->Dimensions[j]);
          }
        }
      }

    /* add a default value */
    else if (val->Value)
      {
      fprintf(fp, " = %s", val->Value);
      }
    else if (aType == VTK_PARSE_CHAR_PTR ||
             aType == VTK_PARSE_VOID_PTR ||
             aType == VTK_PARSE_OBJECT_PTR ||
             aType == VTK_PARSE_OBJECT_REF ||
             aType == VTK_PARSE_OBJECT ||
             vtkWrap_IsQtObject(val))
      {
      fprintf(fp, " = NULL");
      }
    else if (val->CountHint)
      {
      fprintf(fp, " = NULL");
      }
    else if (aType == VTK_PARSE_BOOL)
      {
      fprintf(fp, " = false");
      }
    }

  /* finish off with a semicolon */
  if ((flags & VTK_WRAP_NOSEMI) == 0)
    {
    fprintf(fp, ";\n");
    }
}

Here is the call graph for this function:

void vtkWrap_DeclareVariableSize ( FILE *  fp,
ValueInfo *  v,
const char *  name,
int  idx 
)

Write an "int" size variable for arrays, initialized to the array size if the size is greater than zero.

For N-dimensional arrays, write a static array of ints.

Definition at line 935 of file vtkWrap.c.

{
  char idx[32];
  int j;

  idx[0] = '\0';
  if (i >= 0)
    {
    sprintf(idx, "%d", i);
    }

  if (val->NumberOfDimensions > 1)
    {
    fprintf(fp,
            "  static int %s%s[%d] = ",
            name, idx, val->NumberOfDimensions);

    for (j = 0; j < val->NumberOfDimensions; j++)
      {
      fprintf(fp, "%c %s", ((j == 0) ? '{' : ','), val->Dimensions[j]);
      }

    fprintf(fp, " };\n");
    }
  else if (val->Count != 0 || val->CountHint)
    {
    fprintf(fp,
            "  %sint %s%s = %d;\n",
            (val->CountHint ? "" : "const "), name, idx,
            (val->CountHint ? 0 : val->Count));
    }
  else if (val->NumberOfDimensions == 1)
    {
    fprintf(fp,
            "  const int %s%s = %s;\n",
            name, idx, val->Dimensions[0]);
    }
}
void vtkWrap_ExpandTypedefs ( ClassInfo *  data,
HierarchyInfo hinfo 
)

Expand all typedef types that are used in function arguments.

This should be done before any wrapping is done, to make sure that the wrappers see the real types.

Definition at line 713 of file vtkWrap.c.

{
  int i, j, n;
  FunctionInfo *funcInfo;
  const char *newclass;

  n = data->NumberOfSuperClasses;
  for (i = 0; i < n; i++)
    {
    newclass = vtkParseHierarchy_ExpandTypedefsInName(
      hinfo, data->SuperClasses[i], NULL);
    if (newclass != data->SuperClasses[i])
      {
      data->SuperClasses[i] =
        vtkParse_DuplicateString(newclass, strlen(newclass));
      free((char *)newclass);
      }
    }

  n = data->NumberOfFunctions;
  for (i = 0; i < n; i++)
    {
    funcInfo = data->Functions[i];
    if (funcInfo->Access == VTK_ACCESS_PUBLIC)
      {
      for (j = 0; j < funcInfo->NumberOfArguments; j++)
        {
        vtkParseHierarchy_ExpandTypedefsInValue(
          hinfo, funcInfo->Arguments[j], data->Name);
        }
      if (funcInfo->ReturnValue)
        {
        vtkParseHierarchy_ExpandTypedefsInValue(
          hinfo, funcInfo->ReturnValue, data->Name);
        }
      }
    }
}

Here is the call graph for this function:

void vtkWrap_FindCountHints ( ClassInfo *  data,
HierarchyInfo hinfo 
)

Apply any hints about array sizes, e.g.

hint that the GetNumberOfComponents() method gives the tuple size.

Definition at line 542 of file vtkWrap.c.

{
  int i;
  const char *countMethod;
  const char *classname;
  FunctionInfo *theFunc;
  HierarchyEntry *entry;
  size_t m;
  char digit;

  /* add hints for array GetTuple methods */
  if (vtkWrap_IsTypeOf(hinfo, data->Name, "vtkDataArray"))
    {
    countMethod = "GetNumberOfComponents()";

    for (i = 0; i < data->NumberOfFunctions; i++)
      {
      theFunc = data->Functions[i];

      if ((strcmp(theFunc->Name, "GetTuple") == 0 ||
           strcmp(theFunc->Name, "GetTupleValue") == 0) &&
          theFunc->ReturnValue && theFunc->ReturnValue->Count == 0 &&
          theFunc->NumberOfArguments == 1 &&
          theFunc->Arguments[0]->Type == VTK_PARSE_ID_TYPE)
        {
        theFunc->ReturnValue->CountHint = countMethod;
        }
      else if ((strcmp(theFunc->Name, "SetTuple") == 0 ||
                strcmp(theFunc->Name, "SetTupleValue") == 0 ||
                strcmp(theFunc->Name, "GetTuple") == 0 ||
                strcmp(theFunc->Name, "GetTupleValue") == 0 ||
                strcmp(theFunc->Name, "InsertTuple") == 0 ||
                strcmp(theFunc->Name, "InsertTupleValue") == 0) &&
               theFunc->NumberOfArguments == 2 &&
               theFunc->Arguments[0]->Type == VTK_PARSE_ID_TYPE &&
               theFunc->Arguments[1]->Count == 0)
        {
        theFunc->Arguments[1]->CountHint = countMethod;
        }
      else if ((strcmp(theFunc->Name, "InsertNextTuple") == 0 ||
                strcmp(theFunc->Name, "InsertNextTupleValue") == 0) &&
               theFunc->NumberOfArguments == 1 &&
               theFunc->Arguments[0]->Count == 0)
        {
        theFunc->Arguments[0]->CountHint = countMethod;
        }
      }
    }

  /* add hints for interpolator Interpolate methods */
  if (vtkWrap_IsTypeOf(hinfo, data->Name, "vtkAbstractImageInterpolator"))
    {
    countMethod = "GetNumberOfComponents()";

    for (i = 0; i < data->NumberOfFunctions; i++)
      {
      theFunc = data->Functions[i];

      if (strcmp(theFunc->Name, "Interpolate") == 0 &&
           theFunc->NumberOfArguments == 2 &&
           theFunc->Arguments[0]->Type == (VTK_PARSE_DOUBLE_PTR|VTK_PARSE_CONST) &&
           theFunc->Arguments[0]->Count == 3 &&
           theFunc->Arguments[1]->Type == VTK_PARSE_DOUBLE_PTR &&
           theFunc->Arguments[1]->Count == 0)
        {
        theFunc->Arguments[1]->CountHint = countMethod;
        }
      }
    }

  for (i = 0; i < data->NumberOfFunctions; i++)
    {
    theFunc = data->Functions[i];

    /* hints for constructors that take arrays */
    if (vtkWrap_IsConstructor(data, theFunc) &&
        theFunc->NumberOfArguments == 1 &&
        vtkWrap_IsPointer(theFunc->Arguments[0]) &&
        vtkWrap_IsNumeric(theFunc->Arguments[0]) &&
        theFunc->Arguments[0]->Count == 0 &&
        hinfo)
      {
      entry = vtkParseHierarchy_FindEntry(hinfo, data->Name);
      if (entry && vtkParseHierarchy_IsTypeOfTemplated(
            hinfo, entry, data->Name, "vtkTuple", &classname))
        {
        /* attempt to get count from template parameter */
        if (classname)
          {
          m = strlen(classname);
          if (m > 2 && classname[m - 1] == '>' &&
              isdigit(classname[m-2]) && (classname[m-3] == ' ' ||
              classname[m-3] == ',' || classname[m-3] == '<'))
            {
            digit = classname[m-2];
            theFunc->Arguments[0]->Count = digit - '0';
            vtkParse_AddStringToArray(
              &theFunc->Arguments[0]->Dimensions,
              &theFunc->Arguments[0]->NumberOfDimensions,
              vtkParse_DuplicateString(&digit, 1));
            }
          free((char *)classname);
          }
        }
      }

    /* hints for operator[] index range */
    if (theFunc->IsOperator && theFunc->Name &&
        strcmp(theFunc->Name, "operator[]") == 0)
      {
      if (vtkWrap_IsTypeOf(hinfo, data->Name, "vtkTuple"))
        {
        theFunc->SizeHint = "GetSize()";
        }
      else if (vtkWrap_IsTypeOf(hinfo, data->Name, "vtkArrayCoordinates") ||
               vtkWrap_IsTypeOf(hinfo, data->Name, "vtkArrayExtents") ||
               vtkWrap_IsTypeOf(hinfo, data->Name, "vtkArraySort"))
        {
        theFunc->SizeHint = "GetDimensions()";
        }
      else if (vtkWrap_IsTypeOf(hinfo, data->Name, "vtkArrayExtentsList") ||
               vtkWrap_IsTypeOf(hinfo, data->Name, "vtkArrayWeights"))
        {
        theFunc->SizeHint = "GetCount()";
        }
      }
    }
}

Here is the call graph for this function:

void vtkWrap_FindNewInstanceMethods ( ClassInfo *  data,
HierarchyInfo hinfo 
)

Apply any hints about methods that return a new object instance, i.e.

factory methods and the like. Reference counts must be handled differently for such returned objects.

Definition at line 674 of file vtkWrap.c.

{
  int i;
  FunctionInfo *theFunc;

  for (i = 0; i < data->NumberOfFunctions; i++)
    {
    theFunc = data->Functions[i];
    if (theFunc->Name && theFunc->ReturnValue &&
        vtkWrap_IsVTKObject(theFunc->ReturnValue) &&
        vtkWrap_IsVTKObjectBaseType(hinfo, theFunc->ReturnValue->Class))
      {
      if (strcmp(theFunc->Name, "NewInstance") == 0 ||
          strcmp(theFunc->Name, "CreateInstance") == 0 ||
          (strcmp(theFunc->Name, "CreateImageReader2") == 0 &&
           strcmp(data->Name, "vtkImageReader2Factory") == 0) ||
          (strcmp(theFunc->Name, "CreateDataArray") == 0 &&
           strcmp(data->Name, "vtkDataArray") == 0) ||
          (strcmp(theFunc->Name, "CreateArray") == 0 &&
           strcmp(data->Name, "vtkAbstractArray") == 0) ||
          (strcmp(theFunc->Name, "CreateArray") == 0 &&
           strcmp(data->Name, "vtkArray") == 0) ||
          (strcmp(theFunc->Name, "GetQueryInstance") == 0 &&
           strcmp(data->Name, "vtkSQLDatabase") == 0) ||
          (strcmp(theFunc->Name, "CreateFromURL") == 0 &&
           strcmp(data->Name, "vtkSQLDatabase") == 0) ||
          (strcmp(theFunc->Name, "MakeTransform") == 0 &&
           vtkWrap_IsTypeOf(hinfo, data->Name, "vtkAbstractTransform")))
        {
        theFunc->ReturnValue->Type |= VTK_PARSE_NEWINSTANCE;
        }
      }
    }
}

Here is the call graph for this function:

const char* vtkWrap_GetTypeName ( ValueInfo *  val)

Get the name of a type.

The name will not include "const".

Definition at line 756 of file vtkWrap.c.

{
  unsigned int aType = val->Type;
  const char *aClass = val->Class;

  /* print the type itself */
  switch (aType & VTK_PARSE_BASE_TYPE)
    {
    case VTK_PARSE_FLOAT:          return "float";
    case VTK_PARSE_DOUBLE:         return "double";
    case VTK_PARSE_INT:            return "int";
    case VTK_PARSE_SHORT:          return "short";
    case VTK_PARSE_LONG:           return "long";
    case VTK_PARSE_VOID:           return "void ";
    case VTK_PARSE_CHAR:           return "char";
    case VTK_PARSE_UNSIGNED_INT:   return "unsigned int";
    case VTK_PARSE_UNSIGNED_SHORT: return "unsigned short";
    case VTK_PARSE_UNSIGNED_LONG:  return "unsigned long";
    case VTK_PARSE_UNSIGNED_CHAR:  return "unsigned char";
    case VTK_PARSE_ID_TYPE:        return "vtkIdType";
    case VTK_PARSE_LONG_LONG:      return "long long";
    case VTK_PARSE___INT64:        return "__int64";
    case VTK_PARSE_UNSIGNED_LONG_LONG: return "unsigned long long";
    case VTK_PARSE_UNSIGNED___INT64:   return "unsigned __int64";
    case VTK_PARSE_SIGNED_CHAR:    return "signed char";
    case VTK_PARSE_BOOL:           return "bool";
    case VTK_PARSE_UNICODE_STRING: return "vtkUnicodeString";
    case VTK_PARSE_SSIZE_T:        return "ssize_t";
    case VTK_PARSE_SIZE_T:         return "size_t";
    }

  return aClass;
}

Here is the caller graph for this function:

int vtkWrap_HasPublicCopyConstructor ( ClassInfo *  data)

Check whether the copy constructor is public.

Definition at line 517 of file vtkWrap.c.

{
  FunctionInfo *func;
  int i;

  for (i = 0; i < data->NumberOfFunctions; i++)
    {
    func = data->Functions[i];

    if (vtkWrap_IsConstructor(data, func) &&
        func->NumberOfArguments == 1 &&
        func->Arguments[0]->Class &&
        strcmp(func->Arguments[0]->Class, data->Name) == 0 &&
        func->Access != VTK_ACCESS_PUBLIC)
      {
      return 0;
      }
    }

  return 1;
}

Here is the call graph for this function:

int vtkWrap_HasPublicDestructor ( ClassInfo *  data)

Check whether the destructor is public.

Definition at line 496 of file vtkWrap.c.

{
  FunctionInfo *func;
  int i;

  for (i = 0; i < data->NumberOfFunctions; i++)
    {
    func = data->Functions[i];

    if (vtkWrap_IsDestructor(data, func) &&
        func->Access != VTK_ACCESS_PUBLIC)
      {
      return 0;
      }
    }

  return 1;
}

Here is the call graph for this function:

int vtkWrap_IsArray ( ValueInfo *  val)

Definition at line 209 of file vtkWrap.c.

{
  unsigned int i = (val->Type & VTK_PARSE_POINTER_MASK);
  return (i == VTK_PARSE_POINTER && val->NumberOfDimensions <= 1 &&
          (val->Count != 0 || val->CountHint != 0));
}

Here is the caller graph for this function:

int vtkWrap_IsBool ( ValueInfo *  val)

Subcategories of numeric types.

In this categorization, bool and char are not considered to be integers.

Definition at line 150 of file vtkWrap.c.

{
  unsigned int t = (val->Type & VTK_PARSE_BASE_TYPE);
  return (t == VTK_PARSE_BOOL);
}

Here is the caller graph for this function:

int vtkWrap_IsChar ( ValueInfo *  val)

Definition at line 156 of file vtkWrap.c.

{
  unsigned int t = (val->Type & VTK_PARSE_BASE_TYPE);
  return (t == VTK_PARSE_CHAR);
}

Here is the caller graph for this function:

int vtkWrap_IsCharPointer ( ValueInfo *  val)

Definition at line 48 of file vtkWrap.c.

{
  unsigned int t = (val->Type & VTK_PARSE_BASE_TYPE);
  return (t == VTK_PARSE_CHAR && vtkWrap_IsPointer(val));
}

Here is the call graph for this function:

Here is the caller graph for this function:

int vtkWrap_IsClassWrapped ( HierarchyInfo hinfo,
const char *  classname 
)

Check whether a class is wrapped.

If "hinfo" is NULL, it just checks that the class starts with "vtk".

Definition at line 469 of file vtkWrap.c.

{
  if (hinfo)
    {
    HierarchyEntry *entry;
    entry = vtkParseHierarchy_FindEntry(hinfo, classname);

    if (entry)
      {
      if (!vtkParseHierarchy_GetProperty(entry, "WRAP_EXCLUDE") ||
          vtkParseHierarchy_GetProperty(entry, "WRAP_SPECIAL"))
        {
        return 1;
        }
      }
    }
  else if (strncmp("vtk", classname, 3) == 0)
    {
    return 1;
    }

  return 0;
}

Here is the call graph for this function:

int vtkWrap_IsConst ( ValueInfo *  val)

Definition at line 255 of file vtkWrap.c.

{
  return ((val->Type & VTK_PARSE_CONST) != 0);
}

Here is the caller graph for this function:

int vtkWrap_IsConstRef ( ValueInfo *  val)

Definition at line 244 of file vtkWrap.c.

{
  return ((val->Type & VTK_PARSE_REF) != 0 &&
          (val->Type & VTK_PARSE_CONST) != 0);
}
int vtkWrap_IsConstructor ( ClassInfo *  c,
FunctionInfo *  f 
)

True if the method a constructor of the class.

Definition at line 271 of file vtkWrap.c.

{
  size_t i, m;
  const char *cp = c->Name;

  if (cp && f->Name && !vtkWrap_IsDestructor(c, f))
    {
    /* remove namespaces and template parameters from the name */
    m = vtkParse_UnscopedNameLength(cp);
    while (cp[m] == ':' && cp[m+1] == ':')
      {
      cp += m + 2;
      m = vtkParse_UnscopedNameLength(cp);
      }
    for (i = 0; i < m; i++)
      {
      if (cp[i] == '<')
        {
        break;
        }
      }

    return (i == strlen(f->Name) && strncmp(cp, f->Name, i) == 0);
    }

  return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int vtkWrap_IsDestructor ( ClassInfo *  c,
FunctionInfo *  f 
)

True if the method a destructor of the class.

Definition at line 300 of file vtkWrap.c.

{
  size_t i;
  const char *cp;

  if (c->Name && f->Name)
    {
    cp = f->Signature;
    for (i = 0; cp[i] != '\0' && cp[i] != '('; i++)
      {
      if (cp[i] == '~')
        {
        return 1;
        }
      }
    }

  return 0;
}

Here is the caller graph for this function:

int vtkWrap_IsFunction ( ValueInfo *  val)

Definition at line 102 of file vtkWrap.c.

{
  unsigned int t = (val->Type & VTK_PARSE_BASE_TYPE);
  return (t == VTK_PARSE_FUNCTION);
}

Here is the caller graph for this function:

int vtkWrap_IsGetVectorMethod ( FunctionInfo *  f)

Check if a method is from a GetVector method.

Definition at line 330 of file vtkWrap.c.

{
  if (f->Macro && strncmp(f->Macro, "vtkGetVector", 12) == 0)
    {
    return 1;
    }

  return 0;
}
int vtkWrap_IsInteger ( ValueInfo *  val)

Definition at line 162 of file vtkWrap.c.

{
  unsigned int t = (val->Type & VTK_PARSE_BASE_TYPE);

  if (t != VTK_PARSE_UNSIGNED_CHAR)
    {
    t = (t & ~VTK_PARSE_UNSIGNED);
    }
  switch (t)
    {
    case VTK_PARSE_SHORT:
    case VTK_PARSE_INT:
    case VTK_PARSE_LONG:
    case VTK_PARSE_ID_TYPE:
    case VTK_PARSE_LONG_LONG:
    case VTK_PARSE___INT64:
    case VTK_PARSE_UNSIGNED_CHAR:
    case VTK_PARSE_SIGNED_CHAR:
    case VTK_PARSE_SSIZE_T:
      return 1;
    }

  return 0;
}

Here is the caller graph for this function:

int vtkWrap_IsNArray ( ValueInfo *  val)

Definition at line 216 of file vtkWrap.c.

{
  int j = 0;
  unsigned int i = (val->Type & VTK_PARSE_POINTER_MASK);
  if (i != VTK_PARSE_ARRAY || val->NumberOfDimensions <= 1)
    {
    return 0;
    }
  for (j = 0; j < val->NumberOfDimensions; j++)
    {
    if (val->Dimensions[j] == NULL || val->Dimensions[j][0] == '\0')
      {
      return 0;
      }
    }
  return 1;
}

Here is the caller graph for this function:

int vtkWrap_IsNewInstance ( ValueInfo *  val)

Hints.

NewInstance objects must be freed by the caller.

Definition at line 263 of file vtkWrap.c.

{
  return ((val->Type & VTK_PARSE_NEWINSTANCE) != 0);
}
int vtkWrap_IsNonConstRef ( ValueInfo *  val)

Properties that can combine with other properties.

Definition at line 238 of file vtkWrap.c.

{
  return ((val->Type & VTK_PARSE_REF) != 0 &&
          (val->Type & VTK_PARSE_CONST) == 0);
}

Here is the caller graph for this function:

int vtkWrap_IsNumeric ( ValueInfo *  val)

Definition at line 115 of file vtkWrap.c.

{
  unsigned int t = (val->Type & VTK_PARSE_BASE_TYPE);

  t = (t & ~VTK_PARSE_UNSIGNED);
  switch (t)
    {
    case VTK_PARSE_FLOAT:
    case VTK_PARSE_DOUBLE:
    case VTK_PARSE_CHAR:
    case VTK_PARSE_SHORT:
    case VTK_PARSE_INT:
    case VTK_PARSE_LONG:
    case VTK_PARSE_ID_TYPE:
    case VTK_PARSE_LONG_LONG:
    case VTK_PARSE___INT64:
    case VTK_PARSE_SIGNED_CHAR:
    case VTK_PARSE_SSIZE_T:
    case VTK_PARSE_BOOL:
      return 1;
    }

  return 0;
}

Here is the caller graph for this function:

int vtkWrap_IsObject ( ValueInfo *  val)

The basic types, all are mutually exclusive.

Note that enums are considered to be objects, bool and char are considered to be numeric.

Definition at line 95 of file vtkWrap.c.

{
  unsigned int t = (val->Type & VTK_PARSE_BASE_TYPE);
  return (t == VTK_PARSE_OBJECT ||
          t == VTK_PARSE_QOBJECT);
}

Here is the caller graph for this function:

int vtkWrap_IsPointer ( ValueInfo *  val)

Definition at line 202 of file vtkWrap.c.

{
  unsigned int i = (val->Type & VTK_PARSE_POINTER_MASK);
  return (i == VTK_PARSE_POINTER && val->Count == 0 &&
          val->CountHint == 0 && val->NumberOfDimensions <= 1);
}

Here is the caller graph for this function:

int vtkWrap_IsQtEnum ( ValueInfo *  val)

Definition at line 80 of file vtkWrap.c.

{
  unsigned int t = (val->Type & VTK_PARSE_UNQUALIFIED_TYPE);
  if ((t == VTK_PARSE_QOBJECT || t == VTK_PARSE_QOBJECT_REF) &&
      val->Class[0] == 'Q' && strncmp("Qt::", val->Class, 4) == 0)
    {
    return 1;
    }
  return 0;
}
int vtkWrap_IsQtObject ( ValueInfo *  val)

Definition at line 69 of file vtkWrap.c.

{
  unsigned int t = (val->Type & VTK_PARSE_BASE_TYPE);
  if (t == VTK_PARSE_QOBJECT &&
      val->Class[0] == 'Q' && isupper(val->Class[1]))
    {
    return 1;
    }
  return 0;
}

Here is the caller graph for this function:

int vtkWrap_IsRealNumber ( ValueInfo *  val)

Definition at line 187 of file vtkWrap.c.

{
  unsigned int t = (val->Type & VTK_PARSE_BASE_TYPE);
  return (t == VTK_PARSE_FLOAT || t == VTK_PARSE_DOUBLE);
}

Here is the caller graph for this function:

int vtkWrap_IsRef ( ValueInfo *  val)

Definition at line 250 of file vtkWrap.c.

{
  return ((val->Type & VTK_PARSE_REF) != 0);
}
int vtkWrap_IsScalar ( ValueInfo *  val)

Arrays and pointers.

These are mutually exclusive. IsPointer() does not include pointers to pointers. IsArray() and IsNArray() do not include unsized arrays. Arrays of pointers are not included in any of these.

Definition at line 196 of file vtkWrap.c.

{
  unsigned int i = (val->Type & VTK_PARSE_POINTER_MASK);
  return (i == 0);
}
int vtkWrap_IsSetVectorMethod ( FunctionInfo *  f)

Check if a method is from a SetVector method.

Definition at line 320 of file vtkWrap.c.

{
  if (f->Macro && strncmp(f->Macro, "vtkSetVector", 12) == 0)
    {
    return 1;
    }

  return 0;
}

Here is the caller graph for this function:

int vtkWrap_IsSpecialObject ( ValueInfo *  val)

Definition at line 61 of file vtkWrap.c.

{
  unsigned int t = (val->Type & VTK_PARSE_UNQUALIFIED_TYPE);
  return ((t == VTK_PARSE_OBJECT ||
           t == VTK_PARSE_OBJECT_REF) &&
          val->Class[0] == 'v' && strncmp(val->Class, "vtk", 3) == 0);
}

Here is the caller graph for this function:

int vtkWrap_IsSpecialType ( HierarchyInfo hinfo,
const char *  classname 
)

Check if the WRAP_SPECIAL flag is set for the class.

If "hinfo" is NULL, it defaults to just checking if the class starts with "vtk" and returns -1 if so.

Definition at line 417 of file vtkWrap.c.

{
  HierarchyEntry *entry;

  if (hinfo)
    {
    entry = vtkParseHierarchy_FindEntry(hinfo, classname);
    if (entry && vtkParseHierarchy_GetProperty(entry, "WRAP_SPECIAL"))
      {
      return 1;
      }
    return 0;
    }

  /* fallback if no HierarchyInfo */
  if (strncmp("vtk", classname, 3) == 0)
    {
    return -1;
    }

  return 0;
}

Here is the call graph for this function:

int vtkWrap_IsStream ( ValueInfo *  val)

Definition at line 108 of file vtkWrap.c.

{
  unsigned int t = (val->Type & VTK_PARSE_BASE_TYPE);
  return (t == VTK_PARSE_ISTREAM ||
          t == VTK_PARSE_OSTREAM);
}

Here is the caller graph for this function:

int vtkWrap_IsString ( ValueInfo *  val)

Definition at line 140 of file vtkWrap.c.

{
  unsigned int t = (val->Type & VTK_PARSE_BASE_TYPE);
  return (t == VTK_PARSE_STRING ||
          t == VTK_PARSE_UNICODE_STRING);
}

Here is the caller graph for this function:

int vtkWrap_IsTypeOf ( HierarchyInfo hinfo,
const char *  classname,
const char *  superclass 
)

Check if the class is derived from superclass.

If "hinfo" is NULL, then only an exact match to the superclass will succeed.

Definition at line 444 of file vtkWrap.c.

{
  HierarchyEntry *entry;

  if (strcmp(classname, superclass) == 0)
    {
    return 1;
    }

  if (hinfo)
    {
    entry = vtkParseHierarchy_FindEntry(hinfo, classname);
    if (entry && vtkParseHierarchy_IsTypeOf(hinfo, entry, superclass))
      {
      return 1;
      }
    }

  return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int vtkWrap_IsVoid ( ValueInfo *  val)

Check for common types.

Definition at line 26 of file vtkWrap.c.

{
  if (val == 0)
    {
    return 1;
    }

  return ((val->Type & VTK_PARSE_UNQUALIFIED_TYPE) == VTK_PARSE_VOID);
}

Here is the caller graph for this function:

int vtkWrap_IsVoidFunction ( ValueInfo *  val)

Definition at line 36 of file vtkWrap.c.

{
  unsigned int t = (val->Type & VTK_PARSE_UNQUALIFIED_TYPE);
  return (t == VTK_PARSE_FUNCTION);
}

Here is the caller graph for this function:

int vtkWrap_IsVoidPointer ( ValueInfo *  val)

Definition at line 42 of file vtkWrap.c.

{
  unsigned int t = (val->Type & VTK_PARSE_BASE_TYPE);
  return (t == VTK_PARSE_VOID && vtkWrap_IsPointer(val));
}

Here is the call graph for this function:

Here is the caller graph for this function:

int vtkWrap_IsVTKObject ( ValueInfo *  val)

Definition at line 54 of file vtkWrap.c.

{
  unsigned int t = (val->Type & VTK_PARSE_UNQUALIFIED_TYPE);
  return (t == VTK_PARSE_OBJECT_PTR &&
          val->Class[0] == 'v' && strncmp(val->Class, "vtk", 3) == 0);
}

Here is the caller graph for this function:

int vtkWrap_IsVTKObjectBaseType ( HierarchyInfo hinfo,
const char *  classname 
)

Check whether the class is derived from vtkObjectBase.

If "hinfo" is NULL, this just checks that the class name starts with "vtk".

Definition at line 387 of file vtkWrap.c.

{
  HierarchyEntry *entry;

  if (hinfo)
    {
    entry = vtkParseHierarchy_FindEntry(hinfo, classname);
    if (entry)
      {
      if (vtkParseHierarchy_IsTypeOf(hinfo, entry, "vtkObjectBase"))
        {
        return 1;
        }
      return 0;
      }
    }

  /* fallback if no HierarchyInfo */
  if (strncmp("vtk", classname, 3) == 0)
    {
    return 1;
    }

  return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function: