H3D API  2.4.1
FBODebugger.h
Go to the documentation of this file.
1 // Copyright 2004-2019, SenseGraphics AB
3 //
4 // This file is part of H3D API.
5 //
6 // H3D API is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // H3D API is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with H3D API; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // A commercial license is also available. Please contact us at
21 // www.sensegraphics.com for more information.
22 //
23 //
27 //
29 #ifndef __FBODEBUGGER_H__
30 #define __FBODEBUGGER_H__
31 
32 #include <H3D/X3DChildNode.h>
33 #include <H3D/Group.h>
34 #include <H3D/SFString.h>
35 #include <H3D/SFFloat.h>
36 #include <H3D/X3D.h>
38 #include <H3D/X3DTextureNode.h>
40 #include <H3D/FieldTemplates.h>
41 
42 namespace H3D {
43 
66  class FBODebugger : public X3DChildNode {
67  public:
69  class H3DAPI_API UpdateSaveToURL : public AutoUpdate < SFString > {
70  //virtual void onNewValue( const std::string &v );
71  };
72  //typedef X3DTextureNode::UpdateSaveToURL UpdateSaveToURL;
74  class ToggleBlend: public TypedField< Field, SFFloat >
75  {
76  protected:
77  virtual void update();
78  };
80  FBODebugger( Inst< SFNode > _metadata = 0,
81  Inst< SFString > _fbo = 0,
82  Inst< SFString > _buffer = 0,
83  Inst< SFFloat > _transparency = 0,
84  Inst< UpdateSaveToURL > _saveToUrl = 0,
85  Inst< SFBool > _saveSuccess = 0);
86 
88  virtual void traverseSG( TraverseInfo &ti );
89 
91  virtual void render();
92 
101  H3DUniquePtr< SFString > fbo;
102 
112  H3DUniquePtr< SFString > buffer;
113 
122  H3DUniquePtr< SFFloat > transparency;
123 
133  H3DUniquePtr < UpdateSaveToURL > saveToUrl;
134 
141  H3DUniquePtr < SFBool > saveSuccess;
142 
145  protected:
148 
151 
154 
156  string current_fbo;
157 
161 
164  H3DUniquePtr<ToggleBlend> toggleBlend;
165 
167  H3DUniquePtr<SFTextreNode> selected_texture;
168 
169  };
170 }
171 
172 #endif
Contains different templates to modify field behaviour.
Header file for Group, X3D scene-graph node.
Header file for H3DSingleTextureNode, X3D scene-graph node.
Header file for RenderTargetTexture.
Contains the SFFloat field class.
Contains the SFString field class.
Header file for X3DChildNode, X3D scene-graph node.
Header file for X3DTextureNode, X3D abstract texture scene-graph node.
This file contains functions for creating H3D nodes from X3D input.
A field used to execute the save to URL operation when the URL is set.
Definition: FBODebugger.h:69
The FBODebugger node provides a convenient way to check the result of all FrameBufferTextureGenerator...
Definition: FBODebugger.h:66
AutoRef< Group > texture_scene
The scene used to render the selected texture in fullscreen.
Definition: FBODebugger.h:147
H3DUniquePtr< SFFloat > transparency
Transparency value is used to affect how transparent the current selected texture will be rendered ,...
Definition: FBODebugger.h:122
H3DUniquePtr< UpdateSaveToURL > saveToUrl
When a new value is specified for saveToUrl the current selected FBO depth/color texture is rendered ...
Definition: FBODebugger.h:133
X3D::DEFNodes texture_scene_dn
DEFNodes from the texture_scene.
Definition: FBODebugger.h:150
H3DUniquePtr< SFString > buffer
The buffer field specifies which buffer to display.
Definition: FBODebugger.h:112
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: FBODebugger.h:144
FBODebugger(Inst< SFNode > _metadata=0, Inst< SFString > _fbo=0, Inst< SFString > _buffer=0, Inst< SFFloat > _transparency=0, Inst< UpdateSaveToURL > _saveToUrl=0, Inst< SFBool > _saveSuccess=0)
Constructor.
Definition: FBODebugger.cpp:77
H3DUniquePtr< SFTextreNode > selected_texture
texture used to keep the current selected texture
Definition: FBODebugger.h:167
string current_buffer
The type of buffer currently being used.
Definition: FBODebugger.h:153
H3DUniquePtr< SFString > fbo
The fbo field contains the name of the FrameBufferTextureGenerator that you want to see the buffers i...
Definition: FBODebugger.h:101
string current_fbo
The name of the FrameBufferTextureGenerator currently being used.
Definition: FBODebugger.h:156
H3DUniquePtr< ToggleBlend > toggleBlend
Field to monitor transparency field and toggle blending for the selected texture rendering if needed.
Definition: FBODebugger.h:164
virtual void render()
Render the node. Render the FBO texture in fullscreen.
Definition: FBODebugger.cpp:205
virtual void traverseSG(TraverseInfo &ti)
Traverse the scenegraph.
Definition: FBODebugger.cpp:120
H3DUniquePtr< SFBool > saveSuccess
Contains the result of the last save operation.
Definition: FBODebugger.h:141
AutoRef< RenderTargetTexture > render_target_texture
RenderTargetTexture used to show the color buffers of a fbo if selected.
Definition: FBODebugger.h:160
TraverseInfo is a structure that is passed along when traversing the scene graph.
Definition: TraverseInfo.h:57
A template modifier class for adding type checking on the routes to any Field class.
Definition: TypedField.h:84
Template to make sure that the Node that is set in a SFNode is of a specified Node type.
Definition: SFNode.h:97
This abstract node type indicates that the concrete nodes which are instantiated based on it may be u...
Definition: X3DChildNode.h:42
Provides a mapping between defined DEF names in X3D and the nodes they refer to.
Definition: DEFNodes.h:92
H3D API namespace.
Definition: Anchor.h:38
The AutoUpdate field is a template to force the BaseField to update itself as soon as an event is rec...
Definition: FieldTemplates.h:130
The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with...
Definition: H3DNodeDatabase.h:194