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
gtkgeom3dwindow.hpp
Go to the documentation of this file.
1 
5 /* Copyright (c) 2012-2013 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 
44 #ifndef GTKGEOM3DWINDOW_HPP
45 #define GTKGEOM3DWINDOW_HPP 1
46 
47 
48 #include <gtk/gtk.h>
49 #include "gtkwindow.hpp"
50 #include "gtkplotter.hpp"
51 #include "geom3dplot.hpp"
52 
53 
56 class GTKGeom3DWindow : public GTKWindow {
57 
58  GTKPlotter &_plotter;
59  Geom3DPlot _geom3dplot;
60  const Geometry &_geom;
61 
62  GtkWidget *_window;
63  GtkWidget *_darea;
64  GtkWidget *_menubar;
65  GtkWidget *_menu_file;
66  GtkWidget *_toolbar;
67  GtkWidget *_statusbar;
68  GtkToolItem *_radioitem;
69 
70  uint32_t _width;
71  uint32_t _height;
72 
73  int _tool;
74  double _oldx;
75  double _oldy;
76  double _endx;
77  double _endy;
78 
79  class Renderer *_renderer;
80 
81  void init_window( void );
82  void init_renderer( void );
83 
84  void move( int action, double x, double y );
85  void zoom_out( double x, double y );
86  void zoom_in( double x, double y );
87  void zoom_window( int action, double x, double y );
88  void zoom_fit( void );
89  void geom2d_launch( void );
90  void hardcopy( void );
91 
92  void track( int action, double x, double y );
93 
94  void darea_motion( GdkEventMotion *event );
95  void darea_enter( GdkEventCrossing *event );
96  void darea_leave( GdkEventCrossing *event );
97  void darea_button( GdkEventButton *event );
98 
99  void draw( cairo_t *cairo );
100  //void expose( void );
101  void configure( void );
102  void delete_window( void );
103 
104  void menuitem_tool_change( GtkToolButton *button );
105  void menuitem_preferences( GtkMenuItem *menuitem );
106 
107  static gboolean window_delete_signal( GtkWidget *widget,
108  GdkEventExpose *event,
109  gpointer object );
110 
111  static void menuitem_quit_signal( GtkMenuItem *menuitem,
112  gpointer object );
113  static void menuitem_tool_change_signal( GtkToolButton *button,
114  gpointer object );
115  static void menuitem_hardcopy_signal( GtkToolButton *button,
116  gpointer object );
117  static void menuitem_zoom_fit_signal( GtkToolButton *button,
118  gpointer object );
119  static void menuitem_geom2d_signal( GtkToolButton *button,
120  gpointer object );
121  static void menuitem_preferences_signal( GtkMenuItem *menuitem,
122  gpointer object );
123 
124  static gboolean darea_configure_signal( GtkWidget *widget,
125  GdkEventConfigure *event,
126  gpointer object );
127  static gboolean darea_draw_signal( GtkWidget *widget,
128  cairo_t *cairo,
129  gpointer object );
130  /*
131  static gboolean darea_expose_signal( GtkWidget *widget,
132  GdkEventExpose *event,
133  gpointer object );
134  */
135  static gboolean darea_button_signal( GtkWidget *widget,
136  GdkEventButton *event,
137  gpointer object );
138  static gboolean darea_motion_signal( GtkWidget *widget,
139  GdkEventMotion *event,
140  gpointer object );
141  static gboolean darea_enter_signal( GtkWidget *widget,
142  GdkEventCrossing *event,
143  gpointer object );
144  static gboolean darea_leave_signal( GtkWidget *widget,
145  GdkEventCrossing *event,
146  gpointer object );
147 
148 public:
149 
152  GTKGeom3DWindow( GTKPlotter &plotter,
153  const Geometry &geom,
154  const ParticleDataBase *pdb,
155  const std::vector<double> *sdata );
156 
159  virtual ~GTKGeom3DWindow();
160 };
161 
162 
163 #endif
Interactive geometry 3D plotter window.
Definition: gtkgeom3dwindow.hpp:56
virtual ~GTKGeom3DWindow()
Destructor.
Definition: gtkgeom3dwindow.cpp:301
GTKGeom3DWindow(GTKPlotter &plotter, const Geometry &geom, const ParticleDataBase *pdb, const std::vector< double > *sdata)
Constructor.
Definition: gtkgeom3dwindow.cpp:66
GTK Plotter class.
Definition: gtkplotter.hpp:66
Base class for interactive plotters.
Definition: gtkwindow.hpp:49
Geometry 3D plotter.
Definition: geom3dplot.hpp:60
Geometry defining class.
Definition: geometry.hpp:180
Particle database base class.
Definition: particledatabase.hpp:191
3D renderer base class.
Definition: renderer.hpp:56
Geometry 3d plotter
GTK based plotters.
Window for GTK plots.


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