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

#include <G4OpenGLXmSliderBar.hh>

+ Inheritance diagram for G4OpenGLXmSliderBar:

Public Member Functions

 G4OpenGLXmSliderBar (const char *=NULL, XtCallbackRec *=NULL, G4bool=False, short=0, G4double=0., G4double=0., G4double=0., unsigned char=XmHORIZONTAL, unsigned char=XmMAX_ON_RIGHT)
 
virtual ~G4OpenGLXmSliderBar ()
 
void SetName (const char *)
 
void SetShow (G4bool)
 
void SetDecimalPlaces (short)
 
void SetInitialValue (G4double)
 
void SetMaxValue (G4double)
 
void SetMinValue (G4double)
 
void SetOrientation (unsigned char)
 
void SetDirection (unsigned char)
 
const char * GetName ()
 
G4bool GetShow ()
 
short GetDecimalPlaces ()
 
G4double GetInitialValue ()
 
G4double GetMaxValue ()
 
G4double GetMinValue ()
 
unsigned char GetOrientation ()
 
unsigned char GetDirection ()
 
void AddYourselfTo (G4OpenGLXmVWidgetContainer *)
 
Widget * GetPointerToParent ()
 
Widget * GetPointerToWidget ()
 
- Public Member Functions inherited from G4OpenGLXmVWidgetComponent
 G4OpenGLXmVWidgetComponent ()
 
virtual ~G4OpenGLXmVWidgetComponent ()
 
- Public Member Functions inherited from G4OpenGLXmVWidgetObject
 G4OpenGLXmVWidgetObject ()
 
virtual ~G4OpenGLXmVWidgetObject ()
 
G4OpenGLXmViewerGetView ()
 
void ProcesspView ()
 

Additional Inherited Members

- Protected Member Functions inherited from G4OpenGLXmVWidgetObject
 G4OpenGLXmVWidgetObject (const G4OpenGLXmVWidgetObject &)
 
G4OpenGLXmVWidgetObjectoperator= (const G4OpenGLXmVWidgetObject &)
 
- Protected Attributes inherited from G4OpenGLXmVWidgetObject
G4OpenGLXmViewerpView
 
Colormap cmap
 
Pixel borcol
 
Pixel bgnd
 
unsigned int depth
 
Visual * visual
 
Widget top
 

Detailed Description

Definition at line 36 of file G4OpenGLXmSliderBar.hh.

Constructor & Destructor Documentation

◆ G4OpenGLXmSliderBar()

G4OpenGLXmSliderBar::G4OpenGLXmSliderBar ( const char * n = NULL,
XtCallbackRec * c = NULL,
G4bool sh = False,
short dp = 0,
G4double v = 0.,
G4double max = 0.,
G4double min = 0.,
unsigned char o = XmHORIZONTAL,
unsigned char d = XmMAX_ON_RIGHT )

Definition at line 37 of file G4OpenGLXmSliderBar.cc.

46: sliderbar(0)
47, parent(0)
48{
49 name = n;
50 callback = c;
51 show = sh;
52 decimal_places = dp;
53 initial_value = int(v * std::pow(10.0, (G4double)dp));
54 max_value = int(max * std::pow(10.0, (G4double)dp));
55 min_value = int(min * std::pow(10.0, (G4double)dp));
56 orientation = o;
57 direction = d;
58}
double G4double
Definition G4Types.hh:83

◆ ~G4OpenGLXmSliderBar()

G4OpenGLXmSliderBar::~G4OpenGLXmSliderBar ( )
virtual

Definition at line 60 of file G4OpenGLXmSliderBar.cc.

61{}

Member Function Documentation

◆ AddYourselfTo()

void G4OpenGLXmSliderBar::AddYourselfTo ( G4OpenGLXmVWidgetContainer * container)
virtual

Implements G4OpenGLXmVWidgetComponent.

Definition at line 176 of file G4OpenGLXmSliderBar.cc.

177{
178
179 pView = container->GetView ();
180 ProcesspView ();
181
182 parent = container->GetPointerToWidget ();
183 XmString name_string = XmStringCreateLocalized ((char*)name);
184 sliderbar = XtVaCreateManagedWidget (name,
185 xmScaleWidgetClass,
186 *parent,
187
188 XmNtitleString, name_string,
189 XmNmaximum, max_value,
190 XmNminimum, min_value,
191 XmNvalue, initial_value,
192 XmNshowValue, show,
193 XmNdecimalPoints, decimal_places,
194 XmNorientation, orientation,
195 XmNprocessingDirection, direction,
196
197 XtNvisual, visual,
198 XtNdepth, depth,
199 XtNcolormap, cmap,
200 XtNborderColor, borcol,
201 XtNbackground, bgnd,
202
203 NULL);
204
205 XtAddCallbacks (sliderbar,
206 XmNvalueChangedCallback,
207 callback);
208
209 XtAddCallbacks (sliderbar,
210 XmNdragCallback,
211 callback);
212 XmStringFree (name_string);
213}
virtual Widget * GetPointerToWidget()=0

◆ GetDecimalPlaces()

short G4OpenGLXmSliderBar::GetDecimalPlaces ( )

Definition at line 73 of file G4OpenGLXmSliderBar.cc.

74{
75 return decimal_places;
76}

Referenced by GetInitialValue(), GetMaxValue(), GetMinValue(), SetInitialValue(), SetMaxValue(), and SetMinValue().

◆ GetDirection()

unsigned char G4OpenGLXmSliderBar::GetDirection ( )

Definition at line 98 of file G4OpenGLXmSliderBar.cc.

99{
100 return direction;
101}

◆ GetInitialValue()

G4double G4OpenGLXmSliderBar::GetInitialValue ( )

Definition at line 78 of file G4OpenGLXmSliderBar.cc.

79{
80 return (G4double)initial_value / std::pow(10.0, (G4double)GetDecimalPlaces());
81}

◆ GetMaxValue()

G4double G4OpenGLXmSliderBar::GetMaxValue ( )

Definition at line 83 of file G4OpenGLXmSliderBar.cc.

84{
85 return (G4double)max_value / std::pow(10.0, (G4double)GetDecimalPlaces());
86}

◆ GetMinValue()

G4double G4OpenGLXmSliderBar::GetMinValue ( )

Definition at line 88 of file G4OpenGLXmSliderBar.cc.

89{
90 return (G4double)min_value / std::pow(10.0, (G4double)GetDecimalPlaces());
91}

◆ GetName()

const char * G4OpenGLXmSliderBar::GetName ( )

Definition at line 63 of file G4OpenGLXmSliderBar.cc.

64{
65 return name;
66}

◆ GetOrientation()

unsigned char G4OpenGLXmSliderBar::GetOrientation ( )

Definition at line 93 of file G4OpenGLXmSliderBar.cc.

94{
95 return orientation;
96}

◆ GetPointerToParent()

Widget * G4OpenGLXmSliderBar::GetPointerToParent ( )
virtual

Implements G4OpenGLXmVWidgetComponent.

Definition at line 215 of file G4OpenGLXmSliderBar.cc.

216{
217 return parent;
218}

◆ GetPointerToWidget()

Widget * G4OpenGLXmSliderBar::GetPointerToWidget ( )
virtual

Implements G4OpenGLXmVWidgetComponent.

Definition at line 220 of file G4OpenGLXmSliderBar.cc.

221{
222 return &sliderbar;
223}

◆ GetShow()

G4bool G4OpenGLXmSliderBar::GetShow ( )

Definition at line 68 of file G4OpenGLXmSliderBar.cc.

69{
70 return show;
71}

◆ SetDecimalPlaces()

void G4OpenGLXmSliderBar::SetDecimalPlaces ( short dp)

Definition at line 122 of file G4OpenGLXmSliderBar.cc.

123{
124 decimal_places = dp;
125 XtVaSetValues (sliderbar,
126 XmNdecimalPoints, decimal_places,
127 NULL);
128
129}

◆ SetDirection()

void G4OpenGLXmSliderBar::SetDirection ( unsigned char d)

Definition at line 167 of file G4OpenGLXmSliderBar.cc.

168{
169 direction = d;
170 XtVaSetValues (sliderbar,
171 XmNprocessingDirection, direction,
172 NULL);
173
174}

◆ SetInitialValue()

void G4OpenGLXmSliderBar::SetInitialValue ( G4double v)

Definition at line 131 of file G4OpenGLXmSliderBar.cc.

132{
133 initial_value = int(v * std::pow(10.0, (G4double)GetDecimalPlaces()));
134 XtVaSetValues (sliderbar,
135 XmNvalue, initial_value,
136 NULL);
137
138}

Referenced by G4OpenGLXmViewerMessenger::SetNewValue(), and G4OpenGLXmViewer::update_panels_callback().

◆ SetMaxValue()

void G4OpenGLXmSliderBar::SetMaxValue ( G4double v)

Definition at line 140 of file G4OpenGLXmSliderBar.cc.

141{
142 max_value = int(v * std::pow(10.0, (G4double)GetDecimalPlaces()));
143 XtVaSetValues (sliderbar,
144 XmNmaximum, max_value,
145 NULL);
146
147}

Referenced by G4OpenGLXmViewerMessenger::SetNewValue(), and G4OpenGLXmViewer::update_panels_callback().

◆ SetMinValue()

void G4OpenGLXmSliderBar::SetMinValue ( G4double v)

Definition at line 149 of file G4OpenGLXmSliderBar.cc.

150{
151 min_value = int(v * std::pow(10.0, (G4double)GetDecimalPlaces()));
152 XtVaSetValues (sliderbar,
153 XmNminimum, min_value,
154 NULL);
155
156}

Referenced by G4OpenGLXmViewerMessenger::SetNewValue(), and G4OpenGLXmViewer::update_panels_callback().

◆ SetName()

void G4OpenGLXmSliderBar::SetName ( const char * n)

Definition at line 103 of file G4OpenGLXmSliderBar.cc.

104{
105 name = n;
106 XmString sliderbar_string = XmStringCreateLocalized ((char*)name);
107 XtVaSetValues (sliderbar,
108 XmNlabelString, sliderbar_string,
109 NULL);
110 XmStringFree (sliderbar_string);
111}

◆ SetOrientation()

void G4OpenGLXmSliderBar::SetOrientation ( unsigned char o)

Definition at line 158 of file G4OpenGLXmSliderBar.cc.

159{
160 orientation = o;
161 XtVaSetValues (sliderbar,
162 XmNorientation, orientation,
163 NULL);
164
165}

◆ SetShow()

void G4OpenGLXmSliderBar::SetShow ( G4bool sh)

Definition at line 113 of file G4OpenGLXmSliderBar.cc.

114{
115 show = sh;
116 XtVaSetValues (sliderbar,
117 XmNshowValue, show,
118 NULL);
119
120}

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