RE: cpp header file EulerAngles and SWIG

Date : Mon, 6 Feb 2006 11:07:57 -0500
To : <XSI(at)Softimage.COM>
From : "Luc-Eric Rousseau" <lucer(at)Softimage.COM>
Subject : RE: cpp header file EulerAngles and SWIG
Eul_ is not an error, it's just how the function is named.  It's a totally valid function name.  It's part of the Games SDK, perhaps you don't need it.
 
-----Original Message-----
From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM]On Behalf Of Halfdan Ingvarsson
Posted At: Sunday, February 05, 2006 8:07 AM
Posted To: xsi
Conversation: cpp header file EulerAngles and SWIG
Subject: RE: cpp header file EulerAngles and SWIG

Try to rename the function using either the %rename or %define directives in SWIG rather than directly renaming the function itself.
 
 - ½


From: owner-xsi(at)Softimage.COM on behalf of brad friedman
Sent: Sat 04-Feb-06 22:22
To: XSI(at)Softimage.COM
Subject: RE: cpp header file EulerAngles and SWIG

I neglected to mention that I experimented with this problem, and changing the name to something like: "Eul_Fred" gets rid of the syntax error.  Also, the next 3 or four lines are also XSICOREEXPORT lines and they wrap fine.  I have looked at the generated wrappers and indeed, the other XSICOREEXPORT lines parse and get wrapped.  I'm not sure if the generated code is valid... but I'm still generating.  I'll worry about compiling once I get generation under control.

Given that the code block is:

XSICOREEXPORT EulerAngles Eul_(float ai, float aj, float ah, int order);
XSICOREEXPORT Quat Eul_ToQuat(EulerAngles ea);
XSICOREEXPORT void Eul_ToHMatrix(EulerAngles ea, HMatrix M);
XSICOREEXPORT EulerAngles Eul_FromHMatrix(HMatrix M, int order);
XSICOREEXPORT EulerAngles Eul_FromQuat(Quat q, int order);
XSICOREEXPORT void Quat_ToHMatrix(Quat q, HMatrix M);

I would think there woul! d be at least some validity to the theory that the "Eul_" is an accidentally truncated name.

the argument that a trailing underscore is technically a valid function name may have merrit but it still looks like a mistake to me.

Should I then assume that the correct function call is, none the less, "Eul_", as compiled, and I'll be needing to submit a bug report to the SWIG project?

What is the best way to check the compiled code against the header to verify what my source code should call?

-brad

Luc-Eric Rousseau <lucer(at)Softimage.COM> wrote:
I doubt the underscor is the reas! on for the error, it's a completely valid name.
It's most likely the XSICOREEXPORT that's the problem (it generates __declspec(dllexport) ).  Try changing the definition of XSICOREXPORT to be defined to nothing instead.
 
------------------
Luc-Eric Rousseau
Team Leader, User Interface
Softimage|XSI
-----Original Message-----
From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM]On Behalf Of brad friedman
Posted At: Saturday, February 04, 2006 8:42 PM
Posted To: xsi
Conversation: cpp header file EulerAngles and SWIG
Subject: cpp header file EulerAngles and SWIG

I've been trying to make good on my promise to work on getting the CPP header files wrapped using SWIG.  I've been a tad busy though, so its been a while :)

Anyhow, I have been starting by trying to wrap the /core files first.  However, I have come across what may be a mistake in the header files.

Core/EulerAndgles.h line number 81:

XSICOREEXPORT EulerAngles Eul_(float ai, float aj, float ah, int order);

Swig throws this back at me as a syntax error.  Probably due to the trailing underscore at the end of the function name.  Also, it looks to me like the function name has been truncated.  I'm sure it was supposed to be something like "Eul_FromValues" or something like that.

So, what am I to do?  I'm fairly new to CPP.  My initial instinct is to look for some dump utilities to tel! l me the names of the entry points to the object files... so I can track down the correct name. ! Is that the best way to go about it?

Also, on a second note:  I noticed that the actual EulerAngles type is defined in the Core/QuatTypes.h file... which was strange to me.  But even more strange, is that its defined as being:

typedef Quat EulerAngles;    /* (x,y,z)=ang 1,2,3, w=order code  */

now perhaps this is just me being a CPP novice... but that's just plain weird to me.  A Euler is a Quat where the last float is forcibly cast as a unsigned int?  Is this some kind of speed optimization to help with converting a Euler to a Quat in place and visa versa?

This is also having strange effects with SWIG.  Swig notices that a Euler is just a Quat and peels it back to being just a Quat.  So functions that return Eulers end up returning Quats instead.  ! I was going to experiment with defining it myself before either header file is parsed but I'm worried about the effects of such meddling.

Thanks for any info.

-brad


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.