Geant4-11
Public Types | Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes
G4OpenInventorXt Class Reference

#include <G4OpenInventorXt.hh>

Inheritance diagram for G4OpenInventorXt:
G4OpenInventor G4VGraphicsSystem G4OpenInventorX

Public Types

enum  Functionality {
  noFunctionality , nonEuclidian , twoD , twoDStore ,
  threeD , threeDInteractive , virtualReality , fileWriter
}
 

Public Member Functions

void AddNickname (const G4String &nickname)
 
G4VSceneHandlerCreateSceneHandler (const G4String &name)
 
G4VViewerCreateViewer (G4VSceneHandler &, const G4String &name="")
 
 G4OpenInventorXt ()
 
const G4StringGetDescription () const
 
Functionality GetFunctionality () const
 
G4VInteractorManagerGetInteractorManager ()
 
const G4StringGetName () const
 
const G4StringGetNickname () const
 
const std::vector< G4String > & GetNicknames () const
 
void InitNodes ()
 
G4bool IsUISessionCompatible () const
 
void SetInteractorManager (G4VInteractorManager *)
 
virtual ~G4OpenInventorXt ()
 

Protected Attributes

G4String fDescription
 
Functionality fFunctionality
 
G4String fName
 
std::vector< G4StringfNicknames
 

Private Member Functions

virtual void Initialize ()
 

Private Attributes

bool fInited
 
G4VInteractorManagerinteractorManager
 

Detailed Description

Definition at line 37 of file G4OpenInventorXt.hh.

Member Enumeration Documentation

◆ Functionality

Enumerator
noFunctionality 
nonEuclidian 
twoD 
twoDStore 
threeD 
threeDInteractive 
virtualReality 
fileWriter 

Definition at line 49 of file G4VGraphicsSystem.hh.

49 {
51 ,nonEuclidian // e.g., tree representation of geometry hierarchy.
52 ,twoD // Simple 2D, e.g., X (no stored structures).
53 ,twoDStore // 2D with stored structures.
54 ,threeD // Passive 3D (with stored structures).
55 ,threeDInteractive // 3D with "pick" functionality.
56 ,virtualReality // Virtual Reality functionality.
57 ,fileWriter // File writer
58 };

Constructor & Destructor Documentation

◆ G4OpenInventorXt()

G4OpenInventorXt::G4OpenInventorXt ( )

Definition at line 46 of file G4OpenInventorXt.cc.

47:G4OpenInventor("OpenInventorXt","OIX",G4VGraphicsSystem::threeD)
48,fInited(false)
49{
50}
G4OpenInventor(const G4String, const G4String, G4VGraphicsSystem::Functionality)

◆ ~G4OpenInventorXt()

G4OpenInventorXt::~G4OpenInventorXt ( )
virtual

Definition at line 95 of file G4OpenInventorXt.cc.

95{}

Member Function Documentation

◆ AddNickname()

void G4VGraphicsSystem::AddNickname ( const G4String nickname)
inlineinherited

Definition at line 85 of file G4VGraphicsSystem.hh.

85{fNicknames.push_back(nickname);}
std::vector< G4String > fNicknames

References G4VGraphicsSystem::fNicknames.

◆ CreateSceneHandler()

G4VSceneHandler * G4OpenInventor::CreateSceneHandler ( const G4String name)
virtualinherited

Implements G4VGraphicsSystem.

Definition at line 68 of file G4OpenInventor.cc.

68 {
69 Initialize();
71 return p;
72}
virtual void Initialize()=0
const char * name(G4int ptype)

References G4OpenInventor::Initialize(), and G4InuclParticleNames::name().

◆ CreateViewer()

G4VViewer * G4OpenInventorXt::CreateViewer ( G4VSceneHandler scene,
const G4String name = "" 
)
virtual

Implements G4VGraphicsSystem.

Definition at line 96 of file G4OpenInventorXt.cc.

References Initialize(), and G4InuclParticleNames::name().

◆ GetDescription()

const G4String & G4VGraphicsSystem::GetDescription ( ) const
inlineinherited

Definition at line 82 of file G4VGraphicsSystem.hh.

82{return fDescription;}

References G4VGraphicsSystem::fDescription.

◆ GetFunctionality()

Functionality G4VGraphicsSystem::GetFunctionality ( ) const
inlineinherited

Definition at line 83 of file G4VGraphicsSystem.hh.

83{return fFunctionality;}
Functionality fFunctionality

References G4VGraphicsSystem::fFunctionality.

Referenced by G4VisManager::EndOfRun().

◆ GetInteractorManager()

G4VInteractorManager * G4OpenInventor::GetInteractorManager ( )
inherited

Definition at line 65 of file G4OpenInventor.cc.

65 {
66 return interactorManager;
67}
G4VInteractorManager * interactorManager

References G4OpenInventor::interactorManager.

Referenced by G4OpenInventorWin::Initialize(), Initialize(), and G4OpenInventorXtExtended::Initialize().

◆ GetName()

const G4String & G4VGraphicsSystem::GetName ( ) const
inlineinherited

Definition at line 79 of file G4VGraphicsSystem.hh.

79{return fName;}

References G4VGraphicsSystem::fName.

Referenced by G4VSceneHandler::AddPrimitive().

◆ GetNickname()

const G4String & G4VGraphicsSystem::GetNickname ( ) const
inlineinherited

Definition at line 80 of file G4VGraphicsSystem.hh.

80{return fNicknames[0];}

References G4VGraphicsSystem::fNicknames.

Referenced by G4VisCommandViewerList::SetNewValue().

◆ GetNicknames()

const std::vector< G4String > & G4VGraphicsSystem::GetNicknames ( ) const
inlineinherited

Definition at line 81 of file G4VGraphicsSystem.hh.

81{return fNicknames;}

References G4VGraphicsSystem::fNicknames.

◆ Initialize()

void G4OpenInventorXt::Initialize ( void  )
privatevirtual

Implements G4OpenInventor.

Definition at line 52 of file G4OpenInventorXt.cc.

53{
54 if(fInited) return; //Done
55
58 RemoveDispatcher(G4Xt::xt_dispatch_event);
59 // Coverity gcc8 cast warning
60 // RemoveDispatcher((G4DispatchFunction)XtDispatchEvent);
62 AddDispatcher(soxt_dispatch_event);
63 // Coverity gcc8 cast warning
64 // AddDispatcher ((G4DispatchFunction)SoXt::dispatchEvent);
65
66 Widget top = (Widget)GetInteractorManager()->GetMainInteractor();
67
68 if(std::getenv("XENVIRONMENT")==NULL) {
69 XrmDatabase database = XrmGetDatabase(XtDisplay(top));
70 if(database!=NULL) {
71 XrmPutLineResource(&database,"*topShadowColor:white");
72 XrmPutLineResource(&database,"*bottomShadowColor:black");
73 XrmPutLineResource(&database,"*foreground:black");
74 XrmPutLineResource(&database,"*background:lightgrey");
75 XrmPutLineResource(&database,"*borderColor:lightgrey");
76 XrmPutLineResource(&database,"*fontList:-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1");
77 XrmPutLineResource(&database,"*help_popup.title:Help");
78 XrmPutLineResource(&database,"*helpCancel.labelString:Cancel");
79 XrmPutLineResource(&database,"*helpText.editMode:multi_line_edit");
80 XrmPutLineResource(&database,"*helpText.columns:60");
81 XrmPutLineResource(&database,"*helpText.rows:20");
82 XrmPutLineResource(&database,"*helpText.background:white");
83 XrmPutLineResource(&database,"*helpText.fontList:*courier*-r-*--14-*");
84 XrmPutLineResource(&database,"*helpText.maxLength:8000");
85 }
86 }
87
88 if(!SoXt::getTopLevelWidget()) SoXt::init(top);
89
90 InitNodes();
91
92 fInited = true;
93}
bool soxt_dispatch_event(void *a_event)
void SetInteractorManager(G4VInteractorManager *)
G4VInteractorManager * GetInteractorManager()
G4Interactor GetMainInteractor()
static G4Xt * getInstance()
Definition: G4Xt.cc:55
static bool xt_dispatch_event(void *a_event)
Definition: G4Xt.hh:58

References fInited, G4Xt::getInstance(), G4OpenInventor::GetInteractorManager(), G4VInteractorManager::GetMainInteractor(), G4OpenInventor::InitNodes(), G4OpenInventor::SetInteractorManager(), soxt_dispatch_event(), and G4Xt::xt_dispatch_event().

Referenced by CreateViewer().

◆ InitNodes()

void G4OpenInventor::InitNodes ( )
inherited

Definition at line 74 of file G4OpenInventor.cc.

75{
85
89}
static void initClass()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
Definition: SoPolyhedron.cc:59
static void initClass()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
Definition: SoMarkerSet.cc:627
static void initClass(void)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
static void initClass()
Class Initializer, required.
Definition: SoBox.cc:77
static void initClass()
Class Initializer, required.
Definition: SoCons.cc:84
static void initClass(void)
static void initClass()
static void initClass()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
static void initClass()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
static void initClass()
Class Initializer, required.
Definition: SoTrap.cc:89
static void initClass()
Class Initializer, required.
Definition: SoTrd.cc:59
static void initClass()
Class Initializer, required.
Definition: SoTubs.cc:84

References Geant4_SoPolyhedron::initClass(), SoGL2PSAction::initClass(), SoDetectorTreeKit::initClass(), SoBox::initClass(), SoCons::initClass(), SoImageWriter::initClass(), HEPVis_SoMarkerSet::initClass(), SoTrap::initClass(), SoTrd::initClass(), SoTubs::initClass(), SoAlternateRepAction::initClass(), and SoCounterAction::initClass().

Referenced by G4OpenInventorQt::Initialize(), G4OpenInventorWin::Initialize(), Initialize(), and G4OpenInventorXtExtended::Initialize().

◆ IsUISessionCompatible()

G4bool G4OpenInventor::IsUISessionCompatible ( ) const
virtualinherited

Reimplemented from G4VGraphicsSystem.

Definition at line 91 of file G4OpenInventor.cc.

92{
93 G4bool isCompatible = false;
96
97 // If session is a batch session, it may be:
98 // a) this is a batch job (the user has not instantiated any UI session);
99 // b) we are currently processing a UI command, in which case the UI
100 // manager creates a temporary batch session and to find out if there is
101 // a genuine UI session that the user has instantiated we must drill
102 // down through previous sessions to a possible non-batch session.
103 while (G4UIbatch* batch = dynamic_cast<G4UIbatch*>(session)) {
104 session = batch->GetPreviousSession();
105 }
106
107 // OI windows are not appropriate in a batch session.
108 if (session) {
109 // If non-zero, this is the originating non-batch session
110 // The user has instantiated a UI session...
111 isCompatible = true;
112 }
113
114 return isCompatible;
115}
bool G4bool
Definition: G4Types.hh:86
G4UIsession * GetSession() const
Definition: G4UImanager.hh:187
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:77

References G4UImanager::GetSession(), and G4UImanager::GetUIpointer().

◆ SetInteractorManager()

void G4OpenInventor::SetInteractorManager ( G4VInteractorManager im)
inherited

Field Documentation

◆ fDescription

G4String G4VGraphicsSystem::fDescription
protectedinherited

Definition at line 90 of file G4VGraphicsSystem.hh.

Referenced by G4VGraphicsSystem::GetDescription().

◆ fFunctionality

Functionality G4VGraphicsSystem::fFunctionality
protectedinherited

Definition at line 91 of file G4VGraphicsSystem.hh.

Referenced by G4VGraphicsSystem::GetFunctionality().

◆ fInited

bool G4OpenInventorXt::fInited
private

Definition at line 45 of file G4OpenInventorXt.hh.

Referenced by Initialize().

◆ fName

G4String G4VGraphicsSystem::fName
protectedinherited

Definition at line 88 of file G4VGraphicsSystem.hh.

Referenced by G4VGraphicsSystem::GetName().

◆ fNicknames

std::vector<G4String> G4VGraphicsSystem::fNicknames
protectedinherited

◆ interactorManager

G4VInteractorManager* G4OpenInventor::interactorManager
privateinherited

The documentation for this class was generated from the following files: