20,741
edits
Line 1,645: | Line 1,645: | ||
Obviously, users can use the canvas system for developing all sorts of features that may need to be accessible using different interfaces - for these reasons, the canvas uses the concept of so called '''placements''', so that a canvas-texture can be shown inside GUI windows, GUI dialogs, cockpits, aircraft textures (liveries) - and also as part of the scenery (e.g. for a VGDS). | Obviously, users can use the canvas system for developing all sorts of features that may need to be accessible using different interfaces - for these reasons, the canvas uses the concept of so called '''placements''', so that a canvas-texture can be shown inside GUI windows, GUI dialogs, cockpits, aircraft textures (liveries) - and also as part of the scenery (e.g. for a VGDS). | ||
in simgear Canvas::update it appears to be using the factories to find the element; and this means that it can't find the named OSG node, which makes me think that maybe it is only looking in the ownship (which is a null model). | |||
<syntaxhighlight lang="cpp"> | |||
PlacementFactoryMap::const_iterator placement_factory = _placement_factories.find( node->getStringValue("type", "object") ); if( placement_factory != _placement_factories.end() ) { Placements& placements = _placements[ node->getIndex() ] = placement_factory->second(node, this); node->setStringValue ( "status-msg", placements.empty() ? "No match" : "Ok" ); } | |||
</syntaxhighlight> | |||
void CanvasMgr::init() calls sc::Canvas::addPlacementFactory. <ref>{{cite web | |||
|url = https://sourceforge.net/p/flightgear/mailman/message/35089070/ | |||
|title = <nowiki> [Flightgear-devel] Canvas in dynamically loaded scene models </nowiki> | |||
|author = <nowiki> Richard Harrison </nowiki> | |||
|date = May 15th, 2016 | |||
|added = May 15th, 2016 | |||
|script_version = 0.40 | |||
}}</ref> | |||
<!-- | <!-- |