OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreCompositorNodeDef.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 __CompositorNodeDef_H__
30 #define __CompositorNodeDef_H__
31 
32 #include "OgreHeaderPrefix.h"
35 
36 namespace Ogre
37 {
47 
78  {
79  protected:
80  friend class CompositorNode;
81 
83 
92 
95 
97 
98  public:
100 
101  CompositorNodeDef( const String &name, CompositorManager2 *compositorManager ) :
102  TextureDefinitionBase( TEXTURE_LOCAL ),
103  mName( name ), mStartEnabled( true ), mNameStr( name ),
104  mCompositorManager( compositorManager ) {}
105  virtual ~CompositorNodeDef() {}
106 
107  IdString getName(void) const { return mName; }
108  String getNameStr(void) const { return mNameStr; }
109 
111  void setStartEnabled( bool enabled ) { mStartEnabled = enabled; }
112  bool getStartEnabled(void ) const { return mStartEnabled; }
113 
126  void getTextureSource( size_t outputChannel, size_t &index, TextureSource &textureSource ) const;
127 
135  void setNumTargetPass( size_t numPasses ) { mTargetPasses.reserve( numPasses ); }
136 
147  CompositorTargetDef* addTargetPass( const String &renderTargetName, uint32 rtIndex=0 );
148 
150  CompositorTargetDef* getTargetPass( size_t passIndex ) { return &mTargetPasses[passIndex]; }
151 
153  size_t getNumTargetPasses(void) const { return mTargetPasses.size(); }
154 
162  void setNumOutputChannels( size_t numOuts ) { mOutChannelMapping.reserve( numOuts ); }
163 
165  size_t getNumOutputChannels(void) const { return mOutChannelMapping.size(); }
166 
182  void mapOutputChannel( size_t outChannel, IdString textureName );
183 
184  CompositorManager2* getCompositorManager(void) const { return mCompositorManager; }
185  };
186 
189 }
190 
191 #include "OgreHeaderSuffix.h"
192 
193 #endif
CompositorTargetDefVec mTargetPasses
unsigned int uint32
Definition: OgrePlatform.h:420
#define _OgreExport
Definition: OgrePlatform.h:255
Compositor nodes are the core subject of compositing.
void setStartEnabled(bool enabled)
Whether the node should be start as enabled when instantiated.
CompositorNodeDef(const String &name, CompositorManager2 *compositorManager)
CompositorManager2 * mCompositorManager
void setNumOutputChannels(size_t numOuts)
Reserves enough memory for all output channel mappings (efficient allocation, better than using linke...
Centralized class for dealing with declarations of textures in Node & Workspace definitions.
Compositor nodes are the core subject of compositing.
CompositorManager2 * getCompositorManager(void) const
CompositorTargetDef * getTargetPass(size_t passIndex)
Retrieves an existing pass by it's given index.
String getNameStr(void) const
ChannelMappings mOutChannelMapping
Tells where to grab the RenderTarget from for the output channel.
bool getStartEnabled(void) const
Hashed string.
Definition: OgreIdString.h:94
void getTextureSource(IdString name, size_t &index, TextureSource &textureSource) const
Retrieves in which container to look for when looking to which texture is a given name associated wit...
vector< CompositorTargetDef >::type CompositorTargetDefVec
size_t getNumOutputChannels(void) const
Returns the number of output channels.
IdString getName(void) const
size_t getNumTargetPasses(void) const
Gets the number of passes in this node.
void setNumTargetPass(size_t numPasses)
Reserves enough memory for all passes.
_StringBase String
Definition: OgreCommon.h:53
Main system for managing Render Targets through the use of nodes.
vector< uint32 >::type ChannelMappings