Problem 1861 - Two Fixes to OpenInventor
Summary: Two Fixes to OpenInventor
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: visualization/OpenInventor (show other problems)
Version: 10.2
Hardware: All All
: P5 minor
Assignee: John.Allison
URL:
Depends on:
Blocks:
 
Reported: 2016-05-17 23:39 CEST by Tom Roberts
Modified: 2016-06-12 14:55 CEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Tom Roberts 2016-05-17 23:39:07 CEST
Coin3D is the suggested implementation of Open Inventor, but the Geant4 source does not compile with it on Windows. To fix:

in G4OpenInventorWin.cc, line 53:
    GetInteractorManager () -> 
           RemoveDispatcher((G4DispatchFunction)G4Win32::dispatchWin32Event);
becomes:
#if !defined(COIN_DLL) && !defined(COIN_NOT_DLL)
    GetInteractorManager () -> 
           RemoveDispatcher((G4DispatchFunction)G4Win32::dispatchWin32Event);
#endif

(Note that to get it to compile at all, the user must manually add one of those two preprocessor defines to the _G4OpenInventor-archive project in VisualStudio. Plus either SOWIN_DLL or SOWIN_NOT_DLL. The choice depends on how Coin3D was built. This should be documented.)



When transparency is used, the default rendering is both misleading and wrong. On all platforms. To fix:

G4OpenInventorWinViewer.cc: At the end of Initialise() add
    fViewer->setTransparencyType(SoGLRenderAction::SORTED_OBJECT_ADD);

G4OpenInventorXtViewer.cc: At the end of Initialise() add
    fViewer->setTransparencyType(SoGLRenderAction::SORTED_OBJECT_ADD);

(This does not affect rendering when no transparency is used, but makes a HUGE difference when it is. Note the user can still change the transparency rendering via the right-button menu; this just changes its initial value to be correct. I have no idea why they implemented several incorrect renderings, and made one the default.)
Comment 1 John.Allison 2016-06-12 14:55:44 CEST
Fixes submitted:

30 May 2016  John Allison (openinventor-V10-02-02)
- G4OpenInventorWin.cc: Fixed dispatching (Guy Barrand, Tom Roberts).
- G4OpenInventorXtViewer.cc, G4OpenInventorWinViewer.cc:
  setTransparencyType(SoGLRenderAction::SORTED_OBJECT_ADD).