OpenStructure
build-dev-doc
stage
include
ost
gui
tools
tool.hh
Go to the documentation of this file.
1
//------------------------------------------------------------------------------
2
// This file is part of the OpenStructure project <www.openstructure.org>
3
//
4
// Copyright (C) 2008-2020 by the OpenStructure authors
5
//
6
// This library is free software; you can redistribute it and/or modify it under
7
// the terms of the GNU Lesser General Public License as published by the Free
8
// Software Foundation; either version 3.0 of the License, or (at your option)
9
// any later version.
10
// This library is distributed in the hope that it will be useful, but WITHOUT
11
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13
// details.
14
//
15
// You should have received a copy of the GNU Lesser General Public License
16
// along with this library; if not, write to the Free Software Foundation, Inc.,
17
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
//------------------------------------------------------------------------------
19
#ifndef OST_GUI_TOOL_HH
20
#define OST_GUI_TOOL_HH
21
22
/*
23
Author: Marco Biasini
24
*/
25
#include <vector>
26
27
28
#include <
ost/gui/module_config.hh
>
29
#include <
ost/gfx/gfx_node.hh
>
30
#include <
ost/gui/tools/mouse_event.hh
>
31
#include <
ost/gui/tools/tool_options.hh
>
32
33
#include <QIcon>
34
35
namespace
ost
{
namespace
gui {
36
37
class
ToolOptions;
38
class
Tool;
39
class
GLCanvas;
40
62
class
DLLEXPORT_OST_GUI
Tool
:
public
QObject {
63
Q_OBJECT
64
protected
:
65
Tool
(
const
String
& name);
66
public
:
67
virtual
~Tool
();
69
virtual
void
Click
(
const
MouseEvent
& event) { }
70
72
virtual
void
DoubleClick
(
const
MouseEvent
& event) { }
73
74
virtual
void
MousePress
(
const
MouseEvent
& event) { }
75
76
virtual
void
MouseMove
(
const
MouseEvent
& event) { }
77
78
virtual
void
RenderGL
() { }
79
80
82
virtual
void
Activate
() { }
83
85
virtual
void
Deactivate
() { }
86
88
virtual
bool
CanOperateOn
(
gfx::NodePtrList
nodes)=0;
89
ToolOptions
*
GetToolOptions
()
const
;
90
91
const
String
&
GetName
()
const
;
92
93
virtual
QIcon
GetIcon
()
const
;
94
95
private
:
96
String
name_;
97
ToolOptions
* tool_options_;
98
};
99
100
105
106
}}
107
108
#endif
ost::gui::MouseEvent
Definition:
mouse_event.hh:32
ost::gui::Tool
base class for tools
Definition:
tool.hh:62
ost::gui::Tool::DoubleClick
virtual void DoubleClick(const MouseEvent &event)
Real click.
Definition:
tool.hh:72
ost::gui::Tool::MousePress
virtual void MousePress(const MouseEvent &event)
Definition:
tool.hh:74
ost::gui::Tool::~Tool
virtual ~Tool()
ost::gui::Tool::Activate
virtual void Activate()
called when the tool becomes active
Definition:
tool.hh:82
ost::gui::Tool::CanOperateOn
virtual bool CanOperateOn(gfx::NodePtrList nodes)=0
whether the tool is capable of manipulating the given node
ost::gui::Tool::RenderGL
virtual void RenderGL()
Definition:
tool.hh:78
ost::gui::Tool::Tool
Tool(const String &name)
ost::gui::Tool::Deactivate
virtual void Deactivate()
called when the tool becomes inactive
Definition:
tool.hh:85
ost::gui::Tool::MouseMove
virtual void MouseMove(const MouseEvent &event)
Definition:
tool.hh:76
ost::gui::Tool::GetToolOptions
ToolOptions * GetToolOptions() const
ost::gui::Tool::Click
virtual void Click(const MouseEvent &event)
left mouse click
Definition:
tool.hh:69
ost::gui::Tool::GetIcon
virtual QIcon GetIcon() const
ost::gui::Tool::GetName
const String & GetName() const
ost::gui::ToolOptions
tool options
Definition:
tool_options.hh:40
gfx_node.hh
module_config.hh
DLLEXPORT_OST_GUI
#define DLLEXPORT_OST_GUI
Definition:
module_config.hh:33
String
std::string String
Definition:
base.hh:54
mouse_event.hh
ost::gfx::NodePtrList
std::vector< GfxNodeP > NodePtrList
Definition:
gfx_node_fw.hh:34
ost
Definition:
base.dox:1
tool_options.hh
Generated by
1.9.1