Ocular Engine
Ocular::Core::Buildable Class Reference

#include <Buildable.hpp>

Inheritance diagram for Ocular::Core::Buildable:
Ocular::Core::ObjectIO Ocular::Core::Object Ocular::Graphics::Material Ocular::Math::Transform Ocular::Core::AEvent Ocular::Core::ARenderable Ocular::Core::ARoutine Ocular::Core::AWindow Ocular::Core::SceneObject Ocular::Graphics::D3D11Material Ocular::Graphics::MaterialEmpty Ocular::Graphics::MaterialMissing

Public Member Functions

virtual void onLoad (BuilderNode const *node)
virtual void onSave (BuilderNode *node) const

Detailed Description

When inheriting from Buildable, a class is allowing for itself to be loaded from, and saved to, various file formats. All loading/saving is done via a generic node chain system implemented through the BuilderNode class.

Buildables, and their node chains, are typically used when loading/saving:

- Scene files (.oscene)
- SceneObject files (.opref)
- Material files (.omat)

A class that inherits from Buildable may also see special automatic behaviour when also inheriting from the Exposable class. This typically includes automatic building from, and saving to, BuilderNode chains.

Member Function Documentation

void Ocular::Core::Buildable::onLoad ( BuilderNode const *  node)

Alternate creation method (opposed to the constructor) in which one is provided with a BuilderNode chain. This chain may be explored to retrieve any relevant variables, and their values, that may have been stored in it.

This method will typically mirror the onSave, in which relevant values are stored within the chain.

[in]nodeNode to extract variable information from

Reimplemented in Ocular::Core::SceneObject, Ocular::Math::Transform, Ocular::Core::MeshRenderable, Ocular::Graphics::Material, Ocular::Graphics::MaterialEmpty, Ocular::Graphics::MaterialMissing, Ocular::Core::LightSource, and Ocular::Core::ObjectIO.

void Ocular::Core::Buildable::onSave ( BuilderNode node) const

Method used to add an object's data to an existing node chain in preparation for being save to a file.

[in]nodeNode to place variable information in

Reimplemented in Ocular::Core::SceneObject, Ocular::Core::MeshRenderable, Ocular::Graphics::Material, Ocular::Graphics::MaterialEmpty, Ocular::Graphics::MaterialMissing, and Ocular::Core::ObjectIO.

The documentation for this class was generated from the following files: