begin replacing the stubs with your own C++ code.edit $SG_SRC/canvas/elements/CanvasGroup.cxx to register your new element (header and staticInit).add them to $SG_SRC/canvas/elements/CMakeLists.txt (as per Developing using CMake).Create a new set of files NasalElement.cxx/.hxx (as per Adding a new Canvas element).check out a new set of topic branches for each repo: git checkout -b topic/canvas-NasalElement.update/pull simgear,flightgear and fgdata.Set up a working build environment (including simgear): Building FlightGear.
To add a new element, these are the main steps: Canvas::Image) and implement the interface of the parent class by providing/overriding the correspond virtual methods. To create a new element, you need to create a new child class which inherits from Canvas::Element base class (or any of its child-classes, e.g. rendering scenery views to a texture, rendering 3D models to a texture or doing a complete moving map with terrain elevations/height maps (even though the latter could be implemented by sub-classing Canvas::Image to some degree).Īnother good example for implementing new elements is rendering file formats like PDF, 3d models or ESRI shape files. via existing elements and scripting space frameworks).įor example, this may involve projects requiring camera support, i.e. You will want to add a new Canvas::Element subclass whenever you want to add support for features which cannot be currently expressed easily (or efficiently) using existing means/canvas drawing primitives (i.e. Most of these ideas have seen quite some discussion over the years, with some being fairly popular among aircraft developers (especially the capability to render scenery views), so that it makes sense to grow a repository of related patches and code snippets to hopefully grow a repository of helpful information and pointers to implement these ideas one day. anything that involves rendering to a texture would be best handled by sub-classing Canvas::Image instead of Canvas::Element). In all of these examples, you will typically want to add a new Canvas element, with the main difference being the underlying base class (e.g. for viewing the manual and/or charts), but also for loading arbitrary 3D models from disk and visualize those using Canvas. support for rendering slaved camera views (tail cam, mirror textures), support for rendering PDF files to a Canvas (e.g. This template is used for creating the common boilerplate code required for adding new Canvas elements, such as those frequently discussed on the forum - e.g.