info-inventor-dev
[Top] [All Lists]

RE: OpenInventor on SUN, X error

To: "'jlim@xxxxxxxxxxxxxxxxxxxx'" <jlim@xxxxxxxxxxxxxxxxxxxx>
Subject: RE: OpenInventor on SUN, X error
From: "Connolly, Steven V." <connolsv@xxxxxxxx>
Date: Tue, 24 Apr 2001 09:23:26 -0400
Cc: "'info-inventor-dev@xxxxxxxxxxx'" <info-inventor-dev@xxxxxxxxxxx>
Sender: owner-info-inventor-dev@xxxxxxxxxxx
Jonathan,

    My Sun version appears to be working ok so far. Below is a list of the
final changes I made. I didnt see that anyone else had actually submitted
changes for the SUN workstations yet so I will try to send to you a copy of
the 10 files that I changed as an attachment in a separate email. It would
be great to have them merged with the originals.

 Most of the changes have been "#ifdef _sun" qualified but a couple havent.
These involve declaring a "char*" with "const" and should work anywhere. It
seemed silly to confine it to a sun version.

  I think the change to the definition of SbMat in "SbLinear.h" and
"SbMatrix.c++" should also not be confined to the sun version via "#ifdef
__sun" but since I do not have linux and sgi test cases to check results, I
qualified those changes. You may consider making those changes global. I
think that the more the versions are kept common, the easier it will be to
maintain in the long run. I suspect other compilers may have issues with
this. Maybe it should be qualified ("#ifdef") with something other than
"__sun".

   A similar argument goes with the "NO_OVERLAY_PLANES" option but since
this is a workaround and not a solution to the problem with overlay planes
on SUNs I wont argue either way. I have limited knowledge on that subject
and some one else could provide a more complete solution I'm sure. In any
event, unless "-DNO_OVERLAY_PLANES" is specified, the changes have no
affect.

 I hope these changes prove acceptable. 

At the time, it was easier for me to create my own Makefiles than to try to
change the current ones so I have no changes there. (There's 782 lines in
commondefs, 105 in commonrules, 127 in ivcommondefs, and 119 in
ivcommonrules. Is that necessary?)

 The compiler options that I used:

      -mt   -DSUN_OGL_NO_VERTEX_MACROS   -DNO_OVERLAY_PLANES  -DLIBRARYBUILD

 My final source code changes for running on SUN workstations:

1. inventor/lib/database/include/Inventor/SbBasic.h

added the following include (for floorf, sqrtf, cosf, etc):

#ifdef __sun
#include <sunmath.h>
#endif

 (so no need to compile with "-D_DOUBLE_MATH_ONLY")

2. inventor/lib/database/include/Inventor/SbLinear.h   (line 84)

redefined SbMat:

   #ifndef __sun   // svc
   typedef float SbMat[4][4];
   #endif

   /// svc
   #ifdef __sun
   struct  float4vector
      {  
      float vals[4][4]  ;
      float* operator[](int index) const { return (float*)
this->vals[index];}
      operator float*()            const { return (float*) this->vals[0]
;}
      }; 

   typedef float4vector SbMat ;
   #endif
 
3. inventor/lib/database/include/Inventor/SbTime.h   (line 139)
 
// outer ifndef added by svc SVC
#ifndef INT32_MAX
#ifndef __sgi
#define INT32_MAX INT_MAX
#endif // !__sgi
#endif
 
4. inventor/lib/database/src/sb/SbMatrix.c++     (line 594)
 
    // svc
#ifndef __sun
    float       d, invmat[4][4], temp;
#endif
#ifdef __sun
    float       d,               temp;
    SbMat          invmat            ;   
#endif
 
5. inventor/lib/database/src/so/SoInput.c++     (line 2813)
 
changed:
              char *firstPlus = strchr(n, '+');
to:
        const char *firstPlus = strchr(n, '+');
 
6. inventor/lib/database/src/so/nodes/nurbs/head/mymath.h
 
#ifdef __sun
#include <sunmath.h>
#endif
 
  (This change also worked when "types.h" was changed instead but "mymath.h"
seemed more relavent.)

7. inventor/lib/interaction/src/nodekits/SoInteractionKit.c++
 
   changed:        ("Error: Cannot use const char* to initialize char*.")
 
             char *dotPtr   = strchr( partName.getString(), '.' );
             char *brackPtr = strchr( partName.getString(), '[' );
 
   to:
       const char *dotPtr   = strchr( partName.getString(), '.' );
       const char *brackPtr = strchr( partName.getString(), '[' );
 
 
8. inventor/libSoXt/src/mixedMode/SoXtSlider.c++
 
   commented out the following line since stream.h could not be found:
 
     include <stream.h>
 
 
9. inventor/libSoXt/src/mtlEdit/SoXtMtlEdit.c++
 
    (added a "no overlay planes" option.  see p.366 "OpenGL Programming for
the X Window System" by M. Kilgard)
 
 added these lines:
 
     #ifdef NO_OVERLAY_PLANES
         pulldown = XmCreatePulldownMenu(menubar, "editPulldown", NULL, 0);
     #endif
 
     #ifndef NO_OVERLAY_PLANES
 
     ...
 
     #endif // no overlay planes.
 
10. inventor/libSoXt/src/viewers/SoXtFullVwr.c++
 
        (added a "no overlay planes" option)
 
 added these lines (in multiple locations):
 
     ifdef NO_OVERLAY_PLANES
          popupWidget = XmCreatePopupMenu(mgrWidget, "menu", NULL, 0);
     #endif // no overlay planes.
 
 
     #ifndef NO_OVERLAY_PLANES
     ...
     #endif // no overlay planes.
 

----------------------------------------------------------------------------
---------------

---------------------------  
   Steven Connolly
   CSC/Pratt & Whitney
   connolsv@xxxxxxxx
 ---------------------------

<Prev in Thread] Current Thread [Next in Thread>
  • RE: OpenInventor on SUN, X error, Connolly, Steven V. <=