source: OGRE/trunk/ogrenew/OgreMain/src/OgreCompositionTargetPass.cpp @ 692

Revision 692, 5.3 KB checked in by mattausch, 18 years ago (diff)

adding ogre 1.2 and dependencies

Line 
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4    (Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2005 The OGRE Team
8Also see acknowledgements in Readme.html
9
10This program is free software; you can redistribute it and/or modify it under
11the terms of the GNU Lesser General Public License as published by the Free Software
12Foundation; either version 2 of the License, or (at your option) any later
13version.
14
15This program is distributed in the hope that it will be useful, but WITHOUT
16ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
18
19You should have received a copy of the GNU Lesser General Public License along with
20this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21Place - Suite 330, Boston, MA 02111-1307, USA, or go to
22http://www.gnu.org/copyleft/lesser.txt.
23-----------------------------------------------------------------------------
24*/
25#include "OgreStableHeaders.h"
26#include "OgreCompositionTargetPass.h"
27#include "OgreCompositionPass.h"
28#include "OgreMaterialManager.h"
29
30namespace Ogre {
31
32CompositionTargetPass::CompositionTargetPass(CompositionTechnique *parent):
33    mParent(parent),
34    mInputMode(IM_NONE),
35    mOnlyInitial(false),
36    mVisibilityMask(0xFFFFFFFF),
37    mLodBias(1.0f),
38        mMaterialScheme(MaterialManager::DEFAULT_SCHEME_NAME)
39{
40}
41//-----------------------------------------------------------------------
42CompositionTargetPass::~CompositionTargetPass()
43{
44    removeAllPasses();
45}
46//-----------------------------------------------------------------------
47void CompositionTargetPass::setInputMode(InputMode mode)
48{
49    mInputMode = mode;
50}
51//-----------------------------------------------------------------------
52CompositionTargetPass::InputMode CompositionTargetPass::getInputMode() const
53{
54    return mInputMode;
55}
56//-----------------------------------------------------------------------
57void CompositionTargetPass::setOutputName(const String &out)
58{
59    mOutputName = out;
60}
61//-----------------------------------------------------------------------
62const String &CompositionTargetPass::getOutputName() const
63{
64    return mOutputName;
65}
66//-----------------------------------------------------------------------
67void CompositionTargetPass::setOnlyInitial(bool value)
68{
69    mOnlyInitial = value;
70}
71//-----------------------------------------------------------------------
72bool CompositionTargetPass::getOnlyInitial()
73{
74    return mOnlyInitial;
75}
76//-----------------------------------------------------------------------
77void CompositionTargetPass::setVisibilityMask(uint32 mask)
78{
79    mVisibilityMask = mask;
80}
81//-----------------------------------------------------------------------
82uint32 CompositionTargetPass::getVisibilityMask()
83{
84    return mVisibilityMask;
85}
86//-----------------------------------------------------------------------
87void CompositionTargetPass::setLodBias(float bias)
88{
89    mLodBias = bias;
90}
91//-----------------------------------------------------------------------
92float CompositionTargetPass::getLodBias()
93{
94    return mLodBias;
95}
96//-----------------------------------------------------------------------
97void CompositionTargetPass::setMaterialScheme(const String& schemeName)
98{
99        mMaterialScheme = schemeName;
100}
101//-----------------------------------------------------------------------
102const String& CompositionTargetPass::getMaterialScheme(void) const
103{
104        return mMaterialScheme;
105}
106//-----------------------------------------------------------------------
107CompositionPass *CompositionTargetPass::createPass()
108{
109    CompositionPass *t = new CompositionPass(this);
110    mPasses.push_back(t);
111    return t;
112}
113//-----------------------------------------------------------------------
114
115void CompositionTargetPass::removePass(size_t index)
116{
117    assert (index < mPasses.size() && "Index out of bounds.");
118    Passes::iterator i = mPasses.begin() + index;
119    delete(*i);
120    mPasses.erase(i);
121}
122//-----------------------------------------------------------------------
123
124CompositionPass *CompositionTargetPass::getPass(size_t index)
125{
126    assert (index < mPasses.size() && "Index out of bounds.");
127    return mPasses[index];
128}
129//-----------------------------------------------------------------------
130
131size_t CompositionTargetPass::getNumPasses()
132{
133    return mPasses.size();
134}
135//-----------------------------------------------------------------------
136void CompositionTargetPass::removeAllPasses()
137{
138    Passes::iterator i, iend;
139    iend = mPasses.end();
140    for (i = mPasses.begin(); i != iend; ++i)
141    {
142        delete(*i);
143    }
144    mPasses.clear();
145}
146//-----------------------------------------------------------------------
147CompositionTargetPass::PassIterator CompositionTargetPass::getPassIterator(void)
148{
149    return PassIterator(mPasses.begin(), mPasses.end());
150}
151
152//-----------------------------------------------------------------------
153CompositionTechnique *CompositionTargetPass::getParent()
154{
155    return mParent;
156}
157//-----------------------------------------------------------------------
158
159}
Note: See TracBrowser for help on using the repository browser.