Navigation

Main Page
Download
Support
Installation
Tutorial
Examples
Reference Manual
   Version 1.0.6dev
      Class Index
      File List
   Version 1.0.6
   Version 1.0.5new_solver
   Version 1.0.5dev
   Version 1.0.5b
   Version 1.0.4dev
   Version 1.0.4
Publications


Hosted by Get Ion Beam Simulator at SourceForge.net. Fast, secure and Free Open Source software downloads
gtkgeomwindow.hpp
Go to the documentation of this file.
1 
5 /* Copyright (c) 2005-2013, 2022 Taneli Kalvas. All rights reserved.
6  *
7  * You can redistribute this software and/or modify it under the terms
8  * of the GNU General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * This library is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this library (file "COPYING" included in the package);
19  * if not, write to the Free Software Foundation, Inc., 51 Franklin
20  * Street, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  * If you have questions about your rights to use or distribute this
23  * software, please contact Berkeley Lab's Technology Transfer
24  * Department at TTD@lbl.gov. Other questions, comments and bug
25  * reports should be sent directly to the author via email at
26  * taneli.kalvas@jyu.fi.
27  *
28  * NOTICE. This software was developed under partial funding from the
29  * U.S. Department of Energy. As such, the U.S. Government has been
30  * granted for itself and others acting on its behalf a paid-up,
31  * nonexclusive, irrevocable, worldwide license in the Software to
32  * reproduce, prepare derivative works, and perform publicly and
33  * display publicly. Beginning five (5) years after the date
34  * permission to assert copyright is obtained from the U.S. Department
35  * of Energy, and subject to any subsequent five (5) year renewals,
36  * the U.S. Government is granted for itself and others acting on its
37  * behalf a paid-up, nonexclusive, irrevocable, worldwide license in
38  * the Software to reproduce, prepare derivative works, distribute
39  * copies to the public, perform publicly and display publicly, and to
40  * permit others to do so.
41  */
42 
43 #ifndef GTKGEOMWINDOW_HPP
44 #define GTKGEOMWINDOW_HPP 1
45 
46 
47 #include <vector>
48 
49 #include "gtkframewindow.hpp"
50 #include "geomplot.hpp"
51 #include "meshscalarfield.hpp"
52 #include "epot_field.hpp"
53 #include "epot_efield.hpp"
54 #include "vectorfield.hpp"
55 
56 
57 
60 class GTKGeomWindow : public GTKFrameWindow {
61 
62  struct PreferencesData {
63  GtkWidget *manual_eqlines_entry;
64  GtkWidget *automatic_eqlines_spin;
65  GtkWidget *particle_div_spin;
66  GtkWidget *particle_offset_spin;
67 
68  GtkWidget *qmdiscretation_check;
69  GtkWidget *meshen_check;
70 
71  GtkWidget *field_none_radio;
72  GtkWidget *field_J_radio;
73  GtkWidget *field_rho_radio;
74  GtkWidget *field_phi_radio;
75 
76  GtkWidget *field_E_radio;
77  GtkWidget *field_Ex_radio;
78  GtkWidget *field_Ey_radio;
79  GtkWidget *field_Ez_radio;
80 
81  GtkWidget *field_B_radio;
82  GtkWidget *field_Bx_radio;
83  GtkWidget *field_By_radio;
84  GtkWidget *field_Bz_radio;
85 
86  GtkWidget *int_closest_radio;
87  GtkWidget *int_bilinear_radio;
88  GtkWidget *int_bicubic_radio;
89 
90  GtkWidget *zscale_lin_radio;
91  GtkWidget *zscale_log_radio;
92  GtkWidget *zscale_rellog_radio;
93 
94  GtkWidget *zmin_entry;
95  GtkWidget *zmax_entry;
96 
97  GtkWidget *palette_steps_entry;
98  };
99 
100  GeomPlot _geomplot;
101 
102  const Geometry &_geom;
103  const EpotField *_epot;
104  const EpotEfield *_efield;
105  const MeshScalarField *_scharge;
106  const MeshScalarField *_tdens;
107  const VectorField *_bfield;
108  const ParticleDataBase *_pdb;
109 
110  GtkWidget *_spinbutton;
111  GtkWidget *_combobox;
112 
113  PreferencesData *_prefdata;
114 
115  void update_view();
116 
117  virtual void zoom_fit( void );
118  virtual std::string track_text( double x, double y );
119 
120  virtual void *build_preferences( GtkWidget *notebook );
121  virtual void read_preferences( GtkWidget *notebook, void *pdata );
122 
123  void combobox( GtkComboBox *combobox );
124  void spinbutton( GtkSpinButton *spinbutton );
125  void menuitem_tool_change( GtkToolButton *button );
126  void field_diag( int action, double x, double y );
127  void particle_diag( int action, double x, double y );
128  void draw2( cairo_t *cairo );
129  void darea_motion2( GdkEventMotion *event );
130  void darea_button2( GdkEventButton *event );
131  void field_activate( void );
132  void geom3d_launch( void );
133 
134  static void combobox_signal( GtkComboBox *combobox,
135  gpointer object );
136  static void spinbutton_signal( GtkSpinButton *spinbutton,
137  gpointer object );
138  static void menuitem_tool_change_signal( GtkToolButton *button,
139  gpointer object );
140  static void menuitem_geom3d_signal( GtkToolButton *button,
141  gpointer object );
142  static gboolean darea_draw_signal2( GtkWidget *widget,
143  cairo_t *cairo,
144  gpointer object );
145  static gboolean darea_motion_signal2( GtkWidget *widget,
146  GdkEventMotion *event,
147  gpointer object );
148  static gboolean darea_button_signal2( GtkWidget *widget,
149  GdkEventButton *event,
150  gpointer object );
151  static void field_toggled( GtkToggleButton *togglebutton,
152  gpointer user_data );
153 
154 public:
155 
158  GTKGeomWindow( class GTKPlotter &plotter,
159  const Geometry &geom,
160  const EpotField *epot,
161  const EpotEfield *efield,
162  const MeshScalarField *scharge,
163  const MeshScalarField *tdens,
164  const VectorField *bfield,
165  const ParticleDataBase *pdb );
166 
169  virtual ~GTKGeomWindow();
170 };
171 
172 
173 #endif
Vector field based on interpolation of electric potential.
Definition: epot_efield.hpp:72
Electric potential field.
Definition: epot_field.hpp:55
Base class for interactive plotters.
Definition: gtkframewindow.hpp:61
Interactive geometry plotter window.
Definition: gtkgeomwindow.hpp:60
GTKGeomWindow(class GTKPlotter &plotter, const Geometry &geom, const EpotField *epot, const EpotEfield *efield, const MeshScalarField *scharge, const MeshScalarField *tdens, const VectorField *bfield, const ParticleDataBase *pdb)
Constructor.
Definition: gtkgeomwindow.cpp:59
virtual ~GTKGeomWindow()
Destructor.
Definition: gtkgeomwindow.cpp:399
GTK Plotter class.
Definition: gtkplotter.hpp:66
Geometry plotter class.
Definition: geomplot.hpp:70
Geometry defining class.
Definition: geometry.hpp:180
Scalar field class.
Definition: meshscalarfield.hpp:70
Particle database base class.
Definition: particledatabase.hpp:191
Vector field.
Definition: vectorfield.hpp:56
Electric potential base electric field.
Electric potential field.
Geometry plotting
Window for GTK plots with frames.
Mesh based scalar fields.
Vector field base.


Reference manual for Ion Beam Simulator 1.0.6dev
Generated by Doxygen 1.9.1 on Thu Sep 11 2025 09:37:24.