OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreCompositorNode.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 __CompositorNode_H__
30 #define __CompositorNode_H__
31 
32 #include "OgreHeaderPrefix.h"
35 #include "OgreIdString.h"
36 #include "OgreId.h"
37 
38 namespace Ogre
39 {
40  class CompositorNodeDef;
41 
91  {
92  protected:
95  bool mEnabled;
96 
101 
104 
106 
109 
111 
113 
118  void routeOutputs();
119 
127  void disconnectOutput();
128 
135 
136  public:
140  CompositorNode( IdType id, IdString name, const CompositorNodeDef *definition,
141  CompositorWorkspace *workspace, RenderSystem *renderSys,
142  const RenderTarget *finalTarget );
143  virtual ~CompositorNode();
144 
145  IdString getName(void) const { return mName; }
146  const CompositorNodeDef* getDefinition() const { return mDefinition; }
147 
158  void setEnabled( bool bEnabled ) { mEnabled = bEnabled; }
159 
161  bool getEnabled(void) const { return mEnabled; }
162 
170  void connectTo( size_t outChannelA, CompositorNode *nodeB, size_t inChannelB );
171 
182  void connectFinalRT( RenderTarget *rt, CompositorChannel::TextureVec &textures,
183  size_t inChannelA );
184 
185  bool areAllInputsConnected() const { return mNumConnectedInputs == mInTextures.size(); }
186  const CompositorChannelVec& getInputChannel() const { return mInTextures; }
187  const CompositorChannelVec& getLocalTextures() const { return mLocalTextures; }
188 
204  TexturePtr getDefinedTexture( IdString textureName, size_t mrtIndex ) const;
205 
212  void createPasses(void);
213 
214  const CompositorPassVec& _getPasses() const { return mPasses; }
215 
222  void _update( const Camera *lodCamera, SceneManager *sceneManager );
223 
231  void notifyRecreated( const CompositorChannel &oldChannel, const CompositorChannel &newChannel );
232 
238  void notifyDestroyed( const CompositorChannel &channel );
239 
246  void _notifyCleared(void);
247 
257  virtual void finalTargetResized( const RenderTarget *finalTarget );
258 
260  CompositorWorkspace* getWorkspace(void) { return mWorkspace; }
261 
263  const CompositorWorkspace* getWorkspace(void) const { return mWorkspace; }
264 
265  private:
267  };
268 
271 }
272 
273 #include "OgreHeaderSuffix.h"
274 
275 #endif
CompositorChannelVec mLocalTextures
A 'canvas' which can receive the results of a rendering operation.
const CompositorNodeDef * getDefinition() const
A viewpoint from which the scene will be rendered.
Definition: OgreCamera.h:82
#define _OgreExport
Definition: OgrePlatform.h:255
bool getEnabled(void) const
Returns if this instance is enabled. setEnabled.
Compositor nodes are the core subject of compositing.
vector< CompositorPass * >::type CompositorPassVec
CompositorNodeVec mConnectedNodes
Nodes we're connected to. If we destroy our local textures, we need to inform them.
CompositorWorkspace * mWorkspace
const CompositorWorkspace * getWorkspace(void) const
Returns our parent workspace.
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.
const CompositorChannelVec & getInputChannel() const
IdString mName
Unique name across the same workspace.
Compositor nodes are the core subject of compositing.
bool areAllInputsConnected() const
const CompositorChannelVec & getLocalTextures() const
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
CompositorChannelVec mOutTextures
Contains pointers that are ither in mInTextures or mLocalTextures.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
CompositorChannelVec mInTextures
void setEnabled(bool bEnabled)
Enables or disables all instances of this node.
Hashed string.
Definition: OgreIdString.h:94
virtual void postInitializePassScene(CompositorPassScene *pass)
Called right after we create a PASS_SCENE pass.
const CompositorPassVec & _getPasses() const
vector< TexturePtr >::type TextureVec
size_t mNumConnectedInputs
Must be <= mInTextures.size(). Tracks how many pointers are not null in mInTextures.
A channel in the compositor transports textures between nodes.
vector< CompositorChannel >::type CompositorChannelVec
Defines the functionality of a 3D API.
vector< CompositorNode * >::type CompositorNodeVec
CompositorWorkspace * getWorkspace(void)
Returns our parent workspace.
IdString getName(void) const
RenderSystem * mRenderSystem
Implementation of CompositorPass This implementation will perform main rendering, selecting several p...
CompositorPassVec mPasses
CompositorNodeDef const * mDefinition