Graphite  Version 3
An experimental 3D geometry processing program
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 
50 namespace 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  return grob_;
116  }
117 
118  private:
119  Grob* grob_;
120  };
121 
122  typedef SmartPointer<Interface> Interface_var;
123 
124  /****************************************************/
125 
154  gom_attribute(abstract, "true")
155  gom_class SCENE_GRAPH_API Commands : public Interface {
156  public:
161 
165  ~Commands() override;
166 
167 
174  const std::string& method_name,
175  const ArgList& args, Any& ret_val
176  ) override;
177 
183 
184  gom_properties:
185 
191  bool get_chrono() const {
192  return chrono_;
193  }
194 
200  void set_chrono(bool value) {
201  chrono_ = value;
202  }
203 
204  public:
205 
211  static bool command_is_running() {
212  return command_is_running_;
213  }
214 
215  private:
216  bool chrono_;
217  static bool command_is_running_;
218  };
219 
220  typedef SmartPointer<Commands> Commands_var;
221 }
222 
223 #endif
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:155
static bool command_is_running()
Tests whether a command is currently running.
Definition: commands.h:211
void set_chrono(bool value)
Sets whether timings are reported.
Definition: commands.h:200
~Commands() override
Commands destructor.
Interpreter * interpreter()
Gets the main Interpreter.
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.
Grob * get_grob() const
Gets the current Grob.
Definition: commands.h:114
~Interface() override
Interface destructor.
Abstract base class for the GOM interpreter.
Definition: interpreter.h:222
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.