// PARAVIS : ParaView wrapper SALOME module
//
-// Copyright (C) 2010-2012 CEA/DEN, EDF R&D
+// Copyright (C) 2010-2013 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
AddAtomArg(I,Type,"char","Char",Result,CurrPos);
}
+void AddCharArrayArg(int I, ValueInfo* Type, char *Result, int *CurrPos) {
+ AddArrayArg(I,Type,"char",Result,CurrPos);
+}
+
void AddStringArg(int I, char *Result, int *CurrPos) {
#if defined(IDL_I_HH) || defined(IDL_I_CC)
add_to_sig(Result,"char ",CurrPos);
int IsShort(ValueInfo* theType) {
//return ((Type % 0x10) == 0x4 || (Type % 0x10) == 0x5 || (Type % 0x10) == 0xA);
int aVal = theType->Type & VTK_PARSE_BASE_TYPE;
- return (aVal == VTK_PARSE_SHORT) || (aVal == VTK_PARSE_INT) ||
- (aVal == VTK_PARSE_ID_TYPE) || (aVal == VTK_PARSE_UNSIGNED_INT) || (aVal == VTK_PARSE_UNSIGNED_SHORT) ||
+ return (aVal == VTK_PARSE_SHORT) || (aVal == VTK_PARSE_UNSIGNED_SHORT);
+}
+
+int IsInt(ValueInfo* theType) {
+ //return ((Type % 0x10) == 0x4 || (Type % 0x10) == 0x5 || (Type % 0x10) == 0xA);
+ int aVal = theType->Type & VTK_PARSE_BASE_TYPE;
+ return (aVal == VTK_PARSE_INT) ||
+ (aVal == VTK_PARSE_ID_TYPE) || (aVal == VTK_PARSE_UNSIGNED_INT) ||
(aVal == VTK_PARSE_SSIZE_T) || (aVal == VTK_PARSE_SIZE_T);
}
+int IsShortInt(ValueInfo* theType) {
+ //return ((Type % 0x10) == 0x4 || (Type % 0x10) == 0x5 || (Type % 0x10) == 0xA);
+ return (IsShort(theType) || IsInt(theType));
+}
+
void AddShortAtomArg(int I, ValueInfo* Type, char *Result, int *CurrPos) {
AddAtomArg(I,Type,"short","Short",Result,CurrPos);
}
return (IsShort(Type) && IsArray(Type));
}
+int IsIntArray(ValueInfo* Type) {
+ return (IsInt(Type) && IsArray(Type));
+}
+
void AddShortArrayArg(int I, ValueInfo* Type, char *Result, int *CurrPos) {
AddArrayArg(I,Type,"short",Result,CurrPos);
}
}
void AddTypeArray(ValueInfo* Type, char *Result, int *CurrPos) {
- if(IsShort(Type))
+ if(IsShortInt(Type))
add_to_sig(Result,"short",CurrPos);
if(IsLong(Type))
add_to_sig(Result,"long",CurrPos);
}
}
- if(IsShort(aType)) {
+ if(IsShortInt(aType)) {
if(IsArray(aType)) {
if (IsUnsigned(aType))
add_to_sig(result,"unsigned ",currPos);
add_to_sig(result,"char",currPos);
}
} else if(IsChar(aType)) {
- add_to_sig(result,"CORBA::Char",currPos);
+ if(IsArray(aType)) {
+ if (IsUnsigned(aType))
+ add_to_sig(result,"unsigned ",currPos);
+ add_to_sig(result,"char",currPos);
+ } else {
+ add_to_sig(result,"CORBA::Char",currPos);
+ }
}
if(IsBoolean(aType)) {
}
}
- if(IsShort(aType)) {
- if(IsShortArray(aType)) {
+ if(IsShortInt(aType)) {
+ if(IsArray(aType)) {
AddShortArrayArg(i,aType,result,currPos);
} else {
AddShortAtomArg(i,aType,result,currPos);
if(IsString(aType)) {
AddStringArg(i,result,currPos);
} else {
- AddCharAtomArg(i,aType,result,currPos);
+ if(IsCharArray(aType)) {
+ AddCharArrayArg(i,aType,result,currPos);
+ } else {
+ AddCharAtomArg(i,aType,result,currPos);
+ }
}
} else if (IsString(aType)) //!!! VSV
AddStringArg(i,result,currPos);
if(IsClass(aArgVal) && IsPtr(aArgVal)) {
add_to_sig(result,"*",&currPos);
}
- if (IsString(aArgVal) && IsConst(aArgVal))
+ if (IsString(aArgVal) && IsConst(aArgVal) && strcmp(aArgVal->Class, "vtkStdString") != 0)
sprintf(buf,"checkNullStr(myParam%d)",i);
else
sprintf(buf,"myParam%d",i);
if(IsDouble(aArgVal))
add_to_sig(result,"double",&currPos);
+ if(IsChar(aArgVal)) {
+ if (IsUnsigned(aArgVal))
+ add_to_sig(result,"unsigned ",&currPos);
+ add_to_sig(result,"char",&currPos);
+ }
+
if(IsvtkIdType(aArgVal)) {
if (IsUnsigned(aArgVal))
add_to_sig(result,"unsigned ",&currPos);
add_to_sig(result,"vtkIdType",&currPos);
} else {
- if(IsShort(aArgVal)) {
+ if(IsShortInt(aArgVal)) {
if (IsUnsigned(aArgVal))
add_to_sig(result,"unsigned ",&currPos);
add_to_sig(result,"int",&currPos);
if(IsDouble(aArgVal))
add_to_sig(result,"double",&currPos);
+ if(IsChar(aArgVal)) {
+ if (IsUnsigned(aArgVal))
+ add_to_sig(result,"unsigned ",&currPos);
+ add_to_sig(result,"char",&currPos);
+ }
+
if(IsvtkIdType(aArgVal)) {
if (IsUnsigned(aArgVal))
add_to_sig(result,"unsigned ",&currPos);
add_to_sig(result,"vtkIdType",&currPos);
} else {
- if(IsShort(aArgVal)) {
+ if(IsShortInt(aArgVal)) {
if (IsUnsigned(aArgVal))
add_to_sig(result,"unsigned ",&currPos);
add_to_sig(result,"int",&currPos);
}
}
- if(IsShort(aRetVal)) {
+ if(IsShortInt(aRetVal)) {
if(IsArray(aRetVal)) {
if(IsvtkIdType(aRetVal)) {
add_to_sig(result,"vtkIdType",&currPos);
} else {
- add_to_sig(result,"int",&currPos);
+ if(IsShort(aRetVal)) {
+ add_to_sig(result,"short",&currPos);
+ } else {
+ add_to_sig(result,"int",&currPos);
+ }
}
add_to_sig(result,"* a_ret = ",&currPos);
} else {
fprintf(fp,"#include \"PARAVIS_Gen_%s_i.hh\"\n",data->SuperClasses[i]);
}
+ //RNV: to avoid link error on windows via Visual Studio
+ //undef GetObject macro.
+ if( strcmp(data->Name, "vtkWebGLExporter") == 0 ) {
+ fprintf(fp,"#ifdef WIN32\n");
+ fprintf(fp," #ifdef GetObject\n");
+ fprintf(fp," #undef GetObject\n");
+ fprintf(fp," #endif\n");
+ fprintf(fp,"#endif\n");
+ }
+
fprintf(fp,"\nclass %s;\n",data->Name);
fprintf(fp,"\nnamespace PARAVIS\n{\n\n");
#elif defined(IDL_I_CC)