FlightGear next
FGModelMgr Class Reference

Manage a list of user-specified models. More...

#include <modelmgr.hxx>

Inherits SGSubsystem.

Classes

struct  Instance
 A dynamically-placed model using properties. More...
 

Public Member Functions

 FGModelMgr ()
 
virtual ~FGModelMgr ()
 
void bind () override
 
void init () override
 
void shutdown () override
 
void unbind () override
 
void update (double dt) override
 
virtual void add_model (SGPropertyNode *node)
 
virtual void add_instance (Instance *instance)
 Add an instance of a dynamic model to the manager.
 
virtual void remove_instance (Instance *instance)
 Remove an instance of a dynamic model from the manager.
 
InstancefindInstanceByNodePath (const std::string &nodePath) const
 Finds an instance in the model manager from a given node path in the property tree.
 

Static Public Member Functions

static const char * staticSubsystemClassId ()
 

Detailed Description

Manage a list of user-specified models.

Definition at line 25 of file modelmgr.hxx.

Constructor & Destructor Documentation

◆ FGModelMgr()

FGModelMgr::FGModelMgr ( )

Definition at line 86 of file modelmgr.cxx.

◆ ~FGModelMgr()

FGModelMgr::~FGModelMgr ( )
virtual

Definition at line 90 of file modelmgr.cxx.

Member Function Documentation

◆ add_instance()

void FGModelMgr::add_instance ( Instance * instance)
virtual

Add an instance of a dynamic model to the manager.

NOTE: pointer ownership is transferred to the model manager!

The caller is responsible for setting up the Instance structure as required. The model manager will continuously update the location and orientation of the model based on the current values of the properties.

Definition at line 310 of file modelmgr.cxx.

◆ add_model()

void FGModelMgr::add_model ( SGPropertyNode * node)
virtual

Definition at line 121 of file modelmgr.cxx.

◆ bind()

void FGModelMgr::bind ( )
override

Definition at line 232 of file modelmgr.cxx.

◆ findInstanceByNodePath()

FGModelMgr::Instance * FGModelMgr::findInstanceByNodePath ( const std::string & nodePath) const

Finds an instance in the model manager from a given node path in the property tree.

A possible path could be "models/model[0]"

NOTE: the manager will delete the instance as well.

Definition at line 329 of file modelmgr.cxx.

◆ init()

void FGModelMgr::init ( )
override

Definition at line 95 of file modelmgr.cxx.

◆ remove_instance()

void FGModelMgr::remove_instance ( Instance * instance)
virtual

Remove an instance of a dynamic model from the manager.

NOTE: the manager will delete the instance as well.

Definition at line 316 of file modelmgr.cxx.

◆ shutdown()

void FGModelMgr::shutdown ( )
override

Definition at line 103 of file modelmgr.cxx.

◆ staticSubsystemClassId()

static const char * FGModelMgr::staticSubsystemClassId ( )
inlinestatic

Definition at line 70 of file modelmgr.hxx.

◆ unbind()

void FGModelMgr::unbind ( )
override

Definition at line 241 of file modelmgr.cxx.

◆ update()

void FGModelMgr::update ( double dt)
override

Definition at line 264 of file modelmgr.cxx.


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