|
Graphite Version 3
An experimental 3D geometry processing program
|
Provides functions to dynamically declare new Grob classes, commands, shaders and tools. More...
#include <OGF/scene_graph/types/scene_graph_library.h>
Public Member Functions | |
| SceneGraphLibrary () | |
| SceneGraphLibrary constructor. | |
| ~SceneGraphLibrary () override | |
| SceneGraphLibrary destructor. | |
| SceneGraph * | scene_graph () |
| Gets the SceneGraph. | |
| const SceneGraph * | scene_graph () const |
| Gets the SceneGraph. | |
| SceneGraphToolsManager * | scene_graph_tools_manager () |
| Gets the SceneGraphToolsManager. | |
| void | register_grob_type (const std::string &grob_class_name, bool abstract=false) |
| Registers a new Grob type. | |
| void | register_grob_read_file_extension (const std::string &grob_class_name, const std::string &extension) |
| Registers a new file extension associated with a Grob type for reading. | |
| void | register_grob_write_file_extension (const std::string &grob_class_name, const std::string &extension) |
| Registers a new file extension associated with a Grob type for writing. | |
| void | register_grob_shader (const std::string &grob_class_name, const std::string &shader_class_name, const std::string &shader_user_name="") |
| Registers a new Shader class associated with a Grob class. | |
| void | register_grob_tool (const std::string &grob_class_name, const std::string &tool_class_name) |
| Registers a new Tool class associated with a Grob class. | |
| void | register_grob_interface (const std::string &grob_class_name, const std::string &interface_class_name) |
| Registers a new Interface class associated with a Grob class. | |
| void | register_grob_commands (const std::string &grob_class_name, const std::string &commands_class_name) |
| Registers a new Commands class associated with a Grob class. | |
| void | register_full_screen_effect (const std::string &full_screen_effect_class_name, const std::string &user_name="") |
| Registers a new full screen effect. | |
| std::string | file_extension_to_grob (const std::string &extension) const |
| Finds the object class names associated with a file extension for reading. | |
| bool | get_local_value (const std::string &name, std::string &value) const override |
| Retrieves a variable value locally. | |
| bool | set_local_value (const std::string &name, const std::string &value) override |
| Sets a variable value locally. | |
| std::string | default_grob_read_extension (const std::string &grob_class_name) const |
| Gets the default file extension associated with a Grob class for reading. | |
| std::string | default_grob_write_extension (const std::string &grob_class_name) const |
| Gets the default file extension associated with a Grob class for writing. | |
| const std::string & | shader_user_to_classname (const std::string &grob_class_name, const std::string &shader_user_name) const |
| Converts a shader user name to the associated internal class name. | |
| const std::string & | shader_classname_to_user (const std::string &grob_class_name, const std::string &shader_class_name) const |
| Converts a shader class name to the associated user shader name. | |
| std::string | full_screen_effect_user_to_classname (const std::string &full_screen_effect_user_name) const |
| Converts a full screen effect user name to the associated internal full screen effect class name. | |
| const std::string & | full_screen_effect_classname_to_user (const std::string &full_screen_effect_classname) const |
| Converts a full screen effect class name to the associated user name. | |
Public Member Functions inherited from GEO::Environment | |
| virtual bool | add_environment (Environment *env) |
| Adds a child environment. | |
| bool | has_value (const std::string &name) const |
| Tests if a variable exists. | |
| virtual bool | get_value (const std::string &name, std::string &value) const |
| Retrieves the value of a variable. | |
| std::string | get_value (const std::string &name) const |
| Retrieves the value of a variable. | |
| virtual bool | set_value (const std::string &name, const std::string &value) |
| Sets a variable value. | |
| virtual Environment * | find_environment (const std::string &name) |
| Finds the environment that declares a variable as a local name. | |
| virtual bool | add_observer (const std::string &name, VariableObserver *observer) |
| Attaches an observer to a variable. | |
| virtual bool | remove_observer (const std::string &name, VariableObserver *observer) |
| Detaches an observer from a variable. | |
| virtual bool | notify_observers (const std::string &name, bool recursive=false) |
| Notifies observers. | |
Public Member Functions inherited from GEO::Counted | |
| void | ref () const |
| Increments the reference count. | |
| void | unref () const |
| Decrements the reference count. | |
| bool | is_shared () const |
| Check if the object is shared. | |
| int | nb_refs () const |
| Gets the number of references that point to this object. | |
Static Public Member Functions | |
| static SceneGraphLibrary * | instance () |
| Gets the instance. | |
| static void | initialize () |
| Initializes the SceneGraphLibrary instance. | |
| static void | terminate () |
| Terminates the SceneGraphLibrary instance. | |
Static Public Member Functions inherited from GEO::Environment | |
| static Environment * | instance () |
| Gets the root environment. | |
| static void | terminate () |
| Cleans up the environment. | |
Static Public Member Functions inherited from GEO::Counted | |
| static void | ref (const Counted *counted) |
| Increments the reference count. | |
| static void | unref (const Counted *counted) |
| Decrements the reference count. | |
Protected Member Functions | |
| void | scene_graph_values_changed_notify_environment () |
| Notifies all listeners of scene graph environment variables. | |
| void | set_scene_graph (SceneGraph *scene_graph, bool transfer_ownership=false) |
| Sets the SceneGraph. | |
| void | set_scene_graph_shader_manager (SceneGraphShaderManager *scene_graph_shader_manager) |
| Sets the SceneGraphShaderManager. | |
| void | set_scene_graph_tools_manager (SceneGraphToolsManager *scene_graph_tools_manager) |
| Sets the SceneGraphToolsManager. | |
Protected Member Functions inherited from GEO::Environment | |
| ~Environment () override | |
| Environment destructor. | |
| bool | notify_observers (const std::string &name, const std::string &value, bool recursive) |
| Notifies observers. | |
| bool | notify_local_observers (const std::string &name, const std::string &value) |
| Notifies local observers. | |
Protected Member Functions inherited from GEO::Counted | |
| Counted () | |
| Creates a reference counted object. | |
| virtual | ~Counted () |
| Destroys a reference counted object. | |
Friends | |
| class | SceneGraph |
| class | SceneGraphCommandsManager |
| class | SceneGraphShaderManager |
| class | SceneGraphToolsManager |
Provides functions to dynamically declare new Grob classes, commands, shaders and tools.
Definition at line 68 of file scene_graph_library.h.
| std::string OGF::SceneGraphLibrary::default_grob_read_extension | ( | const std::string & | grob_class_name | ) | const |
| std::string OGF::SceneGraphLibrary::default_grob_write_extension | ( | const std::string & | grob_class_name | ) | const |
| std::string OGF::SceneGraphLibrary::file_extension_to_grob | ( | const std::string & | extension | ) | const |
Finds the object class names associated with a file extension for reading.
| [in] | extension | the extension, without the "." |
| const std::string & OGF::SceneGraphLibrary::full_screen_effect_classname_to_user | ( | const std::string & | full_screen_effect_classname | ) | const |
Converts a full screen effect class name to the associated user name.
| [in] | full_screen_effect_classname | the class name of the full screen effect as a string, with the "OGF::" prefix |
| std::string OGF::SceneGraphLibrary::full_screen_effect_user_to_classname | ( | const std::string & | full_screen_effect_user_name | ) | const |
Converts a full screen effect user name to the associated internal full screen effect class name.
| [in] | full_screen_effect_user_name | the user name of the full screen effect |
|
overridevirtual |
Retrieves a variable value locally.
This function is used internally. It searches variable name locally and stores its value in the output string value.
| [in] | name | the name of the variable |
| [out] | value | is set the variable value if it was found locally. |
| true | if the variable was found |
| false | if not |
Provides the following environment variables:
Implements GEO::Environment.
|
static |
Initializes the SceneGraphLibrary instance.
This function is called at Graphite startup. Client code should not call it.
|
static |
Gets the instance.
| void OGF::SceneGraphLibrary::register_full_screen_effect | ( | const std::string & | full_screen_effect_class_name, |
| const std::string & | user_name = "" |
||
| ) |
Registers a new full screen effect.
| [in] | full_screen_effect_class_name | the class name of the full screen effect, with the "OGF::" prefix |
| [in] | user_name | an optional user name for the full screen effect that will be used in the GUI |
| void OGF::SceneGraphLibrary::register_grob_commands | ( | const std::string & | grob_class_name, |
| const std::string & | commands_class_name | ||
| ) |
Registers a new Commands class associated with a Grob class.
| [in] | grob_class_name | the object class name as a string, with the "OGF::" prefix |
| [in] | commands_class_name | the tool class name as a string, with the "OGF::" prefix |
| void OGF::SceneGraphLibrary::register_grob_interface | ( | const std::string & | grob_class_name, |
| const std::string & | interface_class_name | ||
| ) |
Registers a new Interface class associated with a Grob class.
| [in] | grob_class_name | the object class name as a string, with the "OGF::" prefix |
| [in] | interface_class_name | the tool class name as a string, with the "OGF::" prefix |
| void OGF::SceneGraphLibrary::register_grob_read_file_extension | ( | const std::string & | grob_class_name, |
| const std::string & | extension | ||
| ) |
Registers a new file extension associated with a Grob type for reading.
| [in] | grob_class_name | the object class name as a string, with the "OGF::" prefix |
| [in] | extension | the extension, without the "." |
| void OGF::SceneGraphLibrary::register_grob_shader | ( | const std::string & | grob_class_name, |
| const std::string & | shader_class_name, | ||
| const std::string & | shader_user_name = "" |
||
| ) |
Registers a new Shader class associated with a Grob class.
| [in] | grob_class_name | the object class name as a string, with the "OGF::" prefix |
| [in] | shader_class_name | the shader class name as a string, with the "OGF::" prefix |
| [in] | shader_user_name | an optional user name for the shader, that will be used in the GUI |
| void OGF::SceneGraphLibrary::register_grob_tool | ( | const std::string & | grob_class_name, |
| const std::string & | tool_class_name | ||
| ) |
Registers a new Tool class associated with a Grob class.
| [in] | grob_class_name | the object class name as a string, with the "OGF::" prefix |
| [in] | tool_class_name | the tool class name as a string, with the "OGF::" prefix |
| void OGF::SceneGraphLibrary::register_grob_type | ( | const std::string & | grob_class_name, |
| bool | abstract = false |
||
| ) |
Registers a new Grob type.
| [in] | grob_class_name | the object class name as a string, with the "OGF::" prefix |
| [in] | abstract | true if the object class name is abstract |
| void OGF::SceneGraphLibrary::register_grob_write_file_extension | ( | const std::string & | grob_class_name, |
| const std::string & | extension | ||
| ) |
Registers a new file extension associated with a Grob type for writing.
| [in] | grob_class_name | the object class name as a string, with the "OGF::" prefix |
| [in] | extension | the extension, without the "." |
|
inline |
Gets the SceneGraph.
Definition at line 106 of file scene_graph_library.h.
|
inline |
Gets the SceneGraph.
Definition at line 114 of file scene_graph_library.h.
|
inline |
Gets the SceneGraphToolsManager.
Definition at line 122 of file scene_graph_library.h.
|
overridevirtual |
Sets a variable value locally.
This function is used internally. It sets the variable named name to the given value locally.
| [in] | name | the name of the variable |
| [in] | value | the value of the variable |
| true | if the variable was successfully added locally |
| false | otherwise |
Implements GEO::Environment.
|
protected |
Sets the SceneGraph.
| [in] | scene_graph | a pointer to the SceneGraph |
| [in] | transfer_ownership | if set, then the SceneGraphLibrary takes the ownership of the SceneGraph (used when SceneGraph is created by Grob constructor). |
|
inlineprotected |
Sets the SceneGraphShaderManager.
| [in] | scene_graph_shader_manager | a pointer to the SceneGraphShaderManager |
Definition at line 378 of file scene_graph_library.h.
|
inlineprotected |
Sets the SceneGraphToolsManager.
| [in] | scene_graph_tools_manager | a pointer to the SceneGraphToolsManager |
Definition at line 391 of file scene_graph_library.h.
| const std::string & OGF::SceneGraphLibrary::shader_classname_to_user | ( | const std::string & | grob_class_name, |
| const std::string & | shader_class_name | ||
| ) | const |
| const std::string & OGF::SceneGraphLibrary::shader_user_to_classname | ( | const std::string & | grob_class_name, |
| const std::string & | shader_user_name | ||
| ) | const |
Converts a shader user name to the associated internal class name.
| [in] | grob_class_name | the Grob class name the shader is associated with, as a string with the "OGF::" prefix |
| [in] | shader_user_name | the shader user name |
|
static |
Terminates the SceneGraphLibrary instance.
This function is called at Graphite shutdown. Client code should not call it.
|
friend |
Definition at line 348 of file scene_graph_library.h.
|
friend |
Definition at line 349 of file scene_graph_library.h.
|
friend |
Definition at line 350 of file scene_graph_library.h.
|
friend |
Definition at line 351 of file scene_graph_library.h.