gramods
|
Base type for objects in the Gramods package for standardized handling of construction, initialization and destruction, and for setting up configuration based on configuration files, read using gmCore::Configuration. More...
#include <Object.hh>
Classes | |
struct | Visitor |
The visitor of a design pattern for automatic traversal. More... | |
Public Member Functions | |
Object () | |
Initializes internal data. More... | |
virtual | ~Object () |
Cleaning up internal data. More... | |
virtual void | initialize () |
Called to initialize the Object. More... | |
virtual void | accept (Visitor *visitor) |
Calls the visitors apply method with this as argument. More... | |
virtual void | traverse (Visitor *visitor) |
Calls the child Object's accept method, if such exist. More... | |
virtual std::string | getDefaultKey () |
Returns the default key for the Object when automatically instantiated in a Configuration, i.e. More... | |
bool | isInitialized () |
Returns true if the Object is initialized. More... | |
Base type for objects in the Gramods package for standardized handling of construction, initialization and destruction, and for setting up configuration based on configuration files, read using gmCore::Configuration.
The most typical usage is
If gmCore::Configuration is not used, then the classes may be manually instantiated and initialized. The basic initialization procedure should then be as follows:
All three steps are performed by the Configuration tool and an Object extracted therefrom will be ready to be used.
|
inline |
Initializes internal data.
|
inlinevirtual |
Cleaning up internal data.
|
inlinevirtual |
Calls the visitors apply method with this as argument.
Reimplemented in gramods::gmGraphics::Transform, and gramods::gmGraphics::TrackedTransform.
|
inlinevirtual |
Returns the default key for the Object when automatically instantiated in a Configuration, i.e.
where it ends up in a parent Object. Default is "object", but this should be overriden by sub classes and can also be overridden in XML by using the attribute KEY
, as in KEY="view"
.
The key can also be used to extract a specific object from a Configuration instance:
Reimplemented in gramods::gmTrack::SinglePoseTracker, gramods::gmTrack::MultiPoseTracker, gramods::gmTrack::Controller, gramods::gmTrack::ButtonsTracker, gramods::gmTrack::AnalogsTracker, gramods::gmSound::SoundDetector, gramods::gmSound::OpenALContext, gramods::gmSound::Capture, gramods::gmNetwork::SyncNode, gramods::gmGraphics::ViewTexture, gramods::gmGraphics::Viewpoint, gramods::gmGraphics::Texture, gramods::gmGraphics::Node, gramods::gmGraphics::MultiscopicMultiplexer, gramods::gmGraphics::Geometry, gramods::gmGraphics::CoordinatesMapper, gramods::gmCore::SdlContext, and gramods::gmCore::OpenVR.
|
inlinevirtual |
Called to initialize the Object.
This should be called once only!
Sub classes should override this method to make use of set parameter data. They should also always call its base class' implementation as well.
Reimplemented in gramods::gmTrack::VrpnServer, gramods::gmSound::OpenALContext, gramods::gmSound::OpenALCapture, gramods::gmSound::Multilateration, gramods::gmSound::CaptureFromWav, gramods::gmNetwork::SyncNode, gramods::gmGraphics::UvcTexture, gramods::gmGraphics::SdlWindow, gramods::gmGraphics::ObjRenderer, gramods::gmGraphics::ImageTexture, gramods::gmCore::SdlContext, gramods::gmCore::OpenVR, gramods::gmCore::MessageSink, and gramods::gmCore::ImportLibrary.
|
inline |
Returns true if the Object is initialized.
Sub classes must call Object::initialize() if and only if the initialization succeeded.
|
inlinevirtual |
Calls the child Object's accept method, if such exist.
Reimplemented in gramods::gmTrack::VrpnServer, gramods::gmTrack::SingleToMultiPoseTracker, gramods::gmTrack::SampleCollector, gramods::gmTrack::RelativeSinglePoseTracker, gramods::gmTrack::RegisteredSinglePoseTracker, gramods::gmTrack::RegisteredMultiPoseTracker, gramods::gmTrack::OpenVRPoseTracker, gramods::gmTrack::OpenVRButtonsTracker, gramods::gmTrack::OpenVRAnalogsTracker, gramods::gmTrack::OffsetSinglePoseTracker, gramods::gmTrack::MultiToSinglePoseTracker, gramods::gmTrack::Controller, gramods::gmTrack::ButtonsMapper, gramods::gmTrack::AnalogsMapper, gramods::gmSound::Multilateration, gramods::gmGraphics::YuvDecodeTexture, gramods::gmGraphics::Window, gramods::gmGraphics::ViewTexture, gramods::gmGraphics::ViewMixView, gramods::gmGraphics::ViewBase, gramods::gmGraphics::TransitionCoordinatesMapper, gramods::gmGraphics::TrackedViewpoint, gramods::gmGraphics::TiledView, gramods::gmGraphics::TextureWarpedView, gramods::gmGraphics::TextureRenderer, gramods::gmGraphics::TextureProjectedView, gramods::gmGraphics::SphereRenderer, gramods::gmGraphics::SpatialSphericalView, gramods::gmGraphics::SdlWindow, gramods::gmGraphics::SaveView, gramods::gmGraphics::RemapperView, gramods::gmGraphics::PosedSphericalView, gramods::gmGraphics::MultiscopicView, gramods::gmGraphics::MultiscopicTextureSplitter, gramods::gmGraphics::MultiscopicTextureMultiplexer, gramods::gmGraphics::HmdView, gramods::gmGraphics::Group, gramods::gmGraphics::GeometryCorrectedProjectorView, gramods::gmGraphics::ChromaKeyView, and gramods::gmGraphics::ChromaKeyTexture.