Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
SkyDomeNode.hh
1 /*===========================================================================*\
2 * *
3 * OpenFlipper *
4 * Copyright (C) 2001-2011 by Computer Graphics Group, RWTH Aachen *
5 * www.openflipper.org *
6 * *
7 *--------------------------------------------------------------------------- *
8 * This file is part of OpenFlipper. *
9 * *
10 * OpenFlipper is free software: you can redistribute it and/or modify *
11 * it under the terms of the GNU Lesser General Public License as *
12 * published by the Free Software Foundation, either version 3 of *
13 * the License, or (at your option) any later version with the *
14 * following exceptions: *
15 * *
16 * If other files instantiate templates or use macros *
17 * or inline functions from this file, or you compile this file and *
18 * link it with other files to produce an executable, this file does *
19 * not by itself cause the resulting executable to be covered by the *
20 * GNU Lesser General Public License. This exception does not however *
21 * invalidate any other reasons why the executable file might be *
22 * covered by the GNU Lesser General Public License. *
23 * *
24 * OpenFlipper is distributed in the hope that it will be useful, *
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
27 * GNU Lesser General Public License for more details. *
28 * *
29 * You should have received a copy of the GNU LesserGeneral Public *
30 * License along with OpenFlipper. If not, *
31 * see <http://www.gnu.org/licenses/>. *
32 * *
33 \*===========================================================================*/
34 
35 /*===========================================================================*\
36 * *
37 * $Revision: 10745 $ *
38 * $LastChangedBy: moebius $ *
39 * $Date: 2011-01-26 10:23:50 +0100 (Mi, 26 Jan 2011) $ *
40 * *
41 \*===========================================================================*/
42 
43 
44 #ifndef SKYDOME_NODE_HH
45 #define SKYDOME_NODE_HH
46 
47 //== INCLUDES =================================================================
48 
50 #include <ACG/Scenegraph/BaseNode.hh>
51 #include <ACG/Scenegraph/DrawModes.hh>
53 #include <ACG/GL/VertexDeclaration.hh>
54 #include <ACG/GL/IRenderer.hh>
55 #include <ACG/GL/GLPrimitives.hh>
57 
58 //== NAMESPACES ===============================================================
59 
60 //== CLASS DEFINITION =========================================================
61 
63 {
64 public:
65 
72  SkyDomeNode(SkyDome& _dome, BaseNode *_parent = 0, std::string _name = "<PlaneNode>");
73 
75  ~SkyDomeNode();
76 
78  ACG_CLASSNAME(SkyDomeNode);
79 
82 
84  void boundingBox(ACG::Vec3d & _bbMin, ACG::Vec3d & _bbMax);
85 
87  void draw(ACG::GLState & _state, const ACG::SceneGraph::DrawModes::DrawMode & _drawMode);
88 
90  void pick(ACG::GLState & _state, ACG::SceneGraph::PickTarget _target);
91 
93  SkyDome& getSkyDome();
94 
96  void setSkyDome(SkyDome _dome);
97 
105  void getRenderObjects(ACG::IRenderer* _renderer, ACG::GLState& _state , const ACG::SceneGraph::DrawModes::DrawMode& _drawMode , const ACG::SceneGraph::Material* _mat);
106 
110  void update(){updateBuffers_ = true; };
111 
112 private:
113  void drawSkyDome(ACG::GLState & _state);
114  void drawSkyDomePick(ACG::GLState & _state);
115 
116 
117  SkyDome& dome_;
118 
120  unsigned int vbo_;
121 
122  ACG::VertexDeclaration vertexDecl_;
123 
124  unsigned int textureId_;
125 
126  bool updateBuffers_;
127 };
128 
129 #endif // SKYDOME_NODE_HH
virtual void draw(GLState &, const DrawModes::DrawMode &)
Draw this node using the draw modes _drawMode.
Definition: BaseNode.hh:223
virtual void getRenderObjects(IRenderer *_renderer, GLState &_state, const DrawModes::DrawMode &_drawMode, const Material *_mat)
Deferred draw call with shader based renderer.
Definition: BaseNode.hh:241
virtual DrawModes::DrawMode availableDrawModes() const
Definition: BaseNode.hh:167
unsigned int vbo_
VBO used to render the dome.
Definition: SkyDomeNode.hh:120
Class to define the vertex input layout.
#define DLLEXPORT
void update()
Definition: SkyDomeNode.hh:110
PickTarget
What target to use for picking.
Definition: BaseNode.hh:99
virtual void pick(GLState &, PickTarget)
Definition: BaseNode.hh:285
virtual void boundingBox(Vec3d &, Vec3d &)
Definition: BaseNode.hh:174