FlightGear next
AirportBuilder.hxx
Go to the documentation of this file.
1/*
2 * SPDX-FileName: AirportBuilder.hxx
3 * SPDX-FileComment: Builder to create airports based on airport data for rendering in the scenery
4 * SPDX-FileCopyrightText: Copyright (C) 2020 Stuart Buchanan stuart13@gmail.com
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 */
7
8#pragma once
9
10#include <osgDB/Registry>
11#include <simgear/scene/material/Effect.hxx>
12#include <simgear/scene/material/EffectGeode.hxx>
13
14#include "airport.hxx"
15
16
17namespace flightgear {
18
19static const float RUNWAY_OFFSET = 3.0;
20
21class AirportBuilder : public osgDB::ReaderWriter
22{
23public:
24 // The different layers are offset to avoid z-buffering issues. As they
25 // are viewed from above only, this doesn't cause any problems visually.
26 const float MARKING_OFFSET = 2.0;
27 const float PAVEMENT_OFFSET = 1.0;
28 const float BOUNDARY_OFFSET = 0.0;
29
31 virtual ~AirportBuilder();
32
33 virtual const char* className() const;
34
35 virtual ReadResult readNode(const std::string& fileName,
36 const osgDB::Options* options)
37 const;
38
39private:
40 osg::Node* createRunway(const osg::Matrixd mat, const SGVec3f center, const FGRunwayRef runway, const osgDB::Options* options) const;
41 osg::Node* createPavement(const osg::Matrixd mat, const SGVec3f center, const FGPavementRef pavement, const osgDB::Options* options) const;
42 osg::Node* createBoundary(const osg::Matrixd mat, const SGVec3f center, const FGPavementRef pavement, const osgDB::Options* options) const;
43 osg::Node* createLine(const osg::Matrixd mat, const SGVec3f center, const FGPavementRef pavement, const osgDB::Options* options) const;
44 osg::Vec4f getLineColor(const int aPaintCode) const;
45 osg::ref_ptr<simgear::Effect> getMaterialEffect(std::string material, const osgDB::Options* options) const;
46};
47
48} // namespace flightgear
bool options(int, char **)
Definition JSBSim.cpp:568
SGSharedPtr< FGPavement > FGPavementRef
SGSharedPtr< FGRunway > FGRunwayRef
virtual const char * className() const
virtual ReadResult readNode(const std::string &fileName, const osgDB::Options *options) const
FlightPlan.hxx - defines a full flight-plan object, including departure, cruise, arrival information ...
Definition Addon.cxx:53
static const float RUNWAY_OFFSET