🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
GfxMain.hpp
浏览该文件的文档.
1
20
21#pragma once
22
23#include "AstGlobal.h"
24
25// OSG头文件
26#include <osgViewer/Viewer>
27#include <osg/Group>
28#include <osg/Node>
29#include <osg/PositionAttitudeTransform>
30
31namespace osg {
32 class Node;
33 class Group;
34 class PositionAttitudeTransform;
35}
36
37AST_NAMESPACE_BEGIN
38
39class GfxMain {
40public:
42 GfxMain();
43 GfxMain(const GfxMain&) = delete;
44 GfxMain& operator=(const GfxMain&) = delete;
45
47 ~GfxMain();
48
50 bool initialize();
51
53 int run();
54
56 osg::Group* getRootNode();
57
59 void addNode(osg::Node* node);
60
62 void removeNode(osg::Node* node);
63
65 void setBackgroundColor(const osg::Vec4& color);
66
68 osgViewer::Viewer* getViewer();
69
70private:
72 osgViewer::Viewer* m_viewer{};
73
75 osg::Group* m_root{};
76
78 bool initScene();
79
81 bool initCamera();
82
84 bool initLight();
85};
86
87AST_NAMESPACE_END
定义 GfxMain.hpp:39