| 1 | // SPDX-FileCopyrightText: 2000 David Megginson |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | |
| 4 | #pragma once |
| 5 | |
| 6 | #include "FGCroppedTexture.hxx" |
| 7 | #include "FGInstrumentLayer.hxx" |
| 8 | #include "FGPanelInstrument.hxx" |
| 9 | |
| 10 | |
| 11 | /** |
| 12 | * An instrument constructed of multiple layers. |
| 13 | * |
| 14 | * Each individual layer can be rotated or shifted to correspond |
| 15 | * to internal FGFS instrument readings. |
| 16 | */ |
| 17 | class FGLayeredInstrument : public FGPanelInstrument { |
| 18 | public: |
| 19 | FGLayeredInstrument (const int x, const int y, const int w, const int h); |
| 20 | virtual ~FGLayeredInstrument (); |
| 21 | |
| 22 | virtual void draw (); |
| 23 | |
| 24 | // Transfer pointer ownership!! |
| 25 | virtual int addLayer (FGInstrumentLayer * const layer); |
| 26 | virtual int addLayer (const FGCroppedTexture_ptr texture, const int w = -1, const int h = -1); |
| 27 | |
| 28 | // Transfer pointer ownership!! |
| 29 | virtual void addTransformation (FGPanelTransformation * const transformation); |
| 30 | |
| 31 | private: |
| 32 | typedef std::vector <FGInstrumentLayer *> layer_list; |
| 33 | layer_list m_layers; |
| 34 | }; |