Blender V2.61 - r43446

SCA_IScene.cpp

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
00019  * All rights reserved.
00020  *
00021  * The Original Code is: all of this file.
00022  *
00023  * Contributor(s): none yet.
00024  *
00025  * ***** END GPL LICENSE BLOCK *****
00026  */
00027 
00033 #include "SCA_IScene.h"
00034 #include "Value.h"
00035 
00036 SCA_DebugProp::SCA_DebugProp(): m_obj(NULL)
00037 {
00038 }
00039 
00040 SCA_DebugProp::~SCA_DebugProp()
00041 {
00042     if (m_obj) 
00043         m_obj->Release(); 
00044 }
00045 
00046 SCA_IScene::SCA_IScene()
00047 {
00048 }
00049 
00050 void SCA_IScene::RemoveAllDebugProperties()
00051 {
00052     for (std::vector<SCA_DebugProp*>::iterator it = m_debugList.begin();
00053         !(it==m_debugList.end());++it)
00054     {
00055         delete (*it);
00056     }
00057     m_debugList.clear();
00058 }
00059 
00060 
00061 SCA_IScene::~SCA_IScene()
00062 {
00063     RemoveAllDebugProperties();
00064 }
00065 
00066 
00067 std::vector<SCA_DebugProp*>& SCA_IScene::GetDebugProperties() 
00068 {
00069     return m_debugList;
00070 }
00071 
00072 
00073 
00074 void SCA_IScene::AddDebugProperty(class CValue* debugprop,
00075                                   const STR_String &name)
00076 {
00077     SCA_DebugProp* dprop = new SCA_DebugProp();
00078     dprop->m_obj = debugprop;
00079     debugprop->AddRef();
00080     dprop->m_name = name;
00081     m_debugList.push_back(dprop);
00082 }