Graphite  Version 3
An experimental 3D geometry processing program
arc_ball.h
Go to the documentation of this file.
1 /*
2  * OGF/Graphite: Geometry and Graphics Programming Library + Utilities
3  * Copyright (C) 2000 Bruno Levy
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  *
19  * If you modify this software, you should include a notice giving the
20  * name of the person performing the modification, the date of modification,
21  * and the reason for such modification.
22  *
23  * Contact: Bruno Levy
24  *
25  * levy@loria.fr
26  *
27  * ISA Project
28  * LORIA, INRIA Lorraine,
29  * Campus Scientifique, BP 239
30  * 54506 VANDOEUVRE LES NANCY CEDEX
31  * FRANCE
32  *
33  * Note that the GNU General Public License does not permit incorporating
34  * the Software into proprietary programs.
35  */
36 
37 
38 #ifndef H_OGF_SCENE_GRAPH_GFX_TRANSFORMS_ARCBALL_H
39 #define H_OGF_SCENE_GRAPH_GFX_TRANSFORMS_ARCBALL_H
40 
41 #include <OGF/scene_graph_gfx/common/common.h>
42 #include <OGF/gom/types/object.h>
44 
50 namespace OGF {
51 
52  class RenderingContext;
53 
54 //_________________________________________________________
55 
67  gom_class SCENE_GRAPH_GFX_API ArcBall : public Object {
68  public:
73 
77  ~ArcBall() override;
78 
79  gom_properties:
80 
86  const mat4& get_value() const {
87  return impl_.get_value();
88  }
89 
95  void set_value(const mat4& value) {
96  impl_.set_value(value);
97  value_changed(value);
98  }
99 
105  bool get_x_constraint() const {
106  return impl_.get_x_constraint();
107  }
108 
114  void set_x_constraint(bool value) {
115  impl_.set_x_constraint(value);
116  }
117 
123  bool get_y_constraint() const {
124  return impl_.get_y_constraint();
125  }
126 
132  void set_y_constraint(bool value) {
133  impl_.set_y_constraint(value);
134  }
135 
141  bool get_grabbed() const {
142  return impl_.grabbed();
143  }
144 
145  gom_slots:
151  void grab(const vec2& value);
152 
158  void drag(const vec2& value);
159 
165  void release(const vec2& value);
166 
167  gom_signals:
173  void value_changed(const mat4& value);
174 
175  private:
176  GEO::ArcBall impl_;
177  };
178 
183 
184 /****************************************************************************/
185 
186 }
187 #endif
Enables to interactively define a rotation.
Definition: arc_ball.h:66
Enables to interactively define a rotation.
Definition: arc_ball.h:67
ArcBall()
ArcBall constructor.
~ArcBall() override
ArcBall destructor.
bool get_y_constraint() const
Tests whether the Y axis is constrained.
Definition: arc_ball.h:123
bool get_grabbed() const
Tests whether this ArcBall is grabbed.
Definition: arc_ball.h:141
bool get_x_constraint() const
Tests whether the X axis is constrained.
Definition: arc_ball.h:105
void set_value(const mat4 &value)
Sets the value of the rotation.
Definition: arc_ball.h:95
void set_x_constraint(bool value)
Specifies whether the X axis is constrained.
Definition: arc_ball.h:114
void release(const vec2 &value)
Callback called when the mouse button is released.
void drag(const vec2 &value)
Callback called when the mouse is moved.
void set_y_constraint(bool value)
Specifies whether the Y axis is constrained.
Definition: arc_ball.h:132
Base class for all objects in the GOM system.
Definition: object.h:65
Controls a 3d rotation from user mouse input.
Global Graphite namespace.
Definition: common.h:76
SmartPointer< ArcBall > ArcBall_var
An automatic reference-counted pointer to an ArcBall.
Definition: arc_ball.h:182
The base class for all objects in the GOM system.