| Summary: | Two Fixes to OpenInventor | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | Tom Roberts <tjrob> |
| Component: | visualization/OpenInventor | Assignee: | John.Allison |
| Status: | RESOLVED FIXED | ||
| Severity: | minor | CC: | john.allison |
| Priority: | P5 | ||
| Version: | 10.2 | ||
| Hardware: | All | ||
| OS: | All | ||
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). |
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.)