GlobeEngine
PlanetaryViewerEngine.h
Go to the documentation of this file.
1 
8 #ifndef GlobeEngine_PlanetaryViewerEngine_h
9 #define GlobeEngine_PlanetaryViewerEngine_h
10 
11 #include <math.h>
12 #include <ctime>
13 #include <iostream>
14 #include <stdio.h>
15 #include <vector>
16 #include "OpenGL_Includes.h"
17 #include "Engine.h"
18 #include "Shader.h"
19 #include "FlightCamera.h"
20 #include "Common.h"
21 #include "CoordinateSystem.h"
22 #include "SceneStateSet.h"
23 #include "Cube.h"
24 #include "DrawableComponent.h"
25 #include "Plane.h"
26 #include "DebugLogger.h"
27 #include "Timer.h"
28 #include "MemoryState.h"
29 #include "DebugMap.h"
30 #include "Sphere.h"
31 #include "Cone.h"
34 //#include "VolumeComposition.h"
35 #include "PlanetaryViewerPlane.h"
37 #include "vmmlXMLUtils.h"
38 #include "Streamlines.h"
39 #include "ScreenSpaceDecal.h"
40 #include "MultiLineObject.h"
41 #include "VolumeRenderer.h"
42 
43 namespace gePlanetaryViewer {
44 
46  {
47 
48  public:
51 
52  void clear();
53  void destroy(){};
54  void create();
55 
56  std::shared_ptr<geFlow::VolumeComposition> getVolumeComposition();
57 
58  std::shared_ptr<ge::Streamlines> getStreamlines();
59 
60  // overrides from ge::Engine
61  void initializeScene(std::string _projectsrcPath = 0);
62  void drawScene();
63  void resize(int _w, int _h);
64  void update();
65 
67 
68  void applyVolumeInfo();
69  bool getWireframe();
70  void setWireframe(bool);
71 
73 
74  private:
75 
76  std::shared_ptr<geData::MultiLineObject> multilineGeometry;
77 
78  PlanetaryViewerSceneBlueprint* sceneBlueprint;
79  TerrainInfo terrainInfo;
80  //VolumeInteractionInfo volumeInfo2;
81  StreamlinesInteractionInfo streamlinesInteractionInfo;
82 
83  std::shared_ptr<ge::Shader> programForUtilities;
84 
85  std::shared_ptr<ge::Shader> programForSlicingPlanes;
86  std::shared_ptr<ge::Shader> programForStreamlinesPlane;
87  std::shared_ptr<ge::Shader> programForDebug;
88 
89  std::shared_ptr<ge::Shader> programForDecalCubes;
90  std::shared_ptr<ge::Shader> programForMultiLineObject;
91 
92  //std::shared_ptr<ge::Shader> programForEmissionAbsorption;
93  //std::shared_ptr<ge::Shader> programForMaximumIntensityProjection;
94  //std::shared_ptr<ge::Shader> programForMean;
95  //std::shared_ptr<ge::Shader> programForFirstLocalMaximum;
96 
97  // Terrain module
98  std::shared_ptr<gePlanetaryViewer::PlanetaryViewerTerrainModule> terrainmodule;
99 
100  // CoordinateCross
101  ge::CoordinateSystem coordinateSystem;
102  // Basic scene state
103  ge::SceneStateSet sceneStates[1];
104 
105  std::shared_ptr<geFlow::VolumeRenderer> volumeRenderer;
106  //std::shared_ptr<ge::Cube> volumeBoundCube;
107  std::shared_ptr<ge::ScreenSpaceDecal> decalCube;
108  std::shared_ptr<ge::ScreenSpaceDecal> decalCube2;
109 
110  std::shared_ptr<PlanetaryViewerPlane> slicingPlaneXY;
111  std::shared_ptr<PlanetaryViewerPlane> slicingPlaneXZ;
112  std::shared_ptr<PlanetaryViewerPlane> slicingPlaneYZ;
113 
114  // Debugger functionality
115  geUtil::DebugLogger openglDebugLogger;
116  ge::Timer openglTimer;
117  geUtil::MemoryState openglMemory;
118  geUtil::DebugMap debugmap;
119 
120  PlanetaryViewerComposition planetaryComposition;
121  //std::shared_ptr<geFlow::VolumeComposition> volumeComposition;
122  std::shared_ptr<ge::Streamlines> streamlinesComposition;
123 
124  void drawStreamlines();
125 
126  std::shared_ptr<ge::Texture2Drgb> texture1;
127  std::shared_ptr<ge::Texture3Drgb> texture2;
128 
129  void tryAround();
130  void drawSlicing();
131  void drawVolumeRendering();
132  void drawScreenSpaceDecals();
133 
134  ge::FrameBufferObject gBuffer;
135  ge::FrameBufferObject ssdBuffer;
136 
137  int screenWidth;
138  int screenHeight;
139 
140  bool wireframe = false;
141  };
142 }
143 #endif
Definition: PlanetaryViewerEngine.h:45
Definition: MemoryState.h:16
void drawScene()
Definition: PlanetaryViewerEngine.cpp:236
std::shared_ptr< geFlow::VolumeComposition > getVolumeComposition()
Definition: PlanetaryViewerEngine.cpp:386
Definition: DebugMap.h:18
void initializeScene(std::string _projectsrcPath=0)
Definition: PlanetaryViewerEngine.cpp:26
void resize(int _w, int _h)
Definition: PlanetaryViewerEngine.cpp:301
Definition: DebugLogger.h:22
Definition: FrameBufferObject.h:20
Definition: PlanetaryViewerComposition.h:6
void setWireframe(bool)
Definition: PlanetaryViewerEngine.cpp:396
std::shared_ptr< ge::Streamlines > getStreamlines()
Definition: PlanetaryViewerEngine.cpp:391
void setupSceneCompositions()
Definition: PlanetaryViewerEngine.cpp:311
Definition: Engine.h:20
Definition: PlanetaryViewerSceneBlueprint.h:47
Definition: PlanetaryViewerSceneBlueprint.h:17
Definition: PlanetaryViewerSceneBlueprint.h:59
void clear()
Definition: PlanetaryViewerEngine.cpp:12
Definition: SceneStateSet.h:41
~PlanetaryViewerEngine()
Definition: PlanetaryViewerEngine.h:50
void destroy()
Definition: PlanetaryViewerEngine.h:53
PlanetaryViewerEngine(PlanetaryViewerSceneBlueprint *_sceneBlueprint)
Definition: PlanetaryViewerEngine.cpp:5
Definition: PlanetaryViewerComposition.h:8
void applyVolumeInfo()
Definition: PlanetaryViewerEngine.cpp:358
void create()
Definition: PlanetaryViewerEngine.cpp:21
void updateFramebufferStandardID()
Definition: PlanetaryViewerEngine.cpp:348
void update()
Definition: PlanetaryViewerEngine.cpp:171
bool getWireframe()
Definition: PlanetaryViewerEngine.cpp:401
Definition: Timer.h:17
Definition: CoordinateSystem.h:17