Graphite Version 3
An experimental 3D geometry processing program
Loading...
Searching...
No Matches
commands.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#ifndef H_OGF_SCENE_GRAPH_TYPES_COMMANDS_H
38#define H_OGF_SCENE_GRAPH_TYPES_COMMANDS_H
39
42#include <OGF/gom/types/node.h>
43
50namespace OGF {
51
52 class Grob;
53 class SceneGraph;
54
71 gom_attribute(abstract, "true")
72 gom_class SCENE_GRAPH_API Interface : public Object {
73 public:
78
82 ~Interface() override;
83
89 Grob* grob() const {
90 return grob_;
91 }
92
101
102 gom_properties:
103
108 virtual void set_grob(Grob* value);
109
114 Grob* get_grob() const;
115
116 private:
117 Grob* grob_;
118 };
119
121
122 /****************************************************/
123
152 gom_attribute(abstract, "true")
153 gom_class SCENE_GRAPH_API Commands : public Interface {
154 public:
159
163 ~Commands() override;
164
165
172 const std::string& method_name,
173 const ArgList& args, Any& ret_val
174 ) override;
175
181
182 gom_properties:
183
189 bool get_chrono() const {
190 return chrono_;
191 }
192
198 void set_chrono(bool value) {
199 chrono_ = value;
200 }
201
202 protected:
208
209 public:
210
216 static bool command_is_running() {
217 return command_is_running_;
218 }
219
220 private:
221 bool chrono_;
222 static bool command_is_running_;
223 };
224
225 typedef SmartPointer<Commands> Commands_var;
226}
227
228#endif
A smart pointer with reference-counted copy semantics.
A class that stores a variable of arbitrary type.
Definition any.h:62
Represents a list of name-value pairs.
Definition arg_list.h:65
Represents a set of commands.
Definition commands.h:153
void show_console()
Tentatively display the console. Ignored if running outside from Graphite.
static bool command_is_running()
Tests whether a command is currently running.
Definition commands.h:216
void set_chrono(bool value)
Sets whether timings are reported.
Definition commands.h:198
Interpreter * interpreter()
Gets the main Interpreter.
~Commands() override
Commands destructor.
Commands()
Commands constructor.
bool invoke_method(const std::string &method_name, const ArgList &args, Any &ret_val) override
Invokes a method by method name and argument list, and gets the return value.
Base class for all 3D Graphite objects.
Definition grob.h:68
Represents additional functions that can be attached to an object.
Definition commands.h:72
Grob * grob() const
Gets the Grob.
Definition commands.h:89
SceneGraph * scene_graph() const
Gets the SceneGraph.
Interface()
Interface constructor.
~Interface() override
Interface destructor.
Grob * get_grob() const
Gets the current Grob.
Abstract base class for the GOM interpreter.
Base class for all objects in the GOM system.
Definition object.h:65
Represents the list of objects loaded in Graphite.
Definition scene_graph.h:62
Global Graphite namespace.
Definition common.h:76
The base class for all composite objects in the GOM system.
Definitions common to all include files in the scene_graph library.