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. More... | |
const SceneGraph * | scene_graph () const |
Gets the SceneGraph. More... | |
SceneGraphToolsManager * | scene_graph_tools_manager () |
Gets the SceneGraphToolsManager. More... | |
void | register_grob_type (const std::string &grob_class_name, bool abstract=false) |
Registers a new Grob type. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
void | register_full_screen_effect (const std::string &full_screen_effect_class_name, const std::string &user_name="") |
Registers a new full screen effect. More... | |
std::string | file_extension_to_grob (const std::string &extension) const |
Finds the object class names associated with a file extension for reading. More... | |
bool | get_local_value (const std::string &name, std::string &value) const override |
Retrieves a variable value locally. More... | |
bool | set_local_value (const std::string &name, const std::string &value) override |
Sets a variable value locally. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
Public Member Functions inherited from GEO::Environment | |
virtual bool | add_environment (Environment *env) |
Adds a child environment. More... | |
bool | has_value (const std::string &name) const |
Tests if a variable exists. More... | |
virtual bool | get_value (const std::string &name, std::string &value) const |
Retrieves the value of a variable. More... | |
std::string | get_value (const std::string &name) const |
Retrieves the value of a variable. More... | |
virtual bool | set_value (const std::string &name, const std::string &value) |
Sets a variable value. More... | |
virtual Environment * | find_environment (const std::string &name) |
Finds the environment that declares a variable as a local name. More... | |
virtual bool | add_observer (const std::string &name, VariableObserver *observer) |
Attaches an observer to a variable. More... | |
virtual bool | remove_observer (const std::string &name, VariableObserver *observer) |
Detaches an observer from a variable. More... | |
virtual bool | notify_observers (const std::string &name, bool recursive=false) |
Notifies observers. More... | |
Public Member Functions inherited from GEO::Counted | |
void | ref () const |
Increments the reference count. More... | |
void | unref () const |
Decrements the reference count. More... | |
bool | is_shared () const |
Check if the object is shared. More... | |
int | nb_refs () const |
Gets the number of references that point to this object. More... | |
Static Public Member Functions | |
static SceneGraphLibrary * | instance () |
Gets the instance. More... | |
static void | initialize () |
Initializes the SceneGraphLibrary instance. More... | |
static void | terminate () |
Terminates the SceneGraphLibrary instance. More... | |
Static Public Member Functions inherited from GEO::Environment | |
static Environment * | instance () |
Gets the root environment. More... | |
static void | terminate () |
Cleans up the environment. More... | |
Static Public Member Functions inherited from GEO::Counted | |
static void | ref (const Counted *counted) |
Increments the reference count. More... | |
static void | unref (const Counted *counted) |
Decrements the reference count. More... | |
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) |
Sets the SceneGraph. More... | |
void | set_scene_graph_shader_manager (SceneGraphShaderManager *scene_graph_shader_manager) |
Sets the SceneGraphShaderManager. More... | |
void | set_scene_graph_tools_manager (SceneGraphToolsManager *scene_graph_tools_manager) |
Sets the SceneGraphToolsManager. More... | |
Protected Member Functions inherited from GEO::Environment | |
~Environment () override | |
Environment destructor. More... | |
bool | notify_observers (const std::string &name, const std::string &value, bool recursive) |
Notifies observers. More... | |
bool | notify_local_observers (const std::string &name, const std::string &value) |
Notifies local observers. More... | |
Protected Member Functions inherited from GEO::Counted | |
Counted () | |
Creates a reference counted object. More... | |
virtual | ~Counted () |
Destroys a reference counted object. More... | |
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.
|
inlineprotected |
Sets the SceneGraph.
[in] | scene_graph | a pointer to the SceneGraph |
Definition at line 365 of file scene_graph_library.h.
|
inlineprotected |
Sets the SceneGraphShaderManager.
[in] | scene_graph_shader_manager | a pointer to the SceneGraphShaderManager |
Definition at line 376 of file scene_graph_library.h.
|
inlineprotected |
Sets the SceneGraphToolsManager.
[in] | scene_graph_tools_manager | a pointer to the SceneGraphToolsManager |
Definition at line 389 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.