Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4OpenGLXmViewer Class Reference

#include <G4OpenGLXmViewer.hh>

+ Inheritance diagram for G4OpenGLXmViewer:

Public Member Functions

 G4OpenGLXmViewer (G4OpenGLSceneHandler &scene)
 
virtual ~G4OpenGLXmViewer ()
 
- Public Member Functions inherited from G4OpenGLXViewer
 G4OpenGLXViewer (G4OpenGLSceneHandler &scene)
 
virtual ~G4OpenGLXViewer ()
 
void SetView ()
 
void ShowView ()
 
void DrawText (const G4Text &)
 
- Public Member Functions inherited from G4OpenGLViewer
void ClearView ()
 
void ClearViewWithoutFlush ()
 
virtual bool exportImage (std::string name="", int width=-1, int height=-1)
 
bool setExportImageFormat (std::string format, bool quiet=false)
 
- Public Member Functions inherited from G4VViewer
 G4VViewer (G4VSceneHandler &, G4int id, const G4String &name="")
 
virtual ~G4VViewer ()
 
virtual void Initialise ()
 
virtual void ResetView ()
 
virtual void SetView ()=0
 
virtual void ClearView ()=0
 
virtual void DrawView ()=0
 
void RefreshView ()
 
virtual void ShowView ()
 
virtual void FinishView ()
 
std::vector< G4ThreeVectorComputeFlyThrough (G4Vector3D *)
 
const G4StringGetName () const
 
const G4StringGetShortName () const
 
void SetName (const G4String &)
 
G4int GetViewId () const
 
G4VSceneHandlerGetSceneHandler () const
 
const G4ViewParametersGetViewParameters () const
 
const G4ViewParametersGetDefaultViewParameters () const
 
G4double GetKernelVisitElapsedTimeSeconds () const
 
virtual const std::vector< G4ModelingParameters::VisAttributesModifier > * GetPrivateVisAttributesModifiers () const
 
void SetViewParameters (const G4ViewParameters &vp)
 
void SetDefaultViewParameters (const G4ViewParameters &vp)
 
const G4VisAttributesGetApplicableVisAttributes (const G4VisAttributes *) const
 
void SetNeedKernelVisit (G4bool need)
 
void NeedKernelVisit ()
 
void ProcessView ()
 

Static Public Member Functions

static void expose_callback (Widget w, XtPointer clientData, XtPointer callData)
 
static void resize_callback (Widget w, XtPointer clientData, XtPointer callData)
 
static void actions_callback (Widget w, XtPointer clientData, XtPointer callData)
 
static void misc_callback (Widget w, XtPointer clientData, XtPointer callData)
 
static void Add_set_field (char *widget, char *widget_text, Widget *row_col_box, Widget *wid, G4double *val, G4OpenGLXmViewer *pView)
 
static void zoom_callback (Widget w, XtPointer clientData, XtPointer callData)
 
static void dolly_callback (Widget w, XtPointer clientData, XtPointer callData)
 
static void pan_left_right_callback (Widget w, XtPointer clientData, XtPointer callData)
 
static void left_right_pan_callback (XtPointer clientData, XtIntervalId *timer_id)
 
static void theta_rotation_callback (Widget w, XtPointer clientData, XtPointer callData)
 
static void phi_rotation_callback (Widget w, XtPointer clientData, XtPointer callData)
 
static void pan_up_down_callback (Widget w, XtPointer clientData, XtPointer callData)
 
static void up_down_pan_callback (XtPointer clientData, XtIntervalId *timer_id)
 
static void drawing_style_callback (Widget w, XtPointer clientData, XtPointer callData)
 
static void background_color_callback (Widget w, XtPointer clientData, XtPointer callData)
 
static void set_rot_subject_callback (Widget w, XtPointer clientData, XtPointer callData)
 
static void set_rot_sens_callback (Widget w, XtPointer clientData, XtPointer callData)
 
static void set_pan_sens_callback (Widget w, XtPointer clientData, XtPointer callData)
 
static void set_wob_sens_callback (Widget w, XtPointer clientData, XtPointer callData)
 
static void projection_callback (Widget w, XtPointer clientData, XtPointer callData)
 
static void wobble_callback (Widget w, XtPointer clientData, XtPointer callData)
 
static void reset_callback (Widget w, XtPointer clientData, XtPointer callData)
 
static void update_panels_callback (Widget w, XtPointer clientData, XtPointer callData)
 
static void wobble_timer_callback (XtPointer clientData, XtIntervalId *timerid)
 
static void Add_radio_box (char *label_string, Widget *parent_frame_widget, XtCallbackRec *radio_box_cb, G4int num_buttons, G4int default_button, char *radio_box_name, char **button_names, G4OpenGLXmViewer *pView)
 
static void Add_four_arrow_buttons (G4OpenGLXmViewer *pView, XtCallbackRec **arrow_callbacks, Widget *parent_widget)
 
static void Add_slider_box (char *label_string, G4int num_sliders, char **slider_name, G4OpenGLXmViewer *pView, G4double *min_array, G4double *max_array, G4double *value_array, G4bool *show, short *decimals, unsigned char *orientation, unsigned char *direction, XtCallbackRec **slider_box_cb, Widget *parent_frame_widget)
 
static void rotate_in_theta (XtPointer clientData, XtIntervalId *timer_id)
 
static void rotate_in_phi (XtPointer clientData, XtIntervalId *timer_id)
 
static void get_double_value_callback (Widget w, XtPointer clientData, XtPointer callData)
 
static void get_text_callback (Widget w, XtPointer clientData, XtPointer callData)
 
static void transparency_callback (Widget w, XtPointer clientData, XtPointer callData)
 
static void antialias_callback (Widget w, XtPointer clientData, XtPointer callData)
 
static void haloing_callback (Widget w, XtPointer clientData, XtPointer callData)
 
static void aux_edge_callback (Widget w, XtPointer clientData, XtPointer callData)
 
static void set_print_colour_callback (Widget w, XtPointer clientData, XtPointer callData)
 
static void set_print_style_callback (Widget w, XtPointer clientData, XtPointer callData)
 
static void print_callback (Widget w, XtPointer clientData, XtPointer callData)
 
static G4bool get_boolean_userData (Widget w)
 
static G4int get_int_userData (Widget w)
 

Protected Member Functions

virtual void ShowView ()
 
void ResetView ()
 
void GetXmConnection ()
 
virtual void CreateMainWindow ()
 
- Protected Member Functions inherited from G4OpenGLXViewer
void GetXConnection ()
 
void CreateGLXContext (XVisualInfo *vi)
 
virtual void CreateMainWindow ()
 
virtual void CreateFontLists ()
 
- Protected Member Functions inherited from G4OpenGLViewer
 G4OpenGLViewer (G4OpenGLSceneHandler &scene)
 
virtual ~G4OpenGLViewer ()
 
void SetView ()
 
void ResetView ()
 
virtual void DrawText (const G4Text &)
 
void ChangePointSize (G4double size)
 
void ChangeLineWidth (G4double width)
 
void HaloingFirstPass ()
 
void HaloingSecondPass ()
 
void HLRFirstPass ()
 
void HLRSecondPass ()
 
void HLRThirdPass ()
 
void InitializeGLView ()
 
void ResizeGLView ()
 
void ResizeWindow (unsigned int, unsigned int)
 
virtual G4String Pick (GLdouble x, GLdouble y)
 
const std::vector< G4OpenGLViewerPickMap * > & GetPickDetails (GLdouble x, GLdouble y)
 
virtual void CreateFontLists ()
 
void rotateScene (G4double dx, G4double dy)
 
void rotateSceneToggle (G4double dx, G4double dy)
 
void setExportSize (G4int, G4int)
 
bool setExportFilename (G4String name, G4bool inc=true)
 
std::string getRealPrintFilename ()
 
unsigned int getWinWidth () const
 
unsigned int getWinHeight () const
 
G4bool sizeHasChanged ()
 
GLdouble getSceneNearWidth ()
 
GLdouble getSceneFarWidth ()
 
GLdouble getSceneDepth ()
 
void addExportImageFormat (std::string format)
 
G4bool isGl2psWriting ()
 
G4bool isFramebufferReady ()
 
void g4GluPickMatrix (GLdouble x, GLdouble y, GLdouble width, GLdouble height, GLint viewport[4])
 
void g4GluLookAt (GLdouble eyex, GLdouble eyey, GLdouble eyez, GLdouble centerx, GLdouble centery, GLdouble centerz, GLdouble upx, GLdouble upy, GLdouble upz)
 
void g4GlOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far)
 
void g4GlFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far)
 
- Protected Member Functions inherited from G4VViewer
void SetTouchable (const std::vector< G4PhysicalVolumeModel::G4PhysicalVolumeNodeID > &fullPath)
 
void TouchableSetVisibility (const std::vector< G4PhysicalVolumeModel::G4PhysicalVolumeNodeID > &fullPath, G4bool visibility)
 
void TouchableSetColour (const std::vector< G4PhysicalVolumeModel::G4PhysicalVolumeNodeID > &fullPath, const G4Colour &)
 

Protected Attributes

XtAppContext app
 
XtWorkProcId workId
 
Widget toplevel
 
Widget shell
 
Widget main_win
 
Widget menubar
 
Widget style_cascade
 
Widget actions_cascade
 
Widget misc_cascade
 
Widget spec_cascade
 
Widget drawing_style_pullright
 
Widget background_color_pullright
 
Widget transparency_pullright
 
Widget antialias_pullright
 
Widget haloing_pullright
 
Widget aux_edge_pullright
 
Widget frame
 
Widget glxarea
 
XmString style_str
 
XmString actions_str
 
XmString misc_str
 
XmString spec_str
 
XmString draw_str
 
XmString polyhedron_str
 
XmString wireframe_str
 
XmString hlr_str
 
XmString hsr_str
 
XmString hlhsr_str
 
XmString set_str
 
XmString rot_str
 
XmString pan_str
 
XmString exit_str
 
XmString quit_str
 
XmString print_str
 
XmString white_str
 
XmString black_str
 
XmString anti_str
 
XmString trans_str
 
XmString halo_str
 
XmString aux_edge_str
 
XmString bgnd_str
 
XmString off_str
 
XmString on_str
 
G4double zoom_high
 
G4double zoom_low
 
G4double pan_low
 
G4double pan_high
 
G4double dolly_low
 
G4double dolly_high
 
G4double fov
 
G4double rot_sens_limit
 
G4double pan_sens_limit
 
G4double wob_high
 
G4double wob_low
 
G4double wob_sens
 
Pixel bgnd
 
Pixel borcol
 
G4bool pan_right
 
G4bool rotate_right
 
G4bool pan_up
 
G4bool rotate_up
 
XtIntervalId rotation_timer
 
XtIntervalId pan_timer
 
XtIntervalId wobble_timer
 
G4Vector3D original_vp
 
G4int frameNo
 
G4String menu_str [37]
 
G4OpenGLXmTopLevelShellfprotation_top
 
G4OpenGLXmBoxfprotation_button_box
 
G4OpenGLXmRadioButtonfprotation_button1
 
G4OpenGLXmRadioButtonfprotation_button2
 
G4OpenGLXmBoxfprotation_slider_box
 
G4OpenGLXmSliderBarfprotation_slider
 
G4OpenGLXmBoxfprotation_arrow_box
 
G4OpenGLXmFourArrowButtonsfprotation_arrow
 
G4OpenGLXmTopLevelShellfppanning_top
 
G4OpenGLXmFramedBoxfppanning_box
 
G4OpenGLXmFourArrowButtonsfppanning_arrows
 
G4OpenGLXmSliderBarfppanning_slider
 
G4OpenGLXmFramedBoxfpzoom_box
 
G4OpenGLXmSliderBarfpzoom_slider
 
G4OpenGLXmFramedBoxfpdolly_box
 
G4OpenGLXmSliderBarfpdolly_slider
 
G4OpenGLXmTopLevelShellfpsetting_top
 
G4OpenGLXmFramedBoxfpsetting_box
 
G4OpenGLXmTextFieldfppan_set
 
G4OpenGLXmTextFieldfprot_set
 
G4OpenGLXmTextFieldfpzoom_upper
 
G4OpenGLXmTextFieldfpzoom_lower
 
G4OpenGLXmTextFieldfpdolly_upper
 
G4OpenGLXmTextFieldfpdolly_lower
 
G4OpenGLXmPushButtonfpok_button
 
G4OpenGLXmTopLevelShellfpmiscellany_top
 
G4OpenGLXmFramedBoxfpwobble_box
 
G4OpenGLXmPushButtonfpwobble_button
 
G4OpenGLXmSliderBarfpwobble_slider
 
G4OpenGLXmFramedBoxfpreset_box
 
G4OpenGLXmPushButtonfpreset_button
 
G4OpenGLXmFramedBoxfpproj_style_box
 
G4OpenGLXmRadioButtonfporthogonal_button
 
G4OpenGLXmRadioButtonfpperspective_button
 
G4OpenGLXmTextFieldfpfov_text
 
G4OpenGLXmTopLevelShellfpprint_top
 
G4OpenGLXmFramedBoxfpprint_box
 
G4OpenGLXmFramedBoxfpprint_col_box
 
G4OpenGLXmFramedBoxfpprint_style_box
 
G4OpenGLXmTextFieldfpprint_text
 
G4OpenGLXmPushButtonfpprint_button
 
G4OpenGLXmSeparatorfpprint_line
 
G4OpenGLXmRadioButtonfpprint_col_radio1
 
G4OpenGLXmRadioButtonfpprint_col_radio2
 
G4OpenGLXmRadioButtonfpprint_style_radio1
 
G4OpenGLXmRadioButtonfpprint_style_radio2
 
- Protected Attributes inherited from G4OpenGLXViewer
XWindowAttributes xwa
 
Display * dpy
 
XVisualInfo * vi_immediate
 
XVisualInfo * vi_stored
 
XVisualInfo * vi
 
Colormap cmap
 
XSetWindowAttributes swa
 
GLXDrawable win
 
GLXContext cxMaster
 
XEvent event
 
G4intattributeList
 
G4int errorBase
 
G4int eventBase
 
G4int major
 
G4int minor
 
XSizeHints * norm_hints
 
XWMHints * wm_hints
 
XClassHint * class_hints
 
Pixmap icon_pixmap
 
XSizeHints * size_hints
 
Atom Xatom
 
XTextProperty windowName
 
XTextProperty iconName
 
char charViewName [100]
 
- Protected Attributes inherited from G4OpenGLViewer
G4bool fPrintColour
 
G4bool fVectoredPs
 
G4OpenGLSceneHandlerfOpenGLSceneHandler
 
G4Colour background
 
G4bool transparency_enabled
 
G4bool antialiasing_enabled
 
G4bool haloing_enabled
 
G4gl2psfGL2PSAction
 
G4double fRot_sens
 
G4double fPan_sens
 
unsigned int fWinSize_x
 
unsigned int fWinSize_y
 
std::vector< std::string > fExportImageFormatVector
 
std::string fDefaultExportImageFormat
 
std::string fExportImageFormat
 
int fExportFilenameIndex
 
G4int fPrintSizeX
 
G4int fPrintSizeY
 
- Protected Attributes inherited from G4VViewer
G4VSceneHandlerfSceneHandler
 
G4int fViewId
 
G4String fName
 
G4String fShortName
 
G4ViewParameters fVP
 
G4ViewParameters fDefaultVP
 
G4double fKernelVisitElapsedTimeSeconds = 999.
 
G4bool fNeedKernelVisit
 

Static Protected Attributes

static const G4String e_str = ""
 
- Static Protected Attributes inherited from G4OpenGLXViewer
static int snglBuf_RGBA [12]
 
static int dblBuf_RGBA [13]
 
static XVisualInfo * vi_single_buffer = 0
 
static XVisualInfo * vi_double_buffer = 0
 

Friends

class G4OpenGLXmVWidgetObject
 
class G4OpenGLXmViewerMessenger
 

Detailed Description

Definition at line 51 of file G4OpenGLXmViewer.hh.

Constructor & Destructor Documentation

◆ G4OpenGLXmViewer()

G4OpenGLXmViewer::G4OpenGLXmViewer ( G4OpenGLSceneHandler scene)

Definition at line 667 of file G4OpenGLXmViewer.cc.

667 :
668G4VViewer (scene, -1),
669G4OpenGLViewer (scene),
670G4OpenGLXViewer (scene),
671toplevel (0),
672shell (0),
673main_win (0),
674menubar (0),
675style_cascade (0),
677misc_cascade (0),
678spec_cascade (0),
685frame (0),
686glxarea (0),
687style_str (0),
688actions_str (0),
689misc_str (0),
690spec_str (0),
691draw_str (0),
693wireframe_str (0),
694hlr_str (0),
695hsr_str (0),
696hlhsr_str (0),
697set_str (0),
698rot_str (0),
699pan_str (0),
700exit_str (0),
701quit_str (0),
702print_str (0),
703white_str (0),
704black_str (0),
705anti_str (0),
706trans_str (0),
707halo_str (0),
708aux_edge_str (0),
709bgnd_str (0),
710off_str (0),
711on_str (0),
712zoom_high (0.0),
713zoom_low (0.0),
714pan_low (0.0),
715pan_high (0.0),
716dolly_low (0.0),
717dolly_high (0.0),
718fov (0.0),
719rot_sens_limit (0.0),
720pan_sens_limit (0.0),
721wob_high (0.0),
722wob_low (0.0),
723wob_sens (0.0),
724pan_right (false),
725rotate_right (false),
726pan_up (false),
727rotate_up (false),
729frameNo (0),
738fppanning_top (0),
739fppanning_box (0),
742fpzoom_box (0),
743fpzoom_slider (0),
744fpdolly_box (0),
746fpsetting_top (0),
747fpsetting_box (0),
748fppan_set (0),
749fprot_set (0),
750fpzoom_upper (0),
751fpzoom_lower (0),
752fpdolly_upper (0),
753fpdolly_lower (0),
754fpok_button (0),
756fpwobble_box (0),
759fpreset_box (0),
764fpfov_text (0),
765fpprint_top (0),
766fpprint_box (0),
769fpprint_text (0),
771fpprint_line (0),
776{
778 ResetView();
779 if (fViewId < 0) return;
780}
G4OpenGLXmPushButton * fpok_button
G4OpenGLXmTopLevelShell * fpmiscellany_top
G4OpenGLXmFramedBox * fpprint_style_box
G4OpenGLXmPushButton * fpwobble_button
G4OpenGLXmBox * fprotation_slider_box
G4OpenGLXmSliderBar * fppanning_slider
G4OpenGLXmSliderBar * fprotation_slider
G4OpenGLXmTextField * fpfov_text
G4OpenGLXmTextField * fprot_set
G4OpenGLXmBox * fprotation_button_box
G4OpenGLXmTopLevelShell * fpsetting_top
G4OpenGLXmTextField * fpdolly_lower
G4OpenGLXmTextField * fpzoom_lower
G4OpenGLXmRadioButton * fpperspective_button
G4OpenGLXmSeparator * fpprint_line
G4OpenGLXmRadioButton * fpprint_style_radio1
G4OpenGLXmFramedBox * fpproj_style_box
G4OpenGLXmPushButton * fpreset_button
G4OpenGLXmRadioButton * fporthogonal_button
G4OpenGLXmTextField * fpprint_text
G4OpenGLXmTopLevelShell * fpprint_top
G4OpenGLXmFramedBox * fpzoom_box
G4OpenGLXmFramedBox * fpprint_box
G4OpenGLXmPushButton * fpprint_button
G4OpenGLXmRadioButton * fpprint_style_radio2
Widget drawing_style_pullright
G4OpenGLXmTextField * fpdolly_upper
G4OpenGLXmRadioButton * fprotation_button1
G4OpenGLXmFramedBox * fppanning_box
G4OpenGLXmBox * fprotation_arrow_box
G4OpenGLXmFramedBox * fpprint_col_box
G4OpenGLXmSliderBar * fpwobble_slider
G4OpenGLXmTopLevelShell * fppanning_top
G4OpenGLXmRadioButton * fpprint_col_radio1
G4OpenGLXmSliderBar * fpzoom_slider
G4OpenGLXmFramedBox * fpsetting_box
G4OpenGLXmTopLevelShell * fprotation_top
G4OpenGLXmSliderBar * fpdolly_slider
G4OpenGLXmRadioButton * fprotation_button2
G4OpenGLXmFramedBox * fpdolly_box
G4OpenGLXmTextField * fpzoom_upper
G4OpenGLXmRadioButton * fpprint_col_radio2
Widget background_color_pullright
G4OpenGLXmFramedBox * fpwobble_box
G4OpenGLXmFourArrowButtons * fprotation_arrow
G4OpenGLXmFramedBox * fpreset_box
G4OpenGLXmTextField * fppan_set
G4OpenGLXmFourArrowButtons * fppanning_arrows
G4int fViewId
Definition: G4VViewer.hh:217
G4ViewParameters fVP
Definition: G4VViewer.hh:220
const G4Vector3D & GetViewpointDirection() const

◆ ~G4OpenGLXmViewer()

G4OpenGLXmViewer::~G4OpenGLXmViewer ( )
virtual

Definition at line 839 of file G4OpenGLXmViewer.cc.

840{
841 XtDestroyWidget (shell);
842 win = 0; // ...to avoid XDestroyWindow in G4OpenGLXViewer base class
843 // because XtDestroyWidget has already destroyed it.
845
846/******************************
847 if (fprotation_top) {
848 delete fprotation_top;
849 }
850
851 if (fppanning_top) {
852 delete fppanning_top;
853 }
854
855 if (fpsetting_top) {
856 delete fpsetting_top;
857 }
858
859 if (fpmiscellany_top) {
860 delete fpmiscellany_top;
861 }
862******************************/
863
864}
void RemoveShell(G4Interactor)
static G4Xt * getInstance()
Definition: G4Xt.cc:55

Member Function Documentation

◆ actions_callback()

void G4OpenGLXmViewer::actions_callback ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)
static

Definition at line 58 of file G4OpenGLXmMainMenubarCallbacks.cc.

61{
62
63 G4OpenGLXmViewer* pView;
64 G4long choice = (G4long)clientData;
65
66
67 XtVaGetValues (XtParent(w),
68 XmNuserData, &pView,
69 NULL);
70
71 switch (choice) {
72
73 case 0:
74
75 {
76
77 if (!pView->fprotation_top) {
78 std::ostringstream rot_Name;
79 rot_Name << pView->GetSceneHandler()->GetSceneHandlerId() << '-' << pView->fViewId;
80
81 pView->fprotation_top = new G4OpenGLXmTopLevelShell (pView,
82 (char*)rot_Name.str().c_str());
83 pView->fprotation_button_box = new G4OpenGLXmBox ("Rotation button box", True);
84
86
87 XtCallbackRec* rot_cb_list = new XtCallbackRec[2];
88 rot_cb_list[0].callback = set_rot_subject_callback;
89 rot_cb_list[0].closure = pView;
90 rot_cb_list[1].callback = NULL;
91
93 ("Object",
94 rot_cb_list,
96 0);
97
99 ("Camera",
100 rot_cb_list,
102 1);
103
106
107 pView->fprotation_slider_box = new G4OpenGLXmBox ("Rotation slider box", False);
109
110 XtCallbackRec* rot_slider_list = new XtCallbackRec[2];
111 rot_slider_list[0].callback = set_rot_sens_callback;
112 rot_slider_list[0].closure = pView;
113 rot_slider_list[1].callback = NULL;
114
115 pView->fprotation_slider = new G4OpenGLXmSliderBar ("Rotation slider",
116 rot_slider_list,
117 True,
118 2,
119 pView->fRot_sens,
120 pView->rot_sens_limit,
121 0);
123
124 pView->fprotation_arrow_box = new G4OpenGLXmBox ("Rotation arrow box", False);
126
127 XtCallbackRec** rotation_callbacks = new XtCallbackRec*[4];
128 for (G4int i = 0; i < 4; i++) {
129 rotation_callbacks[i] = new XtCallbackRec[2];
130 }
131 rotation_callbacks[0][0].callback = phi_rotation_callback;
132 rotation_callbacks[0][0].closure = pView;
133 rotation_callbacks[0][1].callback = NULL;
134
135 rotation_callbacks[1][0].callback = phi_rotation_callback;
136 rotation_callbacks[1][0].closure = pView;
137 rotation_callbacks[1][1].callback = NULL;
138
139 rotation_callbacks[2][0].callback = theta_rotation_callback;
140 rotation_callbacks[2][0].closure = pView;
141 rotation_callbacks[2][1].callback = NULL;
142
143 rotation_callbacks[3][0].callback = theta_rotation_callback;
144 rotation_callbacks[3][0].closure = pView;
145 rotation_callbacks[3][1].callback = NULL;
146
147 pView->fprotation_arrow = new G4OpenGLXmFourArrowButtons (rotation_callbacks);
148
150
151 pView->fprotation_top->Realize ();
152 }
153 break;
154
155 }
156
157
158 case 1:
159 {
160 if (!pView->GetSceneHandler()->GetScene()) {
161 break;
162 }
163 if (!pView->fppanning_top) {
164 std::ostringstream pan_Name;
165 pan_Name << pView->GetSceneHandler()->GetSceneHandlerId() << '-' << pView->fViewId;
166
167 pView->fppanning_top = new G4OpenGLXmTopLevelShell (pView,
168 (char*)pan_Name.str().c_str());
169
170 pView->fppanning_box = new G4OpenGLXmFramedBox ("Pan up-down-left-right",
171 False);
172
173 pView->fppanning_top->AddChild (pView->fppanning_box);
174
175 XtCallbackRec** pan_callbacks = new XtCallbackRec*[4];
176 for (G4int i = 0; i < 4; i++) {
177 pan_callbacks[i] = new XtCallbackRec[2];
178 }
179 pan_callbacks[0][0].callback = pan_up_down_callback;
180 pan_callbacks[0][0].closure = pView;
181 pan_callbacks[0][1].callback = NULL;
182
183 pan_callbacks[1][0].callback = pan_up_down_callback;
184 pan_callbacks[1][0].closure = pView;
185 pan_callbacks[1][1].callback = NULL;
186
187 pan_callbacks[2][0].callback = pan_left_right_callback;
188 pan_callbacks[2][0].closure = pView;
189 pan_callbacks[2][1].callback = NULL;
190
191 pan_callbacks[3][0].callback = pan_left_right_callback;
192 pan_callbacks[3][0].closure = pView;
193 pan_callbacks[3][1].callback = NULL;
194
195 pView->fppanning_arrows = new G4OpenGLXmFourArrowButtons (pan_callbacks);
196
197 pView->fppanning_box->AddChild (pView->fppanning_arrows);
198
199 XtCallbackRec* pan_slider_list = new XtCallbackRec[2];
200 pan_slider_list[0].callback = set_pan_sens_callback;
201 pan_slider_list[0].closure = pView;
202 pan_slider_list[1].callback = NULL;
203
204 pView->fppanning_slider = new G4OpenGLXmSliderBar ("Panning slider",
205 pan_slider_list,
206 True,
207 2,
208 pView->fPan_sens = pView->GetSceneHandler()->GetScene()->GetExtent().GetExtentRadius() / 10.0,
210 0);
211 pView->fppanning_box->AddChild (pView->fppanning_slider);
212
213 pView->fpzoom_box = new G4OpenGLXmFramedBox ("Zoom",
214 False);
215 pView->fppanning_top->AddChild (pView->fpzoom_box);
216
217 XtCallbackRec* zoom_slider_list = new XtCallbackRec[2];
218 zoom_slider_list[0].callback = zoom_callback;
219 zoom_slider_list[0].closure = pView;
220 zoom_slider_list[1].callback = NULL;
221
222 pView->fpzoom_slider = new G4OpenGLXmSliderBar ("Zoom slider",
223 zoom_slider_list,
224 True,
225 2,
226 pView->fVP.GetZoomFactor(),
227 pView->zoom_high,
228 pView->zoom_low);
229 pView->fpzoom_box->AddChild (pView->fpzoom_slider);
230
231 pView->fpdolly_box = new G4OpenGLXmFramedBox ("Dolly",
232 False);
233 pView->fppanning_top->AddChild (pView->fpdolly_box);
234
235 XtCallbackRec* dolly_slider_list = new XtCallbackRec[2];
236 dolly_slider_list[0].callback = dolly_callback;
237 dolly_slider_list[0].closure = pView;
238 dolly_slider_list[1].callback = NULL;
239
240 pView->fpdolly_slider = new G4OpenGLXmSliderBar ("Dolly slider",
241 dolly_slider_list,
242 True,
243 2,
244 pView->fVP.GetDolly(),
246 pView->dolly_low = -(pView->GetSceneHandler()->GetScene()->GetExtent().GetExtentRadius()));
247 // pView->dolly_high,
248 // pView->dolly_low);
249 pView->fpdolly_box->AddChild (pView->fpdolly_slider);
250
251 pView->fppanning_top->Realize ();
252 pView->UpdateControlPanel ();
253 }
254
255 break;
256
257 }
258 case 2:
259 {
260
261 if (!pView->fpsetting_top) {
262 std::ostringstream set_Name;
263 set_Name << pView->GetSceneHandler()->GetSceneHandlerId() << '-' << pView->fViewId;
264
265 pView->fpsetting_top = new G4OpenGLXmTopLevelShell(pView,
266 (char*)set_Name.str().c_str());
267
268 pView->fpsetting_box = new G4OpenGLXmFramedBox ("Set values for control panels",
269 False);
270 pView->fpsetting_top->AddChild (pView->fpsetting_box);
271
272 pView->fppan_set = new G4OpenGLXmTextField ("Upper limit of pan sensitivity",
273 &(pView->pan_sens_limit));
274
275 pView->fprot_set = new G4OpenGLXmTextField ("Upper limit of rotation sensitivity",
276 &(pView->rot_sens_limit));
277
278 pView->fpzoom_upper = new G4OpenGLXmTextField ("Upper limit of zoom",
279 &(pView->zoom_high));
280
281 pView->fpzoom_lower = new G4OpenGLXmTextField ("Lower limit of zoom",
282 &(pView->zoom_low));
283
284 pView->fpdolly_upper = new G4OpenGLXmTextField ("Upper limit of dolly",
285 &(pView->dolly_high));
286
287 pView->fpdolly_lower = new G4OpenGLXmTextField ("Lower limit of dolly",
288 &(pView->dolly_low));
289
290 XtCallbackRec* ok_list = new XtCallbackRec[2];
291 ok_list[0].callback = update_panels_callback;
292 ok_list[0].closure = pView;
293 ok_list[1].callback = NULL;
294
295
296 pView->fpok_button = new G4OpenGLXmPushButton ("ok",
297 ok_list);
298
299 pView->fpsetting_box->AddChild (pView->fppan_set);
300 pView->fpsetting_box->AddChild (pView->fprot_set);
301 pView->fpsetting_box->AddChild (pView->fpzoom_upper);
302 pView->fpsetting_box->AddChild (pView->fpzoom_lower);
303 pView->fpsetting_box->AddChild (pView->fpdolly_upper);
304 pView->fpsetting_box->AddChild (pView->fpdolly_lower);
305 pView->fpsetting_box->AddChild (pView->fpok_button);
306
307 pView->fpsetting_top->Realize ();
308
309 }
310
311 break;
312 }
313
314 default:
316 ("G4OpenGLXmViewer::actions_callback",
317 "opengl2001", FatalException,
318 "Unrecognised widget child of control_callback");
319 }
320
321 return;
322}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:59
long G4long
Definition: G4Types.hh:87
int G4int
Definition: G4Types.hh:85
void AddChild(G4OpenGLXmVWidgetComponent *)
void AddChild(G4OpenGLXmVWidgetComponent *)
void AddChild(G4OpenGLXmVWidgetContainer *)
static void set_pan_sens_callback(Widget w, XtPointer clientData, XtPointer callData)
static void phi_rotation_callback(Widget w, XtPointer clientData, XtPointer callData)
static void set_rot_sens_callback(Widget w, XtPointer clientData, XtPointer callData)
static void pan_up_down_callback(Widget w, XtPointer clientData, XtPointer callData)
static void pan_left_right_callback(Widget w, XtPointer clientData, XtPointer callData)
static void set_rot_subject_callback(Widget w, XtPointer clientData, XtPointer callData)
static void zoom_callback(Widget w, XtPointer clientData, XtPointer callData)
static void dolly_callback(Widget w, XtPointer clientData, XtPointer callData)
static void theta_rotation_callback(Widget w, XtPointer clientData, XtPointer callData)
static void update_panels_callback(Widget w, XtPointer clientData, XtPointer callData)
const G4VisExtent & GetExtent() const
G4Scene * GetScene() const
G4int GetSceneHandlerId() const
const G4ViewParameters & GetViewParameters() const
G4VSceneHandler * GetSceneHandler() const
G4double GetZoomFactor() const
G4bool GetLightsMoveWithCamera() const
G4double GetDolly() const
G4double GetExtentRadius() const
Definition: G4VisExtent.cc:75

Referenced by CreateMainWindow().

◆ Add_four_arrow_buttons()

void G4OpenGLXmViewer::Add_four_arrow_buttons ( G4OpenGLXmViewer pView,
XtCallbackRec **  arrow_callbacks,
Widget *  parent_widget 
)
static

Definition at line 49 of file G4OpenGLXmConvenienceRoutines.cc.

51 {
52
53 Widget arrow_form = XtVaCreateWidget
54 ("arrow_form",
55 xmFormWidgetClass,
56 *parent_widget,
57 XmNfractionBase, 3,
58 XtNvisual, pView->vi->visual,
59 XtNdepth, pView->vi->depth,
60 XtNcolormap, pView->cmap,
61 XtNborderColor, pView->borcol,
62 XtNbackground, pView->bgnd,
63 NULL);
64
65 Widget arrow = XtVaCreateManagedWidget
66 ("up_arrow",
67 xmArrowButtonGadgetClass,
68 arrow_form,
69 XmNtopAttachment, XmATTACH_POSITION,
70 XmNtopPosition, 0,
71 XmNbottomAttachment, XmATTACH_POSITION,
72 XmNbottomPosition, 1,
73 XmNleftAttachment, XmATTACH_POSITION,
74 XmNleftPosition, 1,
75 XmNrightAttachment, XmATTACH_POSITION,
76 XmNrightPosition, 2,
77 XmNarrowDirection, XmARROW_UP,
78 NULL);
79
80 XtVaSetValues (arrow,
81 XmNuserData, True,
82 NULL);
83
84 XtAddCallbacks (arrow,
85 XmNactivateCallback,
86 arrow_callbacks[0]);
87
88 XtAddCallbacks (arrow,
89 XmNarmCallback,
90 arrow_callbacks[0]);
91
92 XtAddCallbacks (arrow,
93 XmNdisarmCallback,
94 arrow_callbacks[0]);
95
96 arrow = XtVaCreateManagedWidget
97 ("down_arrow",
98 xmArrowButtonGadgetClass,
99 arrow_form,
100 XmNtopAttachment, XmATTACH_POSITION,
101 XmNtopPosition, 2,
102 XmNbottomAttachment, XmATTACH_POSITION,
103 XmNbottomPosition, 3,
104 XmNleftAttachment, XmATTACH_POSITION,
105 XmNleftPosition, 1,
106 XmNrightAttachment, XmATTACH_POSITION,
107 XmNrightPosition, 2,
108 XmNarrowDirection, XmARROW_DOWN,
109 NULL);
110
111 XtVaSetValues (arrow,
112 XmNuserData, False,
113 NULL);
114
115 XtAddCallbacks (arrow,
116 XmNactivateCallback,
117 arrow_callbacks[1]);
118
119 XtAddCallbacks (arrow,
120 XmNarmCallback,
121 arrow_callbacks[1]);
122
123 XtAddCallbacks (arrow,
124 XmNdisarmCallback,
125 arrow_callbacks[1]);
126
127 arrow = XtVaCreateManagedWidget
128 ("left_arrow",
129 xmArrowButtonGadgetClass,
130 arrow_form,
131 XmNtopAttachment, XmATTACH_POSITION,
132 XmNtopPosition, 1,
133 XmNbottomAttachment, XmATTACH_POSITION,
134 XmNbottomPosition, 2,
135 XmNleftAttachment, XmATTACH_POSITION,
136 XmNleftPosition, 0,
137 XmNrightAttachment, XmATTACH_POSITION,
138 XmNrightPosition, 1,
139 XmNarrowDirection, XmARROW_LEFT,
140 NULL);
141
142 XtVaSetValues (arrow,
143 XmNuserData, False,
144 NULL);
145
146 XtAddCallbacks (arrow,
147 XmNactivateCallback,
148 arrow_callbacks[2]);
149
150 XtAddCallbacks (arrow,
151 XmNarmCallback,
152 arrow_callbacks[2]);
153
154 XtAddCallbacks (arrow,
155 XmNdisarmCallback,
156 arrow_callbacks[2]);
157
158 arrow = XtVaCreateManagedWidget
159 ("right_arrow",
160 xmArrowButtonGadgetClass,
161 arrow_form,
162 XmNtopAttachment, XmATTACH_POSITION,
163 XmNtopPosition, 1,
164 XmNbottomAttachment, XmATTACH_POSITION,
165 XmNbottomPosition, 2,
166 XmNleftAttachment, XmATTACH_POSITION,
167 XmNleftPosition, 2,
168 XmNrightAttachment, XmATTACH_POSITION,
169 XmNrightPosition, 3,
170 XmNarrowDirection, XmARROW_RIGHT,
171 NULL);
172
173 XtVaSetValues (arrow,
174 XmNuserData, True,
175 NULL);
176
177 XtAddCallbacks (arrow,
178 XmNactivateCallback,
179 arrow_callbacks[3]);
180
181 XtAddCallbacks (arrow,
182 XmNarmCallback,
183 arrow_callbacks[3]);
184
185 XtAddCallbacks (arrow,
186 XmNdisarmCallback,
187 arrow_callbacks[3]);
188
189 XtManageChild (arrow_form);
190
191}
XVisualInfo * vi

◆ Add_radio_box()

void G4OpenGLXmViewer::Add_radio_box ( char *  label_string,
Widget *  parent_frame_widget,
XtCallbackRec *  radio_box_cb,
G4int  num_buttons,
G4int  default_button,
char *  radio_box_name,
char **  button_names,
G4OpenGLXmViewer pView 
)
static

Definition at line 193 of file G4OpenGLXmConvenienceRoutines.cc.

201{
202 XmString button_str = XmStringCreateLocalized((char*) e_str.c_str());
203 // initialise to something to avoid pedantic warning.
204 Arg** args;
205 args = new Arg* [num_buttons];
206 Widget button;
207
208 G4int i;
209 for (i = 0; i < num_buttons; i++) {
210
211 args[i] = new Arg[7];
212 button_str = XmStringCreateLocalized (button_names[i]);
213
214 XtSetArg (args[i][0], XtNvisual, pView->vi->visual);
215 XtSetArg (args[i][1], XtNdepth, pView->vi->depth);
216 XtSetArg (args[i][2], XtNcolormap, pView->cmap);
217 XtSetArg (args[i][3], XtNborderColor, pView->borcol);
218 XtSetArg (args[i][4], XtNbackground, pView->bgnd);
219 XtSetArg (args[i][5], XmNlabelString, button_str);
220
221 if (i == default_button) {
222 XtSetArg (args[i][6], XmNset, True);
223 } else {
224 XtSetArg (args[i][6], XmNset, False);
225 }
226 }
227
228 Widget radio_box = XtVaCreateWidget (radio_box_name,
229 xmRowColumnWidgetClass,
230 *parent_widget,
231 XmNisHomogeneous, False,
232 XmNradioBehavior, True,
233 XmNradioAlwaysOne, True,
234 XmNuserData, pView,
235 XtNvisual, pView->vi->visual,
236 XtNdepth, pView->vi->depth,
237 XtNcolormap, pView->cmap,
238 XtNborderColor, pView->borcol,
239 XtNbackground, pView->bgnd,
240 NULL);
241
242 XmString lab = XmStringCreateLocalized (label_string);
243
244 // Unused!
245 //Widget label = XtVaCreateManagedWidget ("radio_label",
246 // xmLabelWidgetClass,
247 // radio_box,
248 // XmNalignment, XmALIGNMENT_CENTER,
249 // XmNlabelString, lab,
250 // XtNvisual, pView->vi->visual,
251 // XtNdepth, pView->vi->depth,
252 // XtNcolormap, pView->cmap,
253 // XtNborderColor, pView->borcol,
254 // XtNbackground, pView->bgnd,
255 // NULL);
256
257 XmStringFree (lab);
258
259 for (i = 0; i < num_buttons; i++) {
260 button = XtCreateManagedWidget (button_names[i],
261 xmToggleButtonWidgetClass,
262 radio_box,
263 args[i],
264 7);
265 XtVaSetValues (button,
266 XmNuserData, i,
267 NULL);
268
269 XtAddCallbacks (button,
270 XmNarmCallback,
271 radio_box_callback);
272 }
273
274 XtManageChild (radio_box);
275
276 XmStringFree (button_str);
277
278 for (i = 0; i < num_buttons; i++) {
279
280 delete[] args[i];
281
282 }
283
284 delete[] args;
285}
static const G4String e_str

◆ Add_set_field()

void G4OpenGLXmViewer::Add_set_field ( char *  widget,
char *  widget_text,
Widget *  row_col_box,
Widget *  wid,
G4double val,
G4OpenGLXmViewer pView 
)
static

Definition at line 287 of file G4OpenGLXmConvenienceRoutines.cc.

293{
294
295 char local_w_text[50];
296 strcpy (local_w_text, w_text);
297
298 char label_name[50];
299 strcpy (label_name, w_name);
300 strcat (label_name, "_label");
301
302 char text_field_name[50];
303 strcpy (text_field_name, w_name);
304 strcat (text_field_name, "_text_field");
305
306 XmString local_text = XmStringCreateLocalized (local_w_text);
307
308 // Unused!
309 // Widget label = XtVaCreateManagedWidget (label_name,
310 // xmLabelWidgetClass,
311 // *row_col_box,
312 // XmNlabelString, local_text,
313 // XtNvisual, pView->vi->visual,
314 // XtNdepth, pView->vi->depth,
315 // XtNcolormap, pView->cmap,
316 // XtNborderColor, pView->borcol,
317 // XtNbackground, pView->bgnd,
318 // NULL);
319
320 XmStringFree (local_text);
321
322 char initial[50];
323 snprintf (initial, sizeof initial, "%6.2f", *val);
324
325 *wid = XtVaCreateManagedWidget (text_field_name,
326 xmTextFieldWidgetClass,
327 *row_col_box,
328 XmNvalue, (String)initial,
329 XtNvisual, pView->vi->visual,
330 XtNdepth, pView->vi->depth,
331 XtNcolormap, pView->cmap,
332 XtNborderColor, pView->borcol,
333 XtNbackground, pView->bgnd,
334 NULL);
335
336 XtAddCallback (*wid,
337 XmNvalueChangedCallback,
339 val);
340
341 /* Not actually used - comment out to prevent compiler warnings.
342 Instead, just in case it matters, just invoke
343 XtVaCreateManagedWidget (JA)
344 Widget sep = XtVaCreateManagedWidget ("sep",
345 xmSeparatorWidgetClass,
346 *row_col_box,
347 XmNorientation, XmHORIZONTAL,
348 XtNvisual, pView->vi->visual,
349 XtNdepth, pView->vi->depth,
350 XtNcolormap, pView->cmap,
351 XtNborderColor, pView->borcol,
352 XtNbackground, pView->bgnd,
353 NULL);
354 sep = XtVaCreateManagedWidget ("sep",
355 xmSeparatorWidgetClass,
356 *row_col_box,
357 XmNseparatorType, XmNO_LINE,
358 XmNmargin, 1,
359 XmNorientation, XmHORIZONTAL,
360 XtNvisual, pView->vi->visual,
361 XtNdepth, pView->vi->depth,
362 XtNcolormap, pView->cmap,
363 XtNborderColor, pView->borcol,
364 XtNbackground, pView->bgnd,
365 NULL);
366 */
367 XtVaCreateManagedWidget ("sep",
368 xmSeparatorWidgetClass,
369 *row_col_box,
370 XmNseparatorType, XmNO_LINE,
371 XmNmargin, 1,
372 XmNorientation, XmHORIZONTAL,
373 XtNvisual, pView->vi->visual,
374 XtNdepth, pView->vi->depth,
375 XtNcolormap, pView->cmap,
376 XtNborderColor, pView->borcol,
377 XtNbackground, pView->bgnd,
378 NULL);
379}
const G4DNABoundingBox initial
static void get_double_value_callback(Widget w, XtPointer clientData, XtPointer callData)

◆ Add_slider_box()

void G4OpenGLXmViewer::Add_slider_box ( char *  label_string,
G4int  num_sliders,
char **  slider_name,
G4OpenGLXmViewer pView,
G4double min_array,
G4double max_array,
G4double value_array,
G4bool show,
short *  decimals,
unsigned char *  orientation,
unsigned char *  direction,
XtCallbackRec **  slider_box_cb,
Widget *  parent_frame_widget 
)
static

Definition at line 381 of file G4OpenGLXmConvenienceRoutines.cc.

394{
395 XmString slider_name_str = XmStringCreateLocalized((char*) e_str.c_str());
396 // initialise to something to avoid pedantic warning.
397 Arg** slider_args;
398 slider_args = new Arg*[num_sliders];
399 Widget slider;
400 G4int j = 0;
401
402 G4int i;
403 for (i = 0; i < num_sliders; i++) {
404 j = 0;
405 slider_args[i] = new Arg[13];
406 slider_name_str = XmStringCreateLtoR (slider_names[i],
407 XmFONTLIST_DEFAULT_TAG);
408
409 XtSetArg (slider_args[i][j],
410 XtNvisual, pView->vi->visual); j++;
411 XtSetArg (slider_args[i][j],
412 XtNdepth, pView->vi->depth); j++;
413 XtSetArg (slider_args[i][j],
414 XtNcolormap, pView->cmap); j++;
415 XtSetArg (slider_args[i][j],
416 XtNborderColor, pView->borcol); j++;
417 XtSetArg (slider_args[i][j],
418 XtNbackground, pView->bgnd); j++;
419
420 XtSetArg (slider_args[i][j],
421 XmNtitleString, slider_name_str); j++;
422
423 XtSetArg (slider_args[i][j],
424 XmNmaximum, G4int(max_array[i] * std::pow(10.0, (G4double)decimals[i]))); j++;
425 XtSetArg (slider_args[i][j],
426 XmNminimum, G4int(min_array[i] * std::pow(10.0, (G4double)decimals[i]))); j++;
427 XtSetArg (slider_args[i][j],
428 XmNvalue, G4int(value_array[i] * std::pow(10.0, (G4double)decimals[i]))); j++;
429 XtSetArg (slider_args[i][j],
430 XmNshowValue, show[i]); j++;
431 XtSetArg (slider_args[i][j],
432 XmNdecimalPoints, decimals[i]); j++;
433
434 XtSetArg (slider_args[i][j],
435 XmNorientation, orientation[i]); j++;
436 XtSetArg (slider_args[i][j],
437 XmNprocessingDirection, direction[i]); j++;
438
439 }
440
441 Widget slider_box = XtVaCreateWidget ("slider_box",
442 xmRowColumnWidgetClass,
443 *parent_widget,
444 XmNisHomogeneous, False,
445 XtNvisual, pView->vi->visual,
446 XtNdepth, pView->vi->depth,
447 XtNcolormap, pView->cmap,
448 XtNborderColor, pView->borcol,
449 XtNbackground, pView->bgnd,
450 NULL);
451
452 XmString lab = XmStringCreateLocalized (label_string);
453
454 // Unused!
455 //Widget label = XtVaCreateManagedWidget ("slider_label",
456 // xmLabelWidgetClass,
457 // slider_box,
458 // XmNlabelString, lab,
459 // XmNalignment, XmALIGNMENT_CENTER,
460 // XtNvisual, pView->vi->visual,
461 // XtNdepth, pView->vi->depth,
462 // XtNcolormap, pView->cmap,
463 // XtNborderColor, pView->borcol,
464 // XtNbackground, pView->bgnd,
465 // NULL);
466
467 XmStringFree (lab);
468
469 for (i = 0; i < num_sliders; i++) {
470
471 slider = XtCreateManagedWidget (slider_names[i],
472 xmScaleWidgetClass,
473 slider_box,
474 slider_args[i],
475 j);
476
477 XtAddCallbacks (slider,
478 XmNvalueChangedCallback,
479 slider_box_callbacks[i]);
480
481 XtAddCallbacks (slider,
482 XmNdragCallback,
483 slider_box_callbacks[i]);
484
485 }
486
487 XtManageChild (slider_box);
488 XmStringFree (slider_name_str);
489
490 for (i = 0; i < num_sliders; i++) {
491
492 delete[] slider_args[i];
493
494 }
495
496 delete[] slider_args;
497
498}
double G4double
Definition: G4Types.hh:83

◆ antialias_callback()

void G4OpenGLXmViewer::antialias_callback ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)
static

Definition at line 155 of file G4OpenGLXmStyleCallbacks.cc.

158{
159 G4long choice = (G4long)clientData;
160 G4OpenGLXmViewer* pView;
161 XtVaGetValues (XtParent(w),
162 XmNuserData, &pView,
163 NULL);
164
165 switch (choice) {
166
167 case 0:
168 pView->antialiasing_enabled = false;
169 glDisable (GL_LINE_SMOOTH);
170 glDisable (GL_POLYGON_SMOOTH);
171 break;
172
173 case 1:
174 pView->antialiasing_enabled = true;
175 glEnable (GL_LINE_SMOOTH);
176 glHint (GL_LINE_SMOOTH_HINT, GL_NICEST);
177 glEnable (GL_POLYGON_SMOOTH);
178 glHint (GL_POLYGON_SMOOTH_HINT, GL_NICEST);
179 break;
180
181 default:
183 ("G4OpenGLXmViewer::antialias_callback",
184 "opengl2010", FatalException,
185 "Unrecognised case in antialiasing_callback.");
186 }
187
188 pView->SetView ();
189 pView->ClearView ();
190 pView->DrawView ();
191}
G4bool antialiasing_enabled
virtual void DrawView()=0

Referenced by CreateMainWindow().

◆ aux_edge_callback()

void G4OpenGLXmViewer::aux_edge_callback ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)
static

Definition at line 225 of file G4OpenGLXmStyleCallbacks.cc.

228{
229 G4long choice = (G4long)clientData;
230 G4OpenGLXmViewer* pView;
231 XtVaGetValues (XtParent(w),
232 XmNuserData, &pView,
233 NULL);
234
235 switch (choice) {
236
237 case 0:
238 pView->fVP.SetAuxEdgeVisible(false);
239 break;
240
241 case 1:
242 pView->fVP.SetAuxEdgeVisible(true);
243 break;
244
245 default:
247 ("G4OpenGLXmViewer::aux_edge_callback",
248 "opengl2012", FatalException,
249 "Unrecognised case in aux_edge_callback.");
250 }
251
252 pView->SetNeedKernelVisit (true);
253 pView->SetView ();
254 pView->ClearView ();
255 pView->DrawView ();
256}
void SetNeedKernelVisit(G4bool need)
void SetAuxEdgeVisible(G4bool)

Referenced by CreateMainWindow().

◆ background_color_callback()

void G4OpenGLXmViewer::background_color_callback ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)
static

Definition at line 82 of file G4OpenGLXmStyleCallbacks.cc.

85{
86 G4long choice = (G4long)clientData;
87 G4OpenGLXmViewer* pView;
88 XtVaGetValues (XtParent(w),
89 XmNuserData, &pView,
90 NULL);
91
92
93 //I need to revisit the kernel if the background colour changes and
94 //hidden line removal is enabled, because hlr drawing utilises the
95 //background colour in its drawing...
96 // (Note added by JA 13/9/2005) Background now handled in view
97 // parameters. A kernel visit is triggered on change of background.
98 switch (choice) {
99
100 case 0:
102 SetBackgroundColour(G4Colour(1.,1.,1.)); // White
103 break;
104
105 case 1:
107 SetBackgroundColour(G4Colour(0.,0.,0.)); // Black
108 break;
109
110 default:
112 ("G4OpenGLXmViewer::background_color_callback",
113 "opengl2008", FatalException,
114 "Unrecognised case in background_color_callback.");
115 }
116
117 pView->SetView ();
118 pView->ClearView ();
119 pView->DrawView ();
120}

Referenced by CreateMainWindow().

◆ CreateMainWindow()

void G4OpenGLXmViewer::CreateMainWindow ( )
protectedvirtual

Reimplemented from G4OpenGLXViewer.

Definition at line 173 of file G4OpenGLXmViewer.cc.

173 {
174
175 bgnd = XWhitePixelOfScreen (XtScreen(shell));
176 borcol = XBlackPixelOfScreen (XtScreen(shell));
177
179
180 G4int x_origin = fVP.GetWindowAbsoluteLocationHintX(DisplayWidth(dpy, vi -> screen));
181
182 // FIXME, screen size != window size on MAC, but I don't know have to get the menuBar
183 // size on MAC. L.Garnier 01/2009
184 G4int y_origin = fVP.GetWindowAbsoluteLocationHintY(DisplayHeight(dpy, vi -> screen));
185
187 XtVaSetValues (shell,
188 XtNvisual, vi -> visual,
189 XtNdepth, vi -> depth,
190 XtNcolormap, cmap,
191 XtNwidth, getWinWidth(),
192 XtNheight, getWinHeight(),
193 XtNx, x_origin,
194 XtNy, y_origin,
195 XtNborderColor, &borcol,
196 XtNbackground, &bgnd,
197 XmNtitle, fName.data(),
198 NULL);
200 XtVaSetValues (shell,
201 XtNvisual, vi -> visual,
202 XtNdepth, vi -> depth,
203 XtNcolormap, cmap,
204 XtNwidth, getWinWidth(),
205 XtNheight, getWinHeight(),
206 XtNborderColor, &borcol,
207 XtNbackground, &bgnd,
208 XmNtitle, fName.data(),
209 NULL);
211 XtVaSetValues (shell,
212 XtNvisual, vi -> visual,
213 XtNdepth, vi -> depth,
214 XtNcolormap, cmap,
215 XtNx, x_origin,
216 XtNy, y_origin,
217 XtNborderColor, &borcol,
218 XtNbackground, &bgnd,
219 XmNtitle, fName.data(),
220 NULL);
221 } else {
222 XtVaSetValues (shell,
223 XtNvisual, vi -> visual,
224 XtNdepth, vi -> depth,
225 XtNcolormap, cmap,
226 XtNborderColor, &borcol,
227 XtNbackground, &bgnd,
228 XmNtitle, fName.data(),
229 NULL);
230 }
231
232
233 main_win = XtVaCreateManagedWidget ("main_win",
234 xmMainWindowWidgetClass,
235 shell,
236 XtNvisual, vi -> visual,
237 XtNdepth, vi -> depth,
238 XtNcolormap, cmap,
239 XtNborderColor, borcol,
240 XtNbackground, bgnd,
241 NULL);
242
243 //*********Create a menu bar for the window********
244 style_str = XmStringCreateLocalized ((char*)menu_str[0].c_str());
245 actions_str = XmStringCreateLocalized ((char*)menu_str[2].c_str());
246 misc_str = XmStringCreateLocalized ((char*)menu_str[4].c_str());
247 spec_str = XmStringCreateLocalized ((char*)menu_str[6].c_str());
248
249 menubar = XmVaCreateSimpleMenuBar (main_win,
250 (char*)menu_str[8].c_str(),
251 XmVaCASCADEBUTTON, style_str, (KeySym)XK_S, /*G.Barrand : cast to KeySym and use XK_*/
252 XmVaCASCADEBUTTON, actions_str, (KeySym)XK_A,
253 XmVaCASCADEBUTTON, misc_str, (KeySym)XK_M,
254 XmVaCASCADEBUTTON, spec_str, (KeySym)XK_p,
255 XtNvisual, vi -> visual,
256 XtNdepth, vi -> depth,
257 XtNcolormap, cmap,
258 XtNborderColor, borcol,
259 XtNbackground, bgnd,
260 NULL);
261
262 XmStringFree (style_str);
263 XmStringFree (actions_str);
264 XmStringFree (misc_str);
265 XmStringFree (spec_str);
266
267 G4cout << "Created menubar" << G4endl;
268
269
270 //*********Create style pulldown menu on menubar*********
271 draw_str = XmStringCreateLocalized ((char*)menu_str[9].c_str());
272 bgnd_str = XmStringCreateLocalized ((char*)menu_str[10].c_str());
273
274 style_cascade = XmVaCreateSimplePulldownMenu
275 (menubar,
276 (char*)menu_str[1].c_str(),
277 0,
278 NULL,
279 XmVaCASCADEBUTTON, draw_str, (KeySym)XK_D,
280 XmVaCASCADEBUTTON, bgnd_str, (KeySym)XK_B,
281 XtNvisual, vi -> visual,
282 XtNdepth, vi -> depth,
283 XtNcolormap, cmap,
284 XtNborderColor, borcol,
285 XtNbackground, bgnd,
286 NULL);
287
288 XmStringFree (draw_str);
289 XmStringFree (bgnd_str);
290
291 // G4cout << "Created Style pulldown menu" << G4endl;
292
293 //Add Drawing pullright menu to style cascade...
294 wireframe_str = XmStringCreateLocalized ((char*)menu_str[11].c_str());
295 hlr_str = XmStringCreateLocalized ((char*)menu_str[12].c_str());
296 hsr_str = XmStringCreateLocalized ((char*)menu_str[13].c_str());
297 hlhsr_str = XmStringCreateLocalized ((char*)menu_str[14].c_str());
298
299 drawing_style_pullright = XmVaCreateSimplePulldownMenu
301 (char*)menu_str[15].c_str(),
302 1,
304 XmVaRADIOBUTTON, wireframe_str, (KeySym)XK_W, NULL, NULL,
305 XmVaRADIOBUTTON, hlr_str, (KeySym)XK_L, NULL, NULL,
306 XmVaRADIOBUTTON, hsr_str, (KeySym)XK_S, NULL, NULL,
307 XmVaRADIOBUTTON, hlhsr_str, (KeySym)XK_H, NULL, NULL,
308 XmNradioBehavior, True,
309 XmNradioAlwaysOne, True,
310 XmNuserData, this,
311 XtNvisual, vi -> visual,
312 XtNdepth, vi -> depth,
313 XtNcolormap, cmap,
314 XtNborderColor, borcol,
315 XtNbackground, bgnd,
316 NULL);
317
318 Widget special_widget;
319
321 d_style = fVP.GetDrawingStyle();
322
323 if (d_style == G4ViewParameters::wireframe) {
324 special_widget = XtNameToWidget(drawing_style_pullright, "button_0");
325 if(special_widget) {
326 XtVaSetValues (special_widget, XmNset, True, NULL);
327 }
328 } else if (d_style == G4ViewParameters::hlr) {
329 special_widget = XtNameToWidget(drawing_style_pullright, "button_1");
330 if(special_widget) {
331 XtVaSetValues (special_widget, XmNset, True, NULL);
332 }
333 } else if (d_style == G4ViewParameters::hsr) {
334 special_widget = XtNameToWidget(drawing_style_pullright, "button_2");
335 if(special_widget) {
336 XtVaSetValues (special_widget, XmNset, True, NULL);
337 }
338 } else if (d_style == G4ViewParameters::hlhsr) {
339 special_widget = XtNameToWidget(drawing_style_pullright, "button_3");
340 if(special_widget) {
341 XtVaSetValues (special_widget, XmNset, True, NULL);
342 }
343 } else {
345 ("G4OpenGLXmViewer::CreateMainWindow",
346 "opengl2015", FatalException,
347 "Invalid Drawing style in G4OpenGLXmViewer::CreateContext");
348 }
349
350 XmStringFree (wireframe_str);
351 XmStringFree (hlr_str);
352 XmStringFree (hsr_str);
353 XmStringFree (hlhsr_str);
354
355 // G4cout << "Created Drawing pullright menu" << G4endl;
356
357 //Add Drawing pullright menu to style cascade...
358 white_str = XmStringCreateLocalized ((char*)menu_str[16].c_str());
359 black_str = XmStringCreateLocalized ((char*)menu_str[17].c_str());
360
361 background_color_pullright = XmVaCreateSimplePulldownMenu
363 (char*)menu_str[18].c_str(),
364 2,
366 XmVaRADIOBUTTON, white_str, (KeySym)XK_W, NULL, NULL,
367 XmVaRADIOBUTTON, black_str, (KeySym)XK_B, NULL, NULL,
368 XmNradioBehavior, True,
369 XmNradioAlwaysOne, True,
370 XmNuserData, this,
371 XtNvisual, vi -> visual,
372 XtNdepth, vi -> depth,
373 XtNcolormap, cmap,
374 XtNborderColor, borcol,
375 XtNbackground, bgnd,
376 NULL);
377
378 if (background.GetRed() == 1. &&
379 background.GetGreen() == 1. &&
380 background.GetBlue() == 1.) {
381 special_widget = XtNameToWidget(background_color_pullright, "button_0");
382 if(special_widget) {
383 XtVaSetValues (special_widget, XmNset, True, NULL);
384 }
385 } else {
386 special_widget = XtNameToWidget(background_color_pullright, "button_1");
387 if(special_widget) {
388 XtVaSetValues (special_widget, XmNset, True, NULL);
389 }
390 }
391
392 XmStringFree (white_str);
393 XmStringFree (black_str);
394
395 // G4cout << "Created Background color pullright menu" << G4endl;
396
397 //*********Create actions pulldown menu on menubar*********
398 rot_str = XmStringCreateLocalized ((char*)menu_str[19].c_str());
399 pan_str = XmStringCreateLocalized ((char*)menu_str[20].c_str());
400 set_str = XmStringCreateLocalized ((char*)menu_str[21].c_str());
401
402 actions_cascade = XmVaCreateSimplePulldownMenu
403 (menubar,
404 (char*)menu_str[3].c_str(),
405 1,
407 XmVaPUSHBUTTON, rot_str, (KeySym)XK_R, NULL, NULL,
408 XmVaPUSHBUTTON, pan_str, (KeySym)XK_P, NULL, NULL,
409 XmVaPUSHBUTTON, set_str, (KeySym)XK_S, NULL, NULL,
410 XmNuserData, this,
411 XtNvisual, vi -> visual,
412 XtNdepth, vi -> depth,
413 XtNcolormap, cmap,
414 XtNborderColor, borcol,
415 XtNbackground, bgnd,
416 NULL);
417
418 XmStringFree (rot_str);
419 XmStringFree (pan_str);
420 XmStringFree (set_str);
421 G4cout << "Created Actions pulldown menu" << G4endl;
422
423 misc_str = XmStringCreateLocalized ((char*)menu_str[22].c_str());
424 exit_str = XmStringCreateLocalized ((char*)menu_str[23].c_str());
425 print_str = XmStringCreateLocalized ((char*)menu_str[24].c_str());
426
427 //*********Create miscellany pulldown menu on menubar*********
428 misc_cascade = XmVaCreateSimplePulldownMenu
429 (menubar,
430 (char*)menu_str[5].c_str(),
431 2,
433 XmVaPUSHBUTTON, misc_str, (KeySym)XK_M, NULL, NULL,
434 XmVaPUSHBUTTON, exit_str, (KeySym)XK_E, NULL, NULL,
435 XmVaPUSHBUTTON, print_str, (KeySym)XK_P, NULL, NULL,
436 XmNuserData, this,
437 XtNvisual, vi -> visual,
438 XtNdepth, vi -> depth,
439 XtNcolormap, cmap,
440 XtNborderColor, borcol,
441 XtNbackground, bgnd,
442 NULL);
443
444 XmStringFree (misc_str);
445 XmStringFree (exit_str);
446 XmStringFree (print_str);
447 G4cout << "Created Miscellany pulldown menu" << G4endl;
448
449 trans_str = XmStringCreateLocalized ((char*)menu_str[25].c_str());
450 anti_str = XmStringCreateLocalized ((char*)menu_str[27].c_str());
451 halo_str = XmStringCreateLocalized ((char*)menu_str[29].c_str());
452 aux_edge_str = XmStringCreateLocalized ((char*)menu_str[31].c_str());
453
454 //*********Create special pulldown menu on menubar*********
455 spec_cascade = XmVaCreateSimplePulldownMenu
456 (menubar,
457 (char*)menu_str[7].c_str(),
458 3,
459 NULL,
460 XmVaCASCADEBUTTON, trans_str, (KeySym)XK_T,
461 XmVaCASCADEBUTTON, anti_str, (KeySym)XK_A,
462 XmVaCASCADEBUTTON, halo_str, (KeySym)XK_H,
463 XmVaCASCADEBUTTON, aux_edge_str, (KeySym)XK_E,
464 XtNvisual, vi -> visual,
465 XtNdepth, vi -> depth,
466 XtNcolormap, cmap,
467 XtNborderColor, borcol,
468 XtNbackground, bgnd,
469 NULL);
470
471 XmStringFree (trans_str);
472 XmStringFree (anti_str);
473 XmStringFree (halo_str);
474 XmStringFree (aux_edge_str);
475
476 // G4cout << "Created Special pulldown menu" << G4endl;
477
478 //Add Transparency pullright menu to special cascade...
479 off_str = XmStringCreateLocalized ((char*)menu_str[33].c_str());
480 on_str = XmStringCreateLocalized ((char*)menu_str[34].c_str());
481
482 transparency_pullright = XmVaCreateSimplePulldownMenu
484 (char*)menu_str[26].c_str(),
485 0,
487 XmVaRADIOBUTTON, off_str, (KeySym)XK_f, NULL, NULL,
488 XmVaRADIOBUTTON, on_str, (KeySym)XK_n, NULL, NULL,
489 XmNradioBehavior, True,
490 XmNradioAlwaysOne, True,
491 XmNuserData, this,
492 XtNvisual, vi -> visual,
493 XtNdepth, vi -> depth,
494 XtNcolormap, cmap,
495 XtNborderColor, borcol,
496 XtNbackground, bgnd,
497 NULL);
498
499 if (transparency_enabled == false) {
500 special_widget = XtNameToWidget(transparency_pullright, "button_0");
501 if(special_widget) {
502 XtVaSetValues (special_widget, XmNset, True, NULL);
503 }
504 } else if (transparency_enabled == true) {
505 special_widget = XtNameToWidget(transparency_pullright, "button_1");
506 if(special_widget) {
507 XtVaSetValues (special_widget, XmNset, True, NULL);
508 }
509 } else {
511 ("G4OpenGLXmViewer::CreateMainWindow",
512 "opengl2016", FatalException,
513 "transparency_enabled in G4OpenGLXmViewer is neither true nor false!!");
514 }
515
516 //Add antialias pullright menu to special cascade...
517 antialias_pullright = XmVaCreateSimplePulldownMenu
519 (char*)menu_str[28].c_str(),
520 1,
522 XmVaRADIOBUTTON, off_str, (KeySym)XK_f, NULL, NULL,
523 XmVaRADIOBUTTON, on_str, (KeySym)XK_n, NULL, NULL,
524 XmNradioBehavior, True,
525 XmNradioAlwaysOne, True,
526 XmNuserData, this,
527 XtNvisual, vi -> visual,
528 XtNdepth, vi -> depth,
529 XtNcolormap, cmap,
530 XtNborderColor, borcol,
531 XtNbackground, bgnd,
532 NULL);
533
534 if (antialiasing_enabled == false) {
535 special_widget = XtNameToWidget(antialias_pullright, "button_0");
536 if(special_widget) {
537 XtVaSetValues (special_widget, XmNset, True, NULL);
538 }
539 } else if (antialiasing_enabled == true) {
540 special_widget = XtNameToWidget(antialias_pullright, "button_1");
541 if(special_widget) {
542 XtVaSetValues (special_widget, XmNset, True, NULL);
543 }
544 } else {
546 ("G4OpenGLXmViewer::CreateMainWindow",
547 "opengl2017", FatalException,
548 "antialiasing_enabled in G4OpenGLXmViewer is neither true nor false!!");
549 }
550
551 //Add Haloing pullright menu to special cascade...
552 haloing_pullright = XmVaCreateSimplePulldownMenu
554 (char*)menu_str[30].c_str(),
555 2,
557 XmVaRADIOBUTTON, off_str, (KeySym)XK_f, NULL, NULL,
558 XmVaRADIOBUTTON, on_str, (KeySym)XK_n, NULL, NULL,
559 XmNradioBehavior, True,
560 XmNradioAlwaysOne, True,
561 XmNuserData, this,
562 XtNvisual, vi -> visual,
563 XtNdepth, vi -> depth,
564 XtNcolormap, cmap,
565 XtNborderColor, borcol,
566 XtNbackground, bgnd,
567 NULL);
568
569 if (haloing_enabled == false) {
570 special_widget = XtNameToWidget(haloing_pullright, "button_0");
571 if(special_widget) {
572 XtVaSetValues (special_widget, XmNset, True, NULL);
573 }
574 } else if (haloing_enabled == true) {
575 special_widget = XtNameToWidget(haloing_pullright, "button_1");
576 if(special_widget) {
577 XtVaSetValues (special_widget, XmNset, True, NULL);
578 }
579 } else {
581 ("G4OpenGLXmViewer::CreateMainWindow",
582 "opengl2018", FatalException,
583 "haloing_enabled in G4OpenGLXmViewer is neither true nor false!!");
584 }
585
586 //Add Aux_Edge pullright menu to special cascade...
587 aux_edge_pullright = XmVaCreateSimplePulldownMenu
589 (char*)menu_str[32].c_str(),
590 3,
592 XmVaRADIOBUTTON, off_str, (KeySym)XK_f, NULL, NULL,
593 XmVaRADIOBUTTON, on_str, (KeySym)XK_n, NULL, NULL,
594 XmNradioBehavior, True,
595 XmNradioAlwaysOne, True,
596 XmNuserData, this,
597 XtNvisual, vi -> visual,
598 XtNdepth, vi -> depth,
599 XtNcolormap, cmap,
600 XtNborderColor, borcol,
601 XtNbackground, bgnd,
602 NULL);
603
604 if (!fVP.IsAuxEdgeVisible()) {
605 special_widget = XtNameToWidget(aux_edge_pullright, "button_0");
606 if(special_widget) {
607 XtVaSetValues (special_widget, XmNset, True, NULL);
608 }
609 } else {
610 special_widget = XtNameToWidget(aux_edge_pullright, "button_1");
611 if(special_widget) {
612 XtVaSetValues (special_widget, XmNset, True, NULL);
613 }
614 }
615
616 XtManageChild (menubar);
617 frame = XtVaCreateManagedWidget ((char*)menu_str[35].c_str(),
618 xmFrameWidgetClass, main_win,
619 XtNvisual, vi -> visual,
620 XtNdepth, vi -> depth,
621 XtNcolormap, cmap,
622 XtNborderColor, borcol,
623 XtNbackground, bgnd,
624 NULL);
625
626 glxarea = XtVaCreateManagedWidget ((char*)menu_str[36].c_str(),
627 xmDrawingAreaWidgetClass,
628 frame,
629 XtNvisual, vi -> visual,
630 XtNdepth, vi -> depth,
631 XtNcolormap, cmap,
632 XtNborderColor, borcol,
633 XtNbackground, bgnd,
634 NULL);
635
636
637 XmMainWindowSetAreas (main_win, // main widget, children are specified
638 menubar, // widget to use as menu bar
639 NULL, // widget to use as command window
640 NULL, // widget for horizontal scroll bar
641 NULL, // widget for vertical scroll bar
642 frame // widget to be used for work window
643 );
644
645 XtRealizeWidget(shell);
646
647 // Once widget is realized (ie, associated with a created X window), we
648 // can bind the OpenGL rendering context to the window.
649
650 win = XtWindow (glxarea);
651
652 glXMakeCurrent (dpy, win, cxMaster);
653
654 // This should be add AFTER glXMakeCurrent done because it will fire a resizeCallback
655 XtAddCallback (glxarea,
656 XmNresizeCallback,
658 this);
659
660 XtAddCallback (glxarea,
661 XmNexposeCallback,
663 this);
664
665}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
G4double GetBlue() const
Definition: G4Colour.hh:154
G4double GetRed() const
Definition: G4Colour.hh:152
G4double GetGreen() const
Definition: G4Colour.hh:153
unsigned int getWinHeight() const
void ResizeWindow(unsigned int, unsigned int)
unsigned int getWinWidth() const
G4bool transparency_enabled
GLXContext cxMaster
static void background_color_callback(Widget w, XtPointer clientData, XtPointer callData)
static void antialias_callback(Widget w, XtPointer clientData, XtPointer callData)
static void drawing_style_callback(Widget w, XtPointer clientData, XtPointer callData)
static void resize_callback(Widget w, XtPointer clientData, XtPointer callData)
static void haloing_callback(Widget w, XtPointer clientData, XtPointer callData)
static void expose_callback(Widget w, XtPointer clientData, XtPointer callData)
static void aux_edge_callback(Widget w, XtPointer clientData, XtPointer callData)
G4String menu_str[37]
static void misc_callback(Widget w, XtPointer clientData, XtPointer callData)
static void actions_callback(Widget w, XtPointer clientData, XtPointer callData)
static void transparency_callback(Widget w, XtPointer clientData, XtPointer callData)
G4String fName
Definition: G4VViewer.hh:218
bool IsWindowLocationHintY() const
G4int GetWindowAbsoluteLocationHintY(G4int) const
bool IsWindowLocationHintX() const
unsigned int GetWindowSizeHintX() const
bool IsWindowSizeHintX() const
G4int GetWindowAbsoluteLocationHintX(G4int) const
unsigned int GetWindowSizeHintY() const
DrawingStyle GetDrawingStyle() const
G4bool IsAuxEdgeVisible() const

Referenced by G4OpenGLImmediateXmViewer::Initialise(), and G4OpenGLStoredXmViewer::Initialise().

◆ dolly_callback()

void G4OpenGLXmViewer::dolly_callback ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)
static

Definition at line 79 of file G4OpenGLXmPanningCallbacks.cc.

82{
83 XmScaleCallbackStruct *cbs = (XmScaleCallbackStruct*) callData;
84 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*) clientData;
85 short dp = -1;
86 G4float ten_to_the_dp = 10.;
87
88 XtVaGetValues (w,
89 XmNdecimalPoints, &dp,
90 NULL);
91
92 if (dp == 0) {
93 ten_to_the_dp = 1.;
94 } else if ( dp > 0) {
95 for (G4int i = 1; i < (G4int)dp; i++) {
96 ten_to_the_dp *= 10.;
97 }
98 } else {
99 G4cout << "dp is " << dp << G4endl;
100 return;
101 }
102
103 G4double dolly = (G4double)(cbs->value) / ten_to_the_dp;
104
105 pView->fVP.SetDolly (dolly);
106 pView->SetView ();
107 pView->ClearView ();
108 pView->DrawView ();
109
110}
float G4float
Definition: G4Types.hh:84
void SetDolly(G4double dolly)

Referenced by actions_callback().

◆ drawing_style_callback()

void G4OpenGLXmViewer::drawing_style_callback ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)
static

Definition at line 38 of file G4OpenGLXmStyleCallbacks.cc.

41{
42 G4long choice = (G4long)clientData;
43 G4OpenGLXmViewer* pView;
44 XtVaGetValues (XtParent(w),
45 XmNuserData, &pView,
46 NULL);
48
49 switch (choice) {
50
51 case 0:
53 break;
54
55 case 1:
57 break;
58
59 case 2:
61 break;
62
63 case 3:
65 break;
66
67 default:
70 ("G4OpenGLXmViewer::drawing_style_callback",
71 "opengl2006", FatalException,
72 "Unrecognised case in drawing_style_callback.");
73 }
74
75 pView->fVP.SetDrawingStyle (style);
76
77 pView->SetView ();
78 pView->ClearView ();
79 pView->DrawView ();
80}
void SetDrawingStyle(G4ViewParameters::DrawingStyle style)

Referenced by CreateMainWindow().

◆ expose_callback()

void G4OpenGLXmViewer::expose_callback ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)
static

Definition at line 45 of file G4OpenGLXmWindowHandlingCallbacks.cc.

48{
49 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*) clientData;
50 Dimension width, height;
51
52 XtVaGetValues (w,
53 XmNwidth, &width,
54 XmNheight, &height,
55 NULL);
56
57 pView->ResizeWindow(width,height);
58
59//??????????????????????????? This might be a problem in MT mode.
60// glXMakeCurrent (pView->dpy, XtWindow(pView->glxarea), pView->cxMaster);
61// pView->SetView ();
62// pView->ClearView ();
63// pView->DrawView ();
64//???????????????????????????? Commented out 14/06/16 JA
65}

Referenced by CreateMainWindow(), and resize_callback().

◆ get_boolean_userData()

G4bool G4OpenGLXmViewer::get_boolean_userData ( Widget  w)
static

Definition at line 530 of file G4OpenGLXmConvenienceRoutines.cc.

531{
532 XtPointer userData;
533 XtVaGetValues (w,XmNuserData,&userData,NULL);
534 return (G4bool)(((unsigned long)userData)&0xffff);
535}
bool G4bool
Definition: G4Types.hh:86

Referenced by pan_left_right_callback(), pan_up_down_callback(), phi_rotation_callback(), and theta_rotation_callback().

◆ get_double_value_callback()

void G4OpenGLXmViewer::get_double_value_callback ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)
static

Definition at line 500 of file G4OpenGLXmConvenienceRoutines.cc.

503{
504 G4double* val = (G4double*) clientData;
505 String string;
506
507 XtVaGetValues (w,
508 XmNvalue, &string,
509 NULL);
510
511// sscanf (string, "%lg", val);
512 std::istringstream iss(string);
513 iss >> *val;
514}

Referenced by Add_set_field(), and G4OpenGLXmTextField::AddYourselfTo().

◆ get_int_userData()

G4int G4OpenGLXmViewer::get_int_userData ( Widget  w)
static

Definition at line 537 of file G4OpenGLXmConvenienceRoutines.cc.

538{
539 XtPointer userData;
540 XtVaGetValues (w,XmNuserData,&userData,NULL);
541 return (G4int)(unsigned long)userData;
542}

Referenced by projection_callback(), set_print_colour_callback(), set_print_style_callback(), and set_rot_subject_callback().

◆ get_text_callback()

void G4OpenGLXmViewer::get_text_callback ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)
static

Definition at line 516 of file G4OpenGLXmConvenienceRoutines.cc.

519{
520 char* txt = (char*)clientData;
521 String string;
522
523 XtVaGetValues (w,
524 XmNvalue, &string,
525 NULL);
526
527 strcpy(txt, string);
528}

Referenced by G4OpenGLXmTextField::AddYourselfTo().

◆ GetXmConnection()

void G4OpenGLXmViewer::GetXmConnection ( )
protected

Definition at line 110 of file G4OpenGLXmViewer.cc.

110 {
111
112 G4Xt* interactorManager = G4Xt::getInstance ();
113 toplevel = (Widget)interactorManager->GetMainInteractor();
114 app = XtWidgetToApplicationContext(toplevel);
115
116 if (!toplevel) {
117 fViewId = -1; // This flags an error.
118 G4cerr << "G4OpenGLXmViewer::GetXmConnection unable to Initialize"
119 " application context." << G4endl;
120 return;
121 }
122
123 // Better to put this in an X11 resource file !!!
124 std::ostringstream oss;
125 oss <<
126 "*glxarea*width: " << fVP.GetWindowSizeHintX() << "\n"
127 "*glxarea*height: " << fVP.GetWindowSizeHintY() << "\n"
128 /*
129 // Tried this as a replacement for the above two lines, but
130 // sub-windows (rotation, etc.) came same size!!
131 "*geometry: " << fVP.GetXGeometryString() << "\n"
132 */
133 "*frame*x: 10\n"
134 "*frame*y: 10\n"
135 "*frame*topOffset: 10\n"
136 "*frame*bottomOffset: 10\n"
137 "*frame*rightOffset: 10\n"
138 "*frame*leftOffset: 10\n"
139 "*frame*shadowType: SHADOW_IN\n"
140 "*frame*useColorObj: False\n"
141 "*frame*primaryColorSetId: 3\n"
142 "*frame*secondaryColorSetId: 3\n"
143 "*menubar*useColorObj: False\n"
144 "*menubar*primaryColorSetId: 3\n"
145 "*menubar*secondaryColorSetId: 3\n"
146 "*toplevel*useColorObj: False\n"
147 "*toplevel*primaryColorSetId: 3\n"
148 "*toplevel*secondaryColorSetId: 3\n";
149 interactorManager->PutStringInResourceDatabase ((char*)oss.str().c_str());
150
151 // interactorManager->AddSecondaryLoopPostAction ((G4SecondaryLoopAction)G4OpenGLXmViewerSecondaryLoopPostAction);
152
153 shell = XtAppCreateShell ((String)fName.data(),(String)fName.data(),topLevelShellWidgetClass,XtDisplay(toplevel),NULL,0);
154 interactorManager->AddShell (shell);
155
156 dpy = XtDisplay (shell);
157
158 if (!dpy) {
159 fViewId = -1; // This flags an error.
160 G4cerr << "G4OpenGLXmViewer::GetXmConnection unable to connect to display."
161 << G4endl;
162 return;
163 }
164
165 if (!glXQueryExtension (dpy, &errorBase, &eventBase)) {
166 fViewId = -1; // This flags an error.
167 G4cerr << "G4OpenGLXmViewer::GetXmConnection. X Server has no GLX extension."
168 << G4endl;;
169 return;
170 }
171}
G4GLOB_DLL std::ostream G4cerr
G4Interactor GetMainInteractor()
void AddShell(G4Interactor)
Definition: G4Xt.hh:48
void PutStringInResourceDatabase(char *)
Definition: G4Xt.cc:162

Referenced by G4OpenGLXmViewer().

◆ haloing_callback()

void G4OpenGLXmViewer::haloing_callback ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)
static

Definition at line 193 of file G4OpenGLXmStyleCallbacks.cc.

196{
197 G4long choice = (G4long)clientData;
198 G4OpenGLXmViewer* pView;
199 XtVaGetValues (XtParent(w),
200 XmNuserData, &pView,
201 NULL);
202
203 switch (choice) {
204
205 case 0:
206 pView->haloing_enabled = false;
207 break;
208
209 case 1:
210 pView->haloing_enabled = true;
211 break;
212
213 default:
215 ("G4OpenGLXmViewer::haloing_callback",
216 "opengl2011", FatalException,
217 "Unrecognised case in haloing_callback.");
218 }
219
220 pView->SetView ();
221 pView->ClearView ();
222 pView->DrawView ();
223}

Referenced by CreateMainWindow().

◆ left_right_pan_callback()

void G4OpenGLXmViewer::left_right_pan_callback ( XtPointer  clientData,
XtIntervalId *  timer_id 
)
static

Definition at line 128 of file G4OpenGLXmPanningCallbacks.cc.

131{
132 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*) clientData;
133 G4double delta;
134
135 if (pView->pan_right) {
136 delta = pView->fPan_sens;
137 } else {
138 delta = -pView->fPan_sens;
139 }
140
141 G4Point3D stp
143
144 G4Point3D tp = stp + pView -> fVP.GetCurrentTargetPoint ();
145
146 const G4Vector3D& upVector = pView->fVP.GetUpVector ();
147 const G4Vector3D& vpVector = pView->fVP.GetViewpointDirection ();
148
149 G4Vector3D unitRight = (upVector.cross (vpVector)).unit();
150 G4Vector3D unitUp = (vpVector.cross (unitRight)).unit();
151
152 tp += delta * unitRight;
153 pView->fVP.SetCurrentTargetPoint (tp - stp);
154
155 pView->SetView ();
156 pView->ClearView ();
157 pView->DrawView ();
158
159 pView->pan_timer = XtAppAddTimeOut
160 (pView->app,
161 timer_id == NULL ? 500 : 1,
163 pView);
164}
static void left_right_pan_callback(XtPointer clientData, XtIntervalId *timer_id)
XtIntervalId pan_timer
const G4Point3D & GetStandardTargetPoint() const
void SetCurrentTargetPoint(const G4Point3D &currentTargetPoint)
const G4Point3D & GetCurrentTargetPoint() const
const G4Vector3D & GetUpVector() const
BasicVector3D< T > cross(const BasicVector3D< T > &v) const

Referenced by left_right_pan_callback(), and pan_left_right_callback().

◆ misc_callback()

void G4OpenGLXmViewer::misc_callback ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)
static

ajw

Definition at line 326 of file G4OpenGLXmMainMenubarCallbacks.cc.

329{
330 G4OpenGLXmViewer* pView;
331 G4long choice = (G4long)clientData;
332 XtVaGetValues (XtParent(w),
333 XmNuserData, &pView,
334 NULL);
335
336 switch (choice) {
337
338 case 0:
339 {
340
341 if (!pView->fpmiscellany_top) {
342
343 std::ostringstream misc_Name;
344 misc_Name << pView->GetSceneHandler()->GetSceneHandlerId() << '-' << pView->fViewId;
345
346 pView->fpmiscellany_top = new G4OpenGLXmTopLevelShell (pView,
347 (char*)misc_Name.str().c_str());
348 pView->fpwobble_box = new G4OpenGLXmFramedBox ("Wobble view",
349 True);
350 pView->fpmiscellany_top->AddChild (pView->fpwobble_box);
351
352 XtCallbackRec* wob_cb_list = new XtCallbackRec[2];
353 wob_cb_list[0].callback = wobble_callback;
354 wob_cb_list[0].closure = pView;
355 wob_cb_list[1].callback = NULL;
356
357
358 pView->fpwobble_button = new G4OpenGLXmPushButton ("Wobble",
359 wob_cb_list);
360
361 XtCallbackRec* wobble_slider_list = new XtCallbackRec[2];
362 wobble_slider_list[0].callback = set_wob_sens_callback;
363 wobble_slider_list[0].closure = pView;
364 wobble_slider_list[1].callback = NULL;
365
366 pView->fpwobble_slider = new G4OpenGLXmSliderBar ("Wobble slider",
367 wobble_slider_list,
368 True,
369 0,
370 pView->wob_sens,
371 pView->wob_high,
372 pView->wob_low);
373 pView->fpwobble_box->AddChild (pView->fpwobble_button);
374 pView->fpwobble_box->AddChild (pView->fpwobble_slider);
375
376 pView->fpreset_box = new G4OpenGLXmFramedBox ("Reset view",
377 True);
378 pView->fpmiscellany_top->AddChild (pView->fpreset_box);
379
380 XtCallbackRec* rst_cb_list = new XtCallbackRec[3];
381 rst_cb_list[0].callback = reset_callback;
382 rst_cb_list[0].closure = pView;
383 rst_cb_list[1].callback = update_panels_callback;
384 rst_cb_list[1].closure = pView;
385 rst_cb_list[2].callback = NULL;
386
387 pView->fpreset_button = new G4OpenGLXmPushButton ("Reset",
388 rst_cb_list);
389
390 pView->fpreset_box->AddChild (pView->fpreset_button);
391
392 pView->fpproj_style_box = new G4OpenGLXmFramedBox ("Projection style",
393 True);
395
396 XtCallbackRec* proj_cb_list = new XtCallbackRec[2];
397 proj_cb_list[0].callback = projection_callback;
398 proj_cb_list[0].closure = pView;
399 proj_cb_list[1].callback = NULL;
400
401 pView->fporthogonal_button = new G4OpenGLXmRadioButton ("Orthographic",
402 proj_cb_list,
403 pView->fVP.GetFieldHalfAngle() > 0. ? False : True,
404 0);
405
406 pView->fpperspective_button = new G4OpenGLXmRadioButton ("Perspective",
407 proj_cb_list,
408 pView->fVP.GetFieldHalfAngle() > 0. ? True : False,
409 1);
410
411 pView->fpfov_text = new G4OpenGLXmTextField ("Field of view 0.1 -> 89.5 degrees.",
412 &(pView->fov));
413
416 pView->fpproj_style_box->AddChild (pView->fpfov_text);
417
418 pView->fpmiscellany_top->Realize ();
419
420 }
421
422 break;
423 }
424
425 case 1:
426 {
427 G4Xt::getInstance () -> RequireExitSecondaryLoop (OGL_EXIT_CODE);
428 break;
429 }
430
431 case 2:
432 {
433 if (!pView->fpprint_top) {
434
435 std::ostringstream print_Name;
436 print_Name << pView->GetSceneHandler()->GetSceneHandlerId() << '-' << pView->fViewId;
437
438 pView->fpprint_top = new G4OpenGLXmTopLevelShell (pView,
439 (char*)print_Name.str().c_str());
440
441 pView->fpprint_box = new G4OpenGLXmFramedBox ("Create EPS file of current view",
442 False);
443
444 pView->fpprint_top->AddChild (pView->fpprint_box);
445
446 pView->fpprint_col_box = new G4OpenGLXmFramedBox ("Colour choice",
447 True);
448 pView->fpprint_top->AddChild (pView->fpprint_col_box);
449
450 XtCallbackRec* prcol_cb_list = new XtCallbackRec[2];
451 prcol_cb_list[0].callback = set_print_colour_callback;
452 prcol_cb_list[0].closure = pView;
453 prcol_cb_list[1].callback = NULL;
454
455 pView->fpprint_col_radio1 = new G4OpenGLXmRadioButton ("Black and white",
456 prcol_cb_list,
457 pView->fPrintColour==false ? True : False,
458 0);
459
460 pView->fpprint_col_radio2 = new G4OpenGLXmRadioButton ("Colour",
461 prcol_cb_list,
462 pView->fPrintColour==true ? True : False,
463 1);
464
467
468 pView->fpprint_style_box = new G4OpenGLXmFramedBox ("File type",
469 True);
470 pView->fpprint_top->AddChild (pView->fpprint_style_box);
471
472 XtCallbackRec* prsty_cb_list = new XtCallbackRec[2];
473 prsty_cb_list[0].callback = set_print_style_callback;
474 prsty_cb_list[0].closure = pView;
475 prsty_cb_list[1].callback = NULL;
476
477 pView->fpprint_style_radio1 = new G4OpenGLXmRadioButton ("Screen dump (pixmap)",
478 prsty_cb_list,
479 pView->fVectoredPs==false ? True : False,
480 0);
481
482 pView->fpprint_style_radio2 = new G4OpenGLXmRadioButton ("PostScript",
483 prsty_cb_list,
484 pView->fVectoredPs==true ? True : False,
485 1);
486
489
490 pView->fpprint_text = new G4OpenGLXmTextField ("Name of .eps file to save",
491 (pView->getRealPrintFilename().c_str()));
492 pView->fpprint_box->AddChild (pView->fpprint_text);
493
494 pView->fpprint_line = new G4OpenGLXmSeparator ();
495 pView->fpprint_box->AddChild (pView->fpprint_line);
496
497 XtCallbackRec* pri_cb_list = new XtCallbackRec[2];
498 pri_cb_list[0].callback = print_callback;
499 pri_cb_list[0].closure = pView;
500 pri_cb_list[1].callback = NULL;
501
502
503 pView->fpprint_button = new G4OpenGLXmPushButton ("Create EPS file",
504 pri_cb_list);
505
506 pView->fpprint_box->AddChild (pView->fpprint_button);
507 pView->fpprint_top->Realize ();
508
509 }
510
511 ///ajw
512 break;
513 }
514
515 default:
517 ("G4OpenGLXmViewer::misc_callback",
518 "opengl2002", FatalException,
519 "Unrecognised widget child of misc_callback.");
520 }
521
522 return;
523
524}
#define OGL_EXIT_CODE
std::string getRealPrintFilename()
static void set_wob_sens_callback(Widget w, XtPointer clientData, XtPointer callData)
static void set_print_colour_callback(Widget w, XtPointer clientData, XtPointer callData)
static void print_callback(Widget w, XtPointer clientData, XtPointer callData)
static void set_print_style_callback(Widget w, XtPointer clientData, XtPointer callData)
static void projection_callback(Widget w, XtPointer clientData, XtPointer callData)
static void reset_callback(Widget w, XtPointer clientData, XtPointer callData)
static void wobble_callback(Widget w, XtPointer clientData, XtPointer callData)
G4double GetFieldHalfAngle() const

Referenced by CreateMainWindow().

◆ pan_left_right_callback()

void G4OpenGLXmViewer::pan_left_right_callback ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)
static

Definition at line 112 of file G4OpenGLXmPanningCallbacks.cc.

115{
116 XmArrowButtonCallbackStruct *cbs = (XmArrowButtonCallbackStruct*) callData;
117 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*) clientData;
118
119 pView->pan_right = get_boolean_userData (w);
120
121 if (cbs->reason == XmCR_ARM) {
122 left_right_pan_callback (pView,NULL);
123 } else if (cbs->reason == XmCR_DISARM) {
124 XtRemoveTimeOut (pView->pan_timer);
125 }
126}
static G4bool get_boolean_userData(Widget w)

Referenced by actions_callback().

◆ pan_up_down_callback()

void G4OpenGLXmViewer::pan_up_down_callback ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)
static

Definition at line 166 of file G4OpenGLXmPanningCallbacks.cc.

169{
170 XmArrowButtonCallbackStruct *cbs = (XmArrowButtonCallbackStruct*) callData;
171 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*) clientData;
172
173 pView->pan_up = get_boolean_userData (w);
174
175 if (cbs->reason == XmCR_ARM) {
176 up_down_pan_callback (pView,NULL);
177 } else if (cbs->reason == XmCR_DISARM) {
178 XtRemoveTimeOut (pView->pan_timer);
179 }
180}
static void up_down_pan_callback(XtPointer clientData, XtIntervalId *timer_id)

Referenced by actions_callback().

◆ phi_rotation_callback()

void G4OpenGLXmViewer::phi_rotation_callback ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)
static

Definition at line 119 of file G4OpenGLXmRotationCallbacks.cc.

122{
123 XmArrowButtonCallbackStruct *cbs = (XmArrowButtonCallbackStruct*) callData;
124 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*) clientData;
125
126 pView->rotate_up = get_boolean_userData (w);
127
128 if (cbs->reason == XmCR_ARM) {
129 rotate_in_phi (pView, NULL);
130 } else if (cbs->reason == XmCR_DISARM) {
131 XtRemoveTimeOut (pView->rotation_timer);
132 }
133}
XtIntervalId rotation_timer
static void rotate_in_phi(XtPointer clientData, XtIntervalId *timer_id)

Referenced by actions_callback().

◆ print_callback()

void G4OpenGLXmViewer::print_callback ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)
static

Definition at line 67 of file G4OpenGLXmWindowHandlingCallbacks.cc.

70{
71 G4OpenGLXViewer* pView = (G4OpenGLXmViewer*) clientData;
72 pView->exportImage();
73}
virtual bool exportImage(std::string name="", int width=-1, int height=-1)

Referenced by misc_callback().

◆ projection_callback()

void G4OpenGLXmViewer::projection_callback ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)
static

Definition at line 258 of file G4OpenGLXmStyleCallbacks.cc.

261{
262 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*)clientData;
263
264 G4int choice = get_int_userData (w);
265
266 switch (choice) {
267 case 0:
268 {
269 pView->fVP.SetFieldHalfAngle (0.);
270 break;
271 }
272
273 case 1:
274 {
275 if (pView->fov > 89.5 || pView->fov <= 0.0) {
276 G4cout << "Field half angle should be 0 < angle <= 89.5 degrees.";
277 G4cout << G4endl;
278 }
279 else {
280 pView->fVP.SetFieldHalfAngle (pView->fov * deg);
281 }
282 break;
283 }
284 default:
285 {
287 ("G4OpenGLXmViewer::projection_callback",
288 "opengl2013", FatalException,
289 "Unrecognised choice made in projection_callback");
290 }
291 }
292
293 pView->SetView ();
294 pView->ClearView ();
295 pView->DrawView ();
296}
static G4int get_int_userData(Widget w)
void SetFieldHalfAngle(G4double fieldHalfAngle)

Referenced by misc_callback().

◆ reset_callback()

void G4OpenGLXmViewer::reset_callback ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)
static

Definition at line 302 of file G4OpenGLXmRotationCallbacks.cc.

305{
306
307 G4OpenGLXmViewer* pView;
308
309 XtVaGetValues (w,
310 XmNuserData, &pView,
311 NULL);
312
314 pView->fVP.SetZoomFactor(1.0);
315 pView->fVP.SetDolly(0.0);
316 pView->SetView ();
317 pView->ClearView ();
318 pView->DrawView ();
319 pView->zoom_low = 0.1;
320 pView->zoom_high = 10.0;
321
322}
HepGeom::Point3D< G4double > G4Point3D
Definition: G4Point3D.hh:34
void SetZoomFactor(G4double zoomFactor)

Referenced by misc_callback().

◆ ResetView()

void G4OpenGLXmViewer::ResetView ( )
protectedvirtual

Reimplemented from G4OpenGLViewer.

Definition at line 70 of file G4OpenGLXmViewer.cc.

70 {
71 // reset global parameters
73
74 //reset Xm parameteres
75 zoom_high = fVP.GetZoomFactor() * 10.0;
76 zoom_low = fVP.GetZoomFactor() / 10.0;
77 rot_sens_limit = 90.;
78 wob_low = 0.;
79 wob_high = 50.;
80 wob_sens = 20.;
81
82 bool firstInit = true;
83 if (GetSceneHandler() != NULL) {
84 if (GetSceneHandler()->GetScene() != NULL) {
85 firstInit = false;
86 }
87 }
88 if (firstInit) {
89 pan_sens_limit = 100.;
91 dolly_low = fVP.GetDolly() - 1000.0;
92 dolly_high = fVP.GetDolly() + 1000.0;
93 } else {
96
99 }
100
101 UpdateControlPanel ();
102
103
104 // FIXME : L.Garnier 12 Oct 2011
105 // Has also to change the Camera/Object, but tricky to do...
106
107}

Referenced by G4OpenGLXmViewer().

◆ resize_callback()

void G4OpenGLXmViewer::resize_callback ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)
static

Definition at line 36 of file G4OpenGLXmWindowHandlingCallbacks.cc.

39{
40 expose_callback(w,clientData,x);
41}

Referenced by CreateMainWindow().

◆ rotate_in_phi()

void G4OpenGLXmViewer::rotate_in_phi ( XtPointer  clientData,
XtIntervalId *  timer_id 
)
static

Definition at line 135 of file G4OpenGLXmRotationCallbacks.cc.

137{
138 //phi spin stuff here
139 // G4double delta_alpha;
140 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*) clientData;
141
142 if (pView -> rotate_up) {
143 pView->rotateScene(0,-1);
144 } else {
145 pView->rotateScene(0,1);
146 }
147 /*
148 if (pView->fVP.GetLightsMoveWithCamera()) {
149 if (pView -> rotate_up) {
150 delta_alpha = -(pView->fRot_sens);
151 } else {
152 delta_alpha = pView->fRot_sens;
153 }
154 } else {
155 if (pView -> rotate_up) {
156 delta_alpha = pView->fRot_sens;
157 } else {
158 delta_alpha = -(pView->fRot_sens);
159 }
160 }
161
162 delta_alpha *= deg;
163
164 const G4Vector3D& vp = pView->fVP.GetViewpointDirection ().unit ();
165 const G4Vector3D& up = pView->fVP.GetUpVector ().unit ();
166
167 const G4Vector3D& xprime = vp;
168 G4Vector3D yprime = (up.cross(xprime)).unit();
169 G4Vector3D zprime = (xprime.cross(yprime)).unit();
170
171 G4Vector3D new_vp = std::cos(delta_alpha) * xprime + std::sin(delta_alpha) * zprime;
172
173 pView->fVP.SetViewAndLights (new_vp.unit());
174
175 if (pView->fVP.GetLightsMoveWithCamera()) {
176 G4Vector3D new_up = (new_vp.cross(yprime)).unit();
177 pView->fVP.SetUpVector(new_up);
178 }
179
180 */
181 pView->SetView ();
182 pView->ClearView ();
183 pView->DrawView ();
184
185 pView->rotation_timer = XtAppAddTimeOut
186 (pView->app,
187 timer_id == NULL ? 500 : 1,
189 pView);
190}
void rotateScene(G4double dx, G4double dy)

Referenced by phi_rotation_callback(), and rotate_in_phi().

◆ rotate_in_theta()

void G4OpenGLXmViewer::rotate_in_theta ( XtPointer  clientData,
XtIntervalId *  timer_id 
)
static

Definition at line 58 of file G4OpenGLXmRotationCallbacks.cc.

60{
61 //theta spin stuff here
62 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*) clientData;
63
64 if (pView->rotate_right) {
65 pView->rotateScene(1,0);
66 } else {
67 pView->rotateScene(-1,0);
68 }
69 /*
70 G4double delta_theta;
71
72 if (pView->fVP.GetLightsMoveWithCamera()) {
73 if (pView->rotate_right) {
74 delta_theta = -(pView->fRot_sens);
75 } else {
76 delta_theta = pView->fRot_sens;
77 }
78 } else {
79 if (pView->rotate_right) {
80 delta_theta = pView->fRot_sens;
81 } else {
82 delta_theta = -(pView->fRot_sens);
83 }
84 }
85 delta_theta *= deg;
86 // Rotates by fixed azimuthal angle delta_theta.
87
88 const G4Vector3D& vp = pView->fVP.GetViewpointDirection ().unit ();
89 const G4Vector3D& up = pView->fVP.GetUpVector ().unit ();
90 const G4Vector3D& zprime = up;
91 G4double cosalpha = up.dot (vp);
92 G4double sinalpha = std::sqrt (1. - std::pow (cosalpha, 2));
93 G4Vector3D yprime = (zprime.cross (vp)).unit ();
94 G4Vector3D xprime = yprime.cross (zprime);
95 // Projection of vp on plane perpendicular to up...
96 G4Vector3D a1 = sinalpha * xprime;
97 // Required new projection...
98 G4Vector3D a2 =
99 sinalpha * (std::cos (delta_theta) * xprime + std::sin (delta_theta) * yprime);
100 // Required Increment vector...
101 G4Vector3D delta = a2 - a1;
102 // So new viewpoint is...
103 G4Vector3D viewPoint = vp + delta;
104
105 pView->fVP.SetViewAndLights (viewPoint);
106 */
107
108 pView->SetView ();
109 pView->ClearView ();
110 pView->DrawView ();
111
112 pView->rotation_timer = XtAppAddTimeOut
113 (pView->app,
114 timer_id == NULL ? 500 : 1,
116 pView);
117}
static void rotate_in_theta(XtPointer clientData, XtIntervalId *timer_id)

Referenced by rotate_in_theta(), and theta_rotation_callback().

◆ set_pan_sens_callback()

void G4OpenGLXmViewer::set_pan_sens_callback ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)
static

Definition at line 216 of file G4OpenGLXmPanningCallbacks.cc.

219{
220 XmScaleCallbackStruct *cbs = (XmScaleCallbackStruct*) callData;
221 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*) clientData;
222 short dp = -1;
223 G4float ten_to_the_dp = 10.;
224
225 XtVaGetValues (w,
226 XmNdecimalPoints, &dp,
227 NULL);
228
229 if (dp == 0) {
230 ten_to_the_dp = 1.;
231 } else if ( dp > 0) {
232 for (G4int i = 1; i < (G4int)dp; i++) {
233 ten_to_the_dp *= 10.;
234 }
235 } else {
236 G4cout << "dp is " << dp << G4endl;
237 return;
238 }
239
240 pView->fPan_sens = (G4double)((cbs->value) / ten_to_the_dp);
241}

Referenced by actions_callback().

◆ set_print_colour_callback()

void G4OpenGLXmViewer::set_print_colour_callback ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)
static

Definition at line 75 of file G4OpenGLXmWindowHandlingCallbacks.cc.

78{
79 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*)clientData;
80
81 G4int choice = get_int_userData (w);
82
83 pView->fPrintColour=(G4bool)choice;
84 G4cout << "Print colour set to " << pView->fPrintColour;
85
86}

Referenced by misc_callback().

◆ set_print_style_callback()

void G4OpenGLXmViewer::set_print_style_callback ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)
static

Definition at line 88 of file G4OpenGLXmWindowHandlingCallbacks.cc.

91{
92 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*)clientData;
93
94 G4int choice = get_int_userData (w);
95
96 pView->fVectoredPs=(G4bool)choice;
97 G4cout << "`Produce vectored PostScript ?' set to : " << pView->fPrintColour;
98
99}

Referenced by misc_callback().

◆ set_rot_sens_callback()

void G4OpenGLXmViewer::set_rot_sens_callback ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)
static

Definition at line 192 of file G4OpenGLXmRotationCallbacks.cc.

195{
196 XmScaleCallbackStruct *cbs = (XmScaleCallbackStruct*) callData;
197 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*) clientData;
198 short dp = -1;
199 G4float ten_to_the_dp = 10.;
200
201 XtVaGetValues (w,
202 XmNdecimalPoints, &dp,
203 NULL);
204
205 if (dp == 0) {
206 ten_to_the_dp = 1.;
207 } else if ( dp > 0) {
208 for (G4int i = 1; i < (G4int)dp; i++) {
209 ten_to_the_dp *= 10.;
210 }
211 } else {
213 ("G4OpenGLXmViewer::set_rot_sens_callback",
214 "opengl2004", FatalException,
215 "Bad value returned for dp in set_rot_sens_callback");
216 }
217
218 pView->fRot_sens = (G4float)(cbs->value) / ten_to_the_dp;
219}

Referenced by actions_callback().

◆ set_rot_subject_callback()

void G4OpenGLXmViewer::set_rot_subject_callback ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)
static

Definition at line 221 of file G4OpenGLXmRotationCallbacks.cc.

224{
225 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*)clientData;
226
227 G4int choice = get_int_userData (w);
228
229 switch (choice) {
230 case 0:
231 {
232 pView->fVP.SetLightsMoveWithCamera (true);
233 break;
234 }
235 case 1:
236 {
237 pView->fVP.SetLightsMoveWithCamera (false);
238 break;
239 }
240 default:
241 {
243 ("G4OpenGLXmViewer::set_rot_subject_callback",
244 "opengl2005", FatalException,
245 "Unrecognised choice made in set_rot_subject_callback");
246 }
247 }
248}
void SetLightsMoveWithCamera(G4bool moves)

Referenced by actions_callback().

◆ set_wob_sens_callback()

void G4OpenGLXmViewer::set_wob_sens_callback ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)
static

Definition at line 526 of file G4OpenGLXmMainMenubarCallbacks.cc.

529{
530 XmScaleCallbackStruct *cbs = (XmScaleCallbackStruct*) callData;
531 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*) clientData;
532 short dp = -1;
533 G4float ten_to_the_dp = 10.;
534
535 XtVaGetValues (w,
536 XmNdecimalPoints, &dp,
537 NULL);
538
539 if (dp == 0) {
540 ten_to_the_dp = 1.;
541 } else if ( dp > 0) {
542 for (G4int i = 1; i < (G4int)dp; i++) {
543 ten_to_the_dp *= 10.;
544 }
545 } else {
547 ("G4OpenGLXmViewer::set_wob_sens_callback",
548 "opengl2003", FatalException,
549 "Bad value returned for dp in set_rot_sens_callback");
550 }
551
552 pView->wob_sens = (G4float)(cbs->value) / ten_to_the_dp;
553}

Referenced by misc_callback().

◆ ShowView()

void G4OpenGLXmViewer::ShowView ( void  )
protectedvirtual

Reimplemented from G4VViewer.

Definition at line 57 of file G4OpenGLXmViewer.cc.

57 {
58
59// glXWaitGL (); //Wait for effects of all previous OpenGL commands to
60 //be propagated before progressing.
61// JA: Commented out July 2021 - slows rendering down in some cases and I
62// don't see any adverse effects.
63
64 glFlush ();
65
66 G4Xt::getInstance () -> SecondaryLoop ();
67
68}

◆ theta_rotation_callback()

void G4OpenGLXmViewer::theta_rotation_callback ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)
static

Definition at line 42 of file G4OpenGLXmRotationCallbacks.cc.

45{
46 XmArrowButtonCallbackStruct *cbs = (XmArrowButtonCallbackStruct*) callData;
47 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*) clientData;
48
50
51 if (cbs->reason == XmCR_ARM) {
52 rotate_in_theta (pView, NULL);
53 } else if (cbs->reason == XmCR_DISARM) {
54 XtRemoveTimeOut (pView->rotation_timer);
55 }
56}

Referenced by actions_callback().

◆ transparency_callback()

void G4OpenGLXmViewer::transparency_callback ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)
static

Definition at line 122 of file G4OpenGLXmStyleCallbacks.cc.

125{
126 G4long choice = (G4long)clientData;
127 G4OpenGLXmViewer* pView;
128 XtVaGetValues (XtParent(w),
129 XmNuserData, &pView,
130 NULL);
131
132 switch (choice) {
133
134 case 0:
135 pView->transparency_enabled = false;
136 break;
137
138 case 1:
139 pView->transparency_enabled = true;
140 break;
141
142 default:
144 ("G4OpenGLXmViewer::transparency_callback",
145 "opengl2009", FatalException,
146 "Unrecognised case in transparency_callback.");
147 }
148
149 pView->SetNeedKernelVisit (true);
150 pView->SetView ();
151 pView->ClearView ();
152 pView->DrawView ();
153}

Referenced by CreateMainWindow().

◆ up_down_pan_callback()

void G4OpenGLXmViewer::up_down_pan_callback ( XtPointer  clientData,
XtIntervalId *  timer_id 
)
static

Definition at line 182 of file G4OpenGLXmPanningCallbacks.cc.

184{
185 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*) clientData;
186 G4double delta;
187
188 if (pView->pan_up) {
189 delta = pView->fPan_sens;
190 } else {
191 delta = -(pView->fPan_sens);
192 }
193
194 G4Point3D stp
196 G4Point3D tp = stp + pView -> fVP.GetCurrentTargetPoint ();
197 const G4Vector3D& upVector = pView->fVP.GetUpVector ();
198 const G4Vector3D& vpVector = pView->fVP.GetViewpointDirection ();
199
200 G4Vector3D unitRight = (upVector.cross (vpVector)).unit();
201 G4Vector3D unitUp = (vpVector.cross (unitRight)).unit();
202 tp += delta * unitUp;
203 pView->fVP.SetCurrentTargetPoint (tp - stp);
204
205 pView->SetView ();
206 pView->ClearView ();
207 pView->DrawView ();
208
209 pView->pan_timer = XtAppAddTimeOut
210 (pView->app,
211 timer_id == NULL ? 500 : 1,
213 pView);
214}

Referenced by pan_up_down_callback(), and up_down_pan_callback().

◆ update_panels_callback()

void G4OpenGLXmViewer::update_panels_callback ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)
static

Definition at line 555 of file G4OpenGLXmMainMenubarCallbacks.cc.

558{
559 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*) clientData;
560
561 if (pView->fppanning_slider) {
563 }
564 if (pView->fprotation_slider) {
566 }
567
568 if (pView->fpzoom_slider) {
569 pView->fpzoom_slider->SetMaxValue (pView->zoom_high);
570 pView->fpzoom_slider->SetMinValue (pView->zoom_low);
572 }
573
574 if (pView->fpdolly_slider) {
575 pView->fpdolly_slider->SetMaxValue (pView->dolly_high);
576 pView->fpdolly_slider->SetMinValue (pView->dolly_low);
577 }
578}
void SetInitialValue(G4double)

Referenced by actions_callback(), and misc_callback().

◆ wobble_callback()

void G4OpenGLXmViewer::wobble_callback ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)
static

Definition at line 250 of file G4OpenGLXmRotationCallbacks.cc.

253{
254 G4OpenGLXmViewer* pView;
255
256 XtVaGetValues (w,
257 XmNuserData, &pView,
258 NULL);
259
260 pView->original_vp = pView->fVP.GetViewpointDirection();
261 pView->wobble_timer = XtAppAddTimeOut
262 (pView->app,
263 (long unsigned int) (1000. * (1. / pView->wob_sens)),
265 pView);
266}
static void wobble_timer_callback(XtPointer clientData, XtIntervalId *timerid)
XtIntervalId wobble_timer

Referenced by misc_callback().

◆ wobble_timer_callback()

void G4OpenGLXmViewer::wobble_timer_callback ( XtPointer  clientData,
XtIntervalId *  timerid 
)
static

Definition at line 268 of file G4OpenGLXmRotationCallbacks.cc.

270{
271 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*)clientData;
272 const G4Vector3D& up = pView->fVP.GetUpVector();
273 G4Vector3D third_axis = up.cross(pView->original_vp);
274 G4double pi_div_by_ten = pi / 10.0;
275 G4Vector3D d_up = 0.1 * (std::sin ((G4double)pView->frameNo * pi_div_by_ten * 2.)) * up;
276 G4Vector3D d_third_axis = 0.1 * (std::sin ((G4double)pView->frameNo * (pi_div_by_ten))) * third_axis;
277
278 pView->fVP.SetViewAndLights (pView->original_vp + d_up + d_third_axis);
279
280 pView->SetView ();
281 pView->ClearView ();
282 pView->DrawView ();
283
284 if (pView->frameNo++ == 20) {
285 if (pView->wobble_timer) {
286 XtRemoveTimeOut (pView->wobble_timer);
287 pView->frameNo = 0;
288 pView->fVP.SetViewAndLights (pView->original_vp);
289 pView->SetView ();
290 pView->ClearView ();
291 pView->DrawView ();
292 }
293 } else {
294 pView->wobble_timer = XtAppAddTimeOut
295 (pView->app,
296 (long unsigned int) (1000. * (1. / pView->wob_sens)),
298 pView);
299 }
300}
void SetViewAndLights(const G4Vector3D &viewpointDirection)
const G4double pi

Referenced by wobble_callback(), and wobble_timer_callback().

◆ zoom_callback()

void G4OpenGLXmViewer::zoom_callback ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)
static

Definition at line 43 of file G4OpenGLXmPanningCallbacks.cc.

46{
47 XmScaleCallbackStruct *cbs = (XmScaleCallbackStruct*) callData;
48 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*) clientData;
49 short dp = -1;
50 G4float ten_to_the_dp = 10.;
51
52 XtVaGetValues (w,
53 XmNdecimalPoints, &dp,
54 NULL);
55
56 if (dp == 0) {
57 ten_to_the_dp = 1.;
58 } else if ( dp > 0) {
59 for (G4int i = 1; i < (G4int)dp; i++) {
60 ten_to_the_dp *= 10.;
61 }
62 } else {
63 G4cout << "dp is " << dp << G4endl;
64 return;
65 }
66
67
68 G4double zoomBy = (G4double)(cbs->value) / ten_to_the_dp;
69 if (zoomBy <= 0.01) {
70 zoomBy = 0.01;
71 }
72
73 pView->fVP.SetZoomFactor (zoomBy);
74 pView->SetView ();
75 pView->ClearView ();
76 pView -> DrawView ();
77}

Referenced by actions_callback().

Friends And Related Function Documentation

◆ G4OpenGLXmViewerMessenger

friend class G4OpenGLXmViewerMessenger
friend

Definition at line 379 of file G4OpenGLXmViewer.hh.

◆ G4OpenGLXmVWidgetObject

friend class G4OpenGLXmVWidgetObject
friend

Definition at line 378 of file G4OpenGLXmViewer.hh.

Member Data Documentation

◆ actions_cascade

Widget G4OpenGLXmViewer::actions_cascade
protected

Definition at line 70 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ actions_str

XmString G4OpenGLXmViewer::actions_str
protected

Definition at line 83 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ anti_str

XmString G4OpenGLXmViewer::anti_str
protected

Definition at line 100 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ antialias_pullright

Widget G4OpenGLXmViewer::antialias_pullright
protected

Definition at line 76 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ app

XtAppContext G4OpenGLXmViewer::app
protected

◆ aux_edge_pullright

Widget G4OpenGLXmViewer::aux_edge_pullright
protected

Definition at line 78 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ aux_edge_str

XmString G4OpenGLXmViewer::aux_edge_str
protected

Definition at line 103 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ background_color_pullright

Widget G4OpenGLXmViewer::background_color_pullright
protected

Definition at line 74 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ bgnd

◆ bgnd_str

XmString G4OpenGLXmViewer::bgnd_str
protected

Definition at line 104 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ black_str

XmString G4OpenGLXmViewer::black_str
protected

Definition at line 99 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ borcol

◆ dolly_high

G4double G4OpenGLXmViewer::dolly_high
protected

◆ dolly_low

G4double G4OpenGLXmViewer::dolly_low
protected

◆ draw_str

XmString G4OpenGLXmViewer::draw_str
protected

Definition at line 86 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ drawing_style_pullright

Widget G4OpenGLXmViewer::drawing_style_pullright
protected

Definition at line 73 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ e_str

const G4String G4OpenGLXmViewer::e_str = ""
staticprotected

Definition at line 136 of file G4OpenGLXmViewer.hh.

Referenced by Add_radio_box(), and Add_slider_box().

◆ exit_str

XmString G4OpenGLXmViewer::exit_str
protected

Definition at line 95 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ fov

G4double G4OpenGLXmViewer::fov
protected

Definition at line 114 of file G4OpenGLXmViewer.hh.

Referenced by misc_callback(), and projection_callback().

◆ fpdolly_box

G4OpenGLXmFramedBox* G4OpenGLXmViewer::fpdolly_box
protected

Definition at line 171 of file G4OpenGLXmViewer.hh.

Referenced by actions_callback().

◆ fpdolly_lower

G4OpenGLXmTextField* G4OpenGLXmViewer::fpdolly_lower
protected

Definition at line 181 of file G4OpenGLXmViewer.hh.

Referenced by actions_callback().

◆ fpdolly_slider

G4OpenGLXmSliderBar* G4OpenGLXmViewer::fpdolly_slider
protected

◆ fpdolly_upper

G4OpenGLXmTextField* G4OpenGLXmViewer::fpdolly_upper
protected

Definition at line 180 of file G4OpenGLXmViewer.hh.

Referenced by actions_callback().

◆ fpfov_text

G4OpenGLXmTextField* G4OpenGLXmViewer::fpfov_text
protected

Definition at line 193 of file G4OpenGLXmViewer.hh.

Referenced by misc_callback().

◆ fpmiscellany_top

G4OpenGLXmTopLevelShell* G4OpenGLXmViewer::fpmiscellany_top
protected

Definition at line 184 of file G4OpenGLXmViewer.hh.

Referenced by misc_callback().

◆ fpok_button

G4OpenGLXmPushButton* G4OpenGLXmViewer::fpok_button
protected

Definition at line 182 of file G4OpenGLXmViewer.hh.

Referenced by actions_callback().

◆ fporthogonal_button

G4OpenGLXmRadioButton* G4OpenGLXmViewer::fporthogonal_button
protected

Definition at line 191 of file G4OpenGLXmViewer.hh.

Referenced by misc_callback().

◆ fppan_set

G4OpenGLXmTextField* G4OpenGLXmViewer::fppan_set
protected

Definition at line 176 of file G4OpenGLXmViewer.hh.

Referenced by actions_callback().

◆ fppanning_arrows

G4OpenGLXmFourArrowButtons* G4OpenGLXmViewer::fppanning_arrows
protected

Definition at line 167 of file G4OpenGLXmViewer.hh.

Referenced by actions_callback().

◆ fppanning_box

G4OpenGLXmFramedBox* G4OpenGLXmViewer::fppanning_box
protected

Definition at line 166 of file G4OpenGLXmViewer.hh.

Referenced by actions_callback().

◆ fppanning_slider

G4OpenGLXmSliderBar* G4OpenGLXmViewer::fppanning_slider
protected

◆ fppanning_top

G4OpenGLXmTopLevelShell* G4OpenGLXmViewer::fppanning_top
protected

Definition at line 165 of file G4OpenGLXmViewer.hh.

Referenced by actions_callback().

◆ fpperspective_button

G4OpenGLXmRadioButton* G4OpenGLXmViewer::fpperspective_button
protected

Definition at line 192 of file G4OpenGLXmViewer.hh.

Referenced by misc_callback().

◆ fpprint_box

G4OpenGLXmFramedBox* G4OpenGLXmViewer::fpprint_box
protected

Definition at line 196 of file G4OpenGLXmViewer.hh.

Referenced by misc_callback().

◆ fpprint_button

G4OpenGLXmPushButton* G4OpenGLXmViewer::fpprint_button
protected

Definition at line 200 of file G4OpenGLXmViewer.hh.

Referenced by misc_callback().

◆ fpprint_col_box

G4OpenGLXmFramedBox* G4OpenGLXmViewer::fpprint_col_box
protected

Definition at line 197 of file G4OpenGLXmViewer.hh.

Referenced by misc_callback().

◆ fpprint_col_radio1

G4OpenGLXmRadioButton* G4OpenGLXmViewer::fpprint_col_radio1
protected

Definition at line 202 of file G4OpenGLXmViewer.hh.

Referenced by misc_callback().

◆ fpprint_col_radio2

G4OpenGLXmRadioButton* G4OpenGLXmViewer::fpprint_col_radio2
protected

Definition at line 203 of file G4OpenGLXmViewer.hh.

Referenced by misc_callback().

◆ fpprint_line

G4OpenGLXmSeparator* G4OpenGLXmViewer::fpprint_line
protected

Definition at line 201 of file G4OpenGLXmViewer.hh.

Referenced by misc_callback().

◆ fpprint_style_box

G4OpenGLXmFramedBox* G4OpenGLXmViewer::fpprint_style_box
protected

Definition at line 198 of file G4OpenGLXmViewer.hh.

Referenced by misc_callback().

◆ fpprint_style_radio1

G4OpenGLXmRadioButton* G4OpenGLXmViewer::fpprint_style_radio1
protected

Definition at line 204 of file G4OpenGLXmViewer.hh.

Referenced by misc_callback().

◆ fpprint_style_radio2

G4OpenGLXmRadioButton* G4OpenGLXmViewer::fpprint_style_radio2
protected

Definition at line 205 of file G4OpenGLXmViewer.hh.

Referenced by misc_callback().

◆ fpprint_text

G4OpenGLXmTextField* G4OpenGLXmViewer::fpprint_text
protected

Definition at line 199 of file G4OpenGLXmViewer.hh.

Referenced by misc_callback().

◆ fpprint_top

G4OpenGLXmTopLevelShell* G4OpenGLXmViewer::fpprint_top
protected

Definition at line 195 of file G4OpenGLXmViewer.hh.

Referenced by misc_callback().

◆ fpproj_style_box

G4OpenGLXmFramedBox* G4OpenGLXmViewer::fpproj_style_box
protected

Definition at line 190 of file G4OpenGLXmViewer.hh.

Referenced by misc_callback().

◆ fpreset_box

G4OpenGLXmFramedBox* G4OpenGLXmViewer::fpreset_box
protected

Definition at line 188 of file G4OpenGLXmViewer.hh.

Referenced by misc_callback().

◆ fpreset_button

G4OpenGLXmPushButton* G4OpenGLXmViewer::fpreset_button
protected

Definition at line 189 of file G4OpenGLXmViewer.hh.

Referenced by misc_callback().

◆ fprot_set

G4OpenGLXmTextField* G4OpenGLXmViewer::fprot_set
protected

Definition at line 177 of file G4OpenGLXmViewer.hh.

Referenced by actions_callback().

◆ fprotation_arrow

G4OpenGLXmFourArrowButtons* G4OpenGLXmViewer::fprotation_arrow
protected

Definition at line 163 of file G4OpenGLXmViewer.hh.

Referenced by actions_callback().

◆ fprotation_arrow_box

G4OpenGLXmBox* G4OpenGLXmViewer::fprotation_arrow_box
protected

Definition at line 162 of file G4OpenGLXmViewer.hh.

Referenced by actions_callback().

◆ fprotation_button1

G4OpenGLXmRadioButton* G4OpenGLXmViewer::fprotation_button1
protected

Definition at line 158 of file G4OpenGLXmViewer.hh.

Referenced by actions_callback().

◆ fprotation_button2

G4OpenGLXmRadioButton* G4OpenGLXmViewer::fprotation_button2
protected

Definition at line 159 of file G4OpenGLXmViewer.hh.

Referenced by actions_callback().

◆ fprotation_button_box

G4OpenGLXmBox* G4OpenGLXmViewer::fprotation_button_box
protected

Definition at line 157 of file G4OpenGLXmViewer.hh.

Referenced by actions_callback().

◆ fprotation_slider

G4OpenGLXmSliderBar* G4OpenGLXmViewer::fprotation_slider
protected

◆ fprotation_slider_box

G4OpenGLXmBox* G4OpenGLXmViewer::fprotation_slider_box
protected

Definition at line 160 of file G4OpenGLXmViewer.hh.

Referenced by actions_callback().

◆ fprotation_top

G4OpenGLXmTopLevelShell* G4OpenGLXmViewer::fprotation_top
protected

Definition at line 156 of file G4OpenGLXmViewer.hh.

Referenced by actions_callback().

◆ fpsetting_box

G4OpenGLXmFramedBox* G4OpenGLXmViewer::fpsetting_box
protected

Definition at line 175 of file G4OpenGLXmViewer.hh.

Referenced by actions_callback().

◆ fpsetting_top

G4OpenGLXmTopLevelShell* G4OpenGLXmViewer::fpsetting_top
protected

Definition at line 174 of file G4OpenGLXmViewer.hh.

Referenced by actions_callback().

◆ fpwobble_box

G4OpenGLXmFramedBox* G4OpenGLXmViewer::fpwobble_box
protected

Definition at line 185 of file G4OpenGLXmViewer.hh.

Referenced by misc_callback().

◆ fpwobble_button

G4OpenGLXmPushButton* G4OpenGLXmViewer::fpwobble_button
protected

Definition at line 186 of file G4OpenGLXmViewer.hh.

Referenced by misc_callback().

◆ fpwobble_slider

G4OpenGLXmSliderBar* G4OpenGLXmViewer::fpwobble_slider
protected

Definition at line 187 of file G4OpenGLXmViewer.hh.

Referenced by misc_callback().

◆ fpzoom_box

G4OpenGLXmFramedBox* G4OpenGLXmViewer::fpzoom_box
protected

Definition at line 169 of file G4OpenGLXmViewer.hh.

Referenced by actions_callback().

◆ fpzoom_lower

G4OpenGLXmTextField* G4OpenGLXmViewer::fpzoom_lower
protected

Definition at line 179 of file G4OpenGLXmViewer.hh.

Referenced by actions_callback().

◆ fpzoom_slider

G4OpenGLXmSliderBar* G4OpenGLXmViewer::fpzoom_slider
protected

◆ fpzoom_upper

G4OpenGLXmTextField* G4OpenGLXmViewer::fpzoom_upper
protected

Definition at line 178 of file G4OpenGLXmViewer.hh.

Referenced by actions_callback().

◆ frame

Widget G4OpenGLXmViewer::frame
protected

Definition at line 79 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ frameNo

G4int G4OpenGLXmViewer::frameNo
protected

Definition at line 135 of file G4OpenGLXmViewer.hh.

Referenced by wobble_timer_callback().

◆ glxarea

Widget G4OpenGLXmViewer::glxarea
protected

Definition at line 80 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ halo_str

XmString G4OpenGLXmViewer::halo_str
protected

Definition at line 102 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ haloing_pullright

Widget G4OpenGLXmViewer::haloing_pullright
protected

Definition at line 77 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ hlhsr_str

XmString G4OpenGLXmViewer::hlhsr_str
protected

Definition at line 91 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ hlr_str

XmString G4OpenGLXmViewer::hlr_str
protected

Definition at line 89 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ hsr_str

XmString G4OpenGLXmViewer::hsr_str
protected

Definition at line 90 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ main_win

Widget G4OpenGLXmViewer::main_win
protected

Definition at line 67 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ menu_str

G4String G4OpenGLXmViewer::menu_str[37]
protected
Initial value:
= { "Style", "style",
"Actions", "actions",
"Miscellany", "miscellany",
"Special", "special",
"menubar", "Drawing",
"Background color", "Wireframe",
"Hidden line removal", "Hidden surface removal",
"Hidden line and surface removal", "drawing_style",
"White", "Black",
"background_color", "Rotation control panel",
"Panning control panel", "Set control panel limits",
"Miscellany control panel",
"Exit to G4Vis>", "Create .eps file",
"Transparency", "transparency",
"Antialiasing", "antialias",
"Haloing", "haloing",
"Auxiliary edges", "aux_edge",
"Off", "On", "frame", "glxarea" }

Definition at line 137 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ menubar

Widget G4OpenGLXmViewer::menubar
protected

Definition at line 68 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ misc_cascade

Widget G4OpenGLXmViewer::misc_cascade
protected

Definition at line 71 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ misc_str

XmString G4OpenGLXmViewer::misc_str
protected

Definition at line 84 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ off_str

XmString G4OpenGLXmViewer::off_str
protected

Definition at line 105 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ on_str

XmString G4OpenGLXmViewer::on_str
protected

Definition at line 106 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ original_vp

G4Vector3D G4OpenGLXmViewer::original_vp
protected

Definition at line 133 of file G4OpenGLXmViewer.hh.

Referenced by wobble_callback(), and wobble_timer_callback().

◆ pan_high

G4double G4OpenGLXmViewer::pan_high
protected

Definition at line 111 of file G4OpenGLXmViewer.hh.

◆ pan_low

G4double G4OpenGLXmViewer::pan_low
protected

Definition at line 110 of file G4OpenGLXmViewer.hh.

◆ pan_right

G4bool G4OpenGLXmViewer::pan_right
protected

Definition at line 124 of file G4OpenGLXmViewer.hh.

Referenced by left_right_pan_callback(), and pan_left_right_callback().

◆ pan_sens_limit

G4double G4OpenGLXmViewer::pan_sens_limit
protected

◆ pan_str

XmString G4OpenGLXmViewer::pan_str
protected

Definition at line 94 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ pan_timer

XtIntervalId G4OpenGLXmViewer::pan_timer
protected

◆ pan_up

G4bool G4OpenGLXmViewer::pan_up
protected

Definition at line 126 of file G4OpenGLXmViewer.hh.

Referenced by pan_up_down_callback(), and up_down_pan_callback().

◆ polyhedron_str

XmString G4OpenGLXmViewer::polyhedron_str
protected

Definition at line 87 of file G4OpenGLXmViewer.hh.

◆ print_str

XmString G4OpenGLXmViewer::print_str
protected

Definition at line 97 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ quit_str

XmString G4OpenGLXmViewer::quit_str
protected

Definition at line 96 of file G4OpenGLXmViewer.hh.

◆ rot_sens_limit

G4double G4OpenGLXmViewer::rot_sens_limit
protected

◆ rot_str

XmString G4OpenGLXmViewer::rot_str
protected

Definition at line 93 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ rotate_right

G4bool G4OpenGLXmViewer::rotate_right
protected

Definition at line 125 of file G4OpenGLXmViewer.hh.

Referenced by rotate_in_theta(), and theta_rotation_callback().

◆ rotate_up

G4bool G4OpenGLXmViewer::rotate_up
protected

Definition at line 127 of file G4OpenGLXmViewer.hh.

Referenced by phi_rotation_callback(), and rotate_in_phi().

◆ rotation_timer

XtIntervalId G4OpenGLXmViewer::rotation_timer
protected

◆ set_str

XmString G4OpenGLXmViewer::set_str
protected

Definition at line 92 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ shell

Widget G4OpenGLXmViewer::shell
protected

Definition at line 66 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow(), GetXmConnection(), and ~G4OpenGLXmViewer().

◆ spec_cascade

Widget G4OpenGLXmViewer::spec_cascade
protected

Definition at line 72 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ spec_str

XmString G4OpenGLXmViewer::spec_str
protected

Definition at line 85 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ style_cascade

Widget G4OpenGLXmViewer::style_cascade
protected

Definition at line 69 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ style_str

XmString G4OpenGLXmViewer::style_str
protected

Definition at line 82 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ toplevel

Widget G4OpenGLXmViewer::toplevel
protected

Definition at line 65 of file G4OpenGLXmViewer.hh.

Referenced by GetXmConnection(), and G4OpenGLXmVWidgetObject::ProcesspView().

◆ trans_str

XmString G4OpenGLXmViewer::trans_str
protected

Definition at line 101 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ transparency_pullright

Widget G4OpenGLXmViewer::transparency_pullright
protected

Definition at line 75 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ white_str

XmString G4OpenGLXmViewer::white_str
protected

Definition at line 98 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ wireframe_str

XmString G4OpenGLXmViewer::wireframe_str
protected

Definition at line 88 of file G4OpenGLXmViewer.hh.

Referenced by CreateMainWindow().

◆ wob_high

G4double G4OpenGLXmViewer::wob_high
protected

Definition at line 117 of file G4OpenGLXmViewer.hh.

Referenced by misc_callback(), and ResetView().

◆ wob_low

G4double G4OpenGLXmViewer::wob_low
protected

Definition at line 118 of file G4OpenGLXmViewer.hh.

Referenced by misc_callback(), and ResetView().

◆ wob_sens

G4double G4OpenGLXmViewer::wob_sens
protected

◆ wobble_timer

XtIntervalId G4OpenGLXmViewer::wobble_timer
protected

Definition at line 131 of file G4OpenGLXmViewer.hh.

Referenced by wobble_callback(), and wobble_timer_callback().

◆ workId

XtWorkProcId G4OpenGLXmViewer::workId
protected

Definition at line 64 of file G4OpenGLXmViewer.hh.

◆ zoom_high

G4double G4OpenGLXmViewer::zoom_high
protected

◆ zoom_low

G4double G4OpenGLXmViewer::zoom_low
protected

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