38 #ifndef H_OGF_SCENE_GRAPH_TYPES_SCENE_GRAPH_LIBRARY_H
39 #define H_OGF_SCENE_GRAPH_TYPES_SCENE_GRAPH_LIBRARY_H
56 class SceneGraphShaderManager;
57 class SceneGraphToolsManager;
123 return scene_graph_tools_manager_;
135 const std::string& grob_class_name,
bool abstract=
false
148 const std::string& grob_class_name,
const std::string&
extension
161 const std::string& grob_class_name,
const std::string&
extension
176 const std::string& grob_class_name,
177 const std::string& shader_class_name,
178 const std::string& shader_user_name=
""
191 const std::string& grob_class_name,
192 const std::string& tool_class_name
206 const std::string& grob_class_name,
207 const std::string& interface_class_name
220 const std::string& grob_class_name,
221 const std::string& commands_class_name
234 const std::string& full_screen_effect_class_name,
235 const std::string& user_name=
""
262 const std::string& name, std::string& value
269 const std::string& name,
const std::string& value
281 const std::string& grob_class_name
293 const std::string& grob_class_name
306 const std::string& grob_class_name,
307 const std::string& shader_user_name
320 const std::string& grob_class_name,
321 const std::string& shader_class_name
333 const std::string& full_screen_effect_user_name
344 const std::string& full_screen_effect_classname
349 friend class SceneGraphCommandsManager;
366 ogf_assert(scene_graph_ ==
nullptr);
367 scene_graph_ = scene_graph;
379 ogf_assert(scene_graph_shader_manager_ ==
nullptr);
380 scene_graph_shader_manager_ = scene_graph_shader_manager;
392 ogf_assert(scene_graph_tools_manager_ ==
nullptr);
393 scene_graph_tools_manager_ = scene_graph_tools_manager;
398 GrobInfo(
bool abstract_in=
false) : abstract(abstract_in) {
400 std::vector<std::string> read_file_extensions;
401 std::vector<std::string> write_file_extensions;
402 std::vector<std::string> shaders;
403 std::vector<std::string> shaders_user_names;
404 std::vector<std::string> tools;
405 std::vector<std::string> commands;
406 std::vector<std::string> interfaces;
408 std::string read_file_extensions_string()
const;
409 std::string write_file_extensions_string()
const;
410 std::string shaders_user_names_string()
const;
411 std::string tools_string()
const;
412 std::string commands_string()
const;
413 std::string interfaces_string()
const;
414 bool has_read_extension(
const std::string& ext)
const;
416 std::map<std::string, GrobInfo> grob_infos_;
417 std::vector<std::string> full_screen_effects_;
418 std::vector<std::string> full_screen_effects_user_names_;
419 SceneGraph* scene_graph_;
420 SceneGraphShaderManager* scene_graph_shader_manager_;
421 SceneGraphToolsManager* scene_graph_tools_manager_;
422 static SceneGraphLibrary* instance_;
Provides functions to dynamically declare new Grob classes, commands, shaders and tools.
SceneGraphToolsManager * scene_graph_tools_manager()
Gets the SceneGraphToolsManager.
void scene_graph_values_changed_notify_environment()
Notifies all listeners of scene graph environment variables.
static void initialize()
Initializes the SceneGraphLibrary instance.
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.
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.
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.
static SceneGraphLibrary * instance()
Gets the instance.
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.
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_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.
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.
static void terminate()
Terminates the SceneGraphLibrary instance.
void set_scene_graph_tools_manager(SceneGraphToolsManager *scene_graph_tools_manager)
Sets the SceneGraphToolsManager.
void set_scene_graph(SceneGraph *scene_graph)
Sets the SceneGraph.
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.
SceneGraphLibrary()
SceneGraphLibrary constructor.
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.
~SceneGraphLibrary() override
SceneGraphLibrary destructor.
const SceneGraph * scene_graph() const
Gets the SceneGraph.
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.
void set_scene_graph_shader_manager(SceneGraphShaderManager *scene_graph_shader_manager)
Sets the SceneGraphShaderManager.
bool set_local_value(const std::string &name, const std::string &value) override
Sets a variable value locally.
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.
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.
SceneGraph * scene_graph()
Gets the SceneGraph.
Manages the shaders and full screen effects for the entire SceneGraph.
Represents the list of objects loaded in Graphite.
Helper class to register a new abstract Grob class.
ogf_register_abstract_grob_type()
Registers a new Grob class.
Helper class to register a new FullScreenEffect.
ogf_register_full_screen_effect(const std::string &user_name="")
Registers a new FullScreenEffect.
Helper class to register a new Commands associated with a Grob.
ogf_register_grob_commands()
Registers a new Commands associated with a Grob.
Helper class to register a new Commands associated with a Grob.
ogf_register_grob_interface()
Registers a new Interface associated with a Grob.
Helper class to register a new file extension for reading.
ogf_register_grob_read_file_extension(const std::string &extension)
Registers a new file extension for reading.
Helper class to register a new Shader associated with a Grob.
ogf_register_grob_shader(const std::string &shader_user_name="")
Registers a new Shader associated with a Grob.
Helper class to register a new Grob class.
ogf_register_grob_type()
Registers a new Grob class.
Helper class to register a new file extension for writing.
ogf_register_grob_write_file_extension(const std::string &extension)
Registers a new file extension for writing.
Provides a mechanism to store global variables, retrieve them by their names and attach observers to ...
std::string extension(const std::string &path)
Gets a path extension.
Global Graphite namespace.
Definitions common to all include files in the scene_graph library.