OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreCompositorWorkspace.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4  (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2014 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 
29 #ifndef _OgreCompositorWorkspace_H_
30 #define _OgreCompositorWorkspace_H_
31 
32 #include "OgreHeaderPrefix.h"
35 
36 namespace Ogre
37 {
79  {
80  protected:
82 
83  bool mValid;
84  bool mEnabled;
85 
87 
95 
99 
101  void createAllNodes(void);
102 
104  void destroyAllNodes(void);
105 
114  void connectAllNodes(void);
115 
116  void clearAllConnections(void);
117 
124  void setupPassesShadowNodes(void);
125 
126  public:
127  CompositorWorkspace( IdType id, const CompositorWorkspaceDef *definition,
128  const CompositorChannel &finalRenderTarget, SceneManager *sceneManager,
129  Camera *defaultCam, RenderSystem *renderSys, bool bEnabled );
130  virtual ~CompositorWorkspace();
131 
132  const CompositorChannel& getGlobalTexture( IdString name ) const;
133 
135  bool isValid(void) const { return mValid; }
136 
137  void setEnabled( bool bEnabled ) { mEnabled = bEnabled; }
138  bool getEnabled() const { return mEnabled; }
139 
140  void setListener( CompositorWorkspaceListener *listener ) { mListener = listener; }
141  CompositorWorkspaceListener* getListener(void) const { return mListener; }
142 
155  CompositorNode* findNode( IdString aliasName, bool includeShadowNodes=false ) const;
156 
161  void recreateAllNodes(void);
162 
169  void reconnectAllNodes(void);
170 
178  void _beginUpdate( bool forceBeginFrame );
179 
181  void _update(void);
182 
191  void _endUpdate( bool forceEndFrame );
192 
199  void _swapFinalTarget(void);
200 
204  void _validateFinalTarget(void);
205 
217  CompositorShadowNode* findShadowNode( IdString nodeDefName ) const;
218 
234  CompositorShadowNode* findOrCreateShadowNode( IdString nodeDefName, bool &bCreated );
235 
236  const CompositorNodeVec& getNodeSequence(void) const { return mNodeSequence; }
237 
239  Camera* findCamera( IdString cameraName ) const;
240 
242  Camera* getDefaultCamera() const { return mDefaultCamera; }
243 
244  SceneManager* getSceneManager() const { return mSceneManager; }
245 
247  CompositorManager2* getCompositorManager();
248 
250  const CompositorManager2* getCompositorManager() const;
251 
252  size_t getFrameCount(void) const;
253  };
254 
257 }
258 
259 #include "OgreHeaderSuffix.h"
260 
261 #endif
Camera * getDefaultCamera() const
Gets the default camera passed through mDefaultViewport.
A viewpoint from which the scene will be rendered.
Definition: OgreCamera.h:82
CompositorShadowNodeVec mShadowNodes
CompositorWorkspaceListener * mListener
#define _OgreExport
Definition: OgrePlatform.h:255
CompositorWorkspaceDef const * mDefinition
A compositor workspace is the main interface to render into an RT, be it a RenderWindow or an RTT (Re...
Manages the organisation and rendering of a 'scene' i.e.
bool isValid(void) const
Only valid workspaces can update without crashing.
const CompositorNodeVec & getNodeSequence(void) const
CompositorChannelVec mGlobalTextures
Compositor nodes are the core subject of compositing.
SceneManager * mSceneManager
Could be null. CompositorManager2::addWorkspace.
Ogre::uint32 IdType
Big projects with lots, lots of units for very long periods of time (MMORPGs?) may want to define thi...
Definition: OgreId.h:36
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
vector< CompositorShadowNode * >::type CompositorShadowNodeVec
SceneManager * getSceneManager() const
Hashed string.
Definition: OgreIdString.h:94
CompositorNodeVec mNodeSequence
Main sequence in the order they should be executed.
A channel in the compositor transports textures between nodes.
vector< CompositorChannel >::type CompositorChannelVec
Defines the functionality of a 3D API.
CompositorWorkspaceListener * getListener(void) const
vector< CompositorNode * >::type CompositorNodeVec
Shadow Nodes are special nodes (not to be confused with.
Main system for managing Render Targets through the use of nodes.
void setListener(CompositorWorkspaceListener *listener)
unsigned int uint