RE: cpp header file EulerAngles and SWIG
| Date : Mon, 6 Feb 2006 09:45:11 -0800 (PST) |
| To : XSI(at)Softimage.COM |
| From : brad friedman <xsibrad(at)fie.us> |
| Subject : RE: cpp header file EulerAngles and SWIG |
I intend to wrap the core math library, the full XSI library, and the FTK... To be comprehensive.
Also, the core library seemed smaller and more self containted. Therefore, it seems an easier start.
What is odd to me, is that we're both right about how to fix it. Both, renaming the function to something that doesn't trail a "_", and defining XSICOREEXPORT to null ahead of time allow swig to get over the syntax error. I wonder if the XSICOREEXPORT definition is something that SWIG understands, and it understands function names to be more restrictive under those conditions?
Odd...
That said, I have been able to get a full Wrap and am now working on compiling the wrap. Also, Halfdan's suggestion of the swig rename directive will hopefully allow me to wrap the operators correctly, which currently, it ignores in most language modules.
Crossing my fingers...
I am still a bit currious as to the Quat and Euler definitions though. Do you know the reasoning behind it?
-brad
Luc-Eric Rousseau <lucer(at)Softimage.COM> wrote:
Also, the core library seemed smaller and more self containted. Therefore, it seems an easier start.
What is odd to me, is that we're both right about how to fix it. Both, renaming the function to something that doesn't trail a "_", and defining XSICOREEXPORT to null ahead of time allow swig to get over the syntax error. I wonder if the XSICOREEXPORT definition is something that SWIG understands, and it understands function names to be more restrictive under those conditions?
Odd...
That said, I have been able to get a full Wrap and am now working on compiling the wrap. Also, Halfdan's suggestion of the swig rename directive will hopefully allow me to wrap the operators correctly, which currently, it ignores in most language modules.
Crossing my fingers...
I am still a bit currious as to the Quat and Euler definitions though. Do you know the reasoning behind it?
-brad
Luc-Eric Rousseau <lucer(at)Softimage.COM> wrote:
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 Hallfdan 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 SWIGTry 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 SWIGI 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-----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 :)
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
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
- Follow-Ups:
- Re: cpp header file EulerAngles and SWIG
- From: Aloys Baillet <aloys.baillet(at)gmail.com>
- Re: cpp header file EulerAngles and SWIG
- References:
- RE: cpp header file EulerAngles and SWIG
- From: "Luc-Eric Rousseau" <lucer(at)Softimage.COM>
- RE: cpp header file EulerAngles and SWIG
| DATE: | << | >> | THREAD: | << | >> | INDEX: | Main | Thread |
|---|
- Previous by Date: weird shape manager viewport rotation issue
- Next by Date: weird shape manager viewport rotation issue
- Previous by Thread: weird shape manager viewport rotation issue
- Next by Thread: weird shape manager viewport rotation issue
- Index(es):
| Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available. |