fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / FileIO / Collada / OSGColladaGlobal.inl
blobbf419524965cd812a3a5132987be630d349db40d
1 /*---------------------------------------------------------------------------*\
2  *                                OpenSG                                     *
3  *                                                                           *
4  *                                                                           *
5  *                Copyright (C) 2009 by the OpenSG Forum                     *
6  *                                                                           *
7  *                            www.opensg.org                                 *
8  *                                                                           *
9  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
10  *                                                                           *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13  *                                License                                    *
14  *                                                                           *
15  * This library is free software; you can redistribute it and/or modify it   *
16  * under the terms of the GNU Library General Public License as published    *
17  * by the Free Software Foundation, version 2.                               *
18  *                                                                           *
19  * This library is distributed in the hope that it will be useful, but       *
20  * WITHOUT ANY WARRANTY; without even the implied warranty of                *
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
22  * Library General Public License for more details.                          *
23  *                                                                           *
24  * You should have received a copy of the GNU Library General Public         *
25  * License along with this library; if not, write to the Free Software       *
26  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
27  *                                                                           *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30  *                                Changes                                    *
31  *                                                                           *
32  *                                                                           *
33  *                                                                           *
34  *                                                                           *
35  *                                                                           *
36  *                                                                           *
37 \*---------------------------------------------------------------------------*/
39 OSG_BEGIN_NAMESPACE
41 inline const DAE *
42 ColladaGlobal::getDAE(void) const
44     return _dae;
47 inline DAE *
48 ColladaGlobal::editDAE(void)
50     return _dae;
53 inline domCOLLADA *
54 ColladaGlobal::getDocRoot(void) const
56     return _docRoot;
59 inline const std::string &
60 ColladaGlobal::getDocPath(void) const
62     return _docPath;
65 inline void
66 ColladaGlobal::setDocPath(const std::string &docPath)
68     _docPath = docPath;
71 inline ColladaOptions *
72 ColladaGlobal::getOptions(void) const
74     return _options;
77 inline void
78 ColladaGlobal::setOptions(ColladaOptions *options)
80     _options = options;
83 inline Node *
84 ColladaGlobal::getRoot(void) const
86     return _rootN;
89 inline void
90 ColladaGlobal::setRoot(Node *rootN)
92     if(_rootN != NULL)
93     {
94         SWARNING << "ColladaGlobal::setRoot: Root already set. Overwriting."
95                  << std::endl;
96     }
98     _rootN = rootN;
101 inline GlobalsAttachment *
102 ColladaGlobal::getGlobalsAtt(void) const
104     return _globalsAtt;
107 inline void
108 ColladaGlobal::addLoaderState(
109     const std::string &name, ColladaLoaderState *state)
111     _loaderState[name] = state;
114 inline void
115 ColladaGlobal::subLoaderState(const std::string &name)
117     LoaderStateMapIt sIt = _loaderState.find(name);
119     if(sIt != _loaderState.end())
120         _loaderState.erase(sIt);
123 inline ColladaLoaderState *
124 ColladaGlobal::getLoaderState(const std::string &name) const
126     ColladaLoaderState    *retVal = NULL;
127     LoaderStateMapConstIt  sIt    = _loaderState.find(name);
129     if(sIt != _loaderState.end())
130         retVal = sIt->second;
132     return retVal;
135 template <class StateTypeT>
136 inline StateTypeT *
137 ColladaGlobal::getLoaderStateAs(const std::string &name) const
139     return dynamic_cast<StateTypeT *>(getLoaderState(name));
142 inline const ColladaGlobal::InstanceQueue &
143 ColladaGlobal::getInstQueue(void) const
145     return _instQueue;
148 inline ColladaGlobal::InstanceQueue &
149 ColladaGlobal::editInstQueue(void)
151     return _instQueue;
154 inline const ColladaGlobal::ElementStore &
155 ColladaGlobal::getElemStore(void) const
157     return _elemStore;
160 inline ColladaGlobal::ElementStore &
161 ColladaGlobal::editElemStore(void)
163     return _elemStore;
166 OSG_END_NAMESPACE