fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / FileIO / Collada / OSGColladaOptions.cpp
blobba8a40a79a119c7bed85062ba2bd2fc1d7ac6d1e
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 #if __GNUC__ >= 4 || __GNUC_MINOR__ >=3
40 #pragma GCC diagnostic ignored "-Wold-style-cast"
41 #endif
43 #include "OSGColladaOptions.h"
45 #if defined(OSG_WITH_COLLADA) || defined(OSG_DO_DOC)
47 #include "OSGColladaLog.h"
48 #include "OSGIOFileTypeBase.h"
50 OSG_BEGIN_NAMESPACE
52 void
53 ColladaOptions::parseOptions(const OptionSet &optSet)
55 OSG_COLLADA_LOG(("ColladaOptions::parseOptions\n"));
57 IOFileTypeBase::getOptionAs<bool>(
58 optSet, "invertTransparency", _invertTransparency);
59 IOFileTypeBase::getOptionAs<bool>(
60 optSet, "mergeTransforms", _mergeTransforms);
61 IOFileTypeBase::getOptionAs<bool>(
62 optSet, "createNameAttachments", _createNameAttachments);
63 IOFileTypeBase::getOptionAs<bool>(
64 optSet, "loadAnimations", _loadAnimations);
65 IOFileTypeBase::getOptionAs<bool>(
66 optSet, "loadLights", _loadLights);
67 IOFileTypeBase::getOptionAs<bool>(
68 optSet, "tryMergeInvalidIndices", _tryMergeInvalidIndices);
70 _oOptions = optSet;
73 /*! Return \c true if transparency values should be inverted, \c false
74 otherwise. Option name: "invertTransparency".
75 Some tools store transparency values inverted, use this to ensure correct
76 display.
78 bool
79 ColladaOptions::getInvertTransparency(void) const
81 return _invertTransparency;
84 /*! Set transparency value inversion. Option name: "invertTransparency".
85 Some tools store transparency values inverted, use this to ensure correct
86 display.
88 void
89 ColladaOptions::setInvertTransparency(bool value)
91 _invertTransparency = value;
94 /*! Return \c true if transform tags within a single collada <node> tag
95 should be merge, \c false if they should be preserved as individual
96 Nodes in OpenSG.
98 bool
99 ColladaOptions::getMergeTransforms(void) const
101 return _mergeTransforms;
104 /*! Set if transform tags should be merged.
105 Options name: "mergeTransforms".
107 void
108 ColladaOptions::setMergeTransforms(bool value)
110 _mergeTransforms = value;
113 /*! Return \c true if NameAttachments should be created, \c false otherwise.
114 Option name: "createNameAttachments".
116 bool
117 ColladaOptions::getCreateNameAttachments(void) const
119 return _createNameAttachments;
122 /*! Set if NameAttachments should be created.
123 Option name: "createNameAttachments".
125 void
126 ColladaOptions::setCreateNameAttachments(bool value)
128 _createNameAttachments = value;
131 bool
132 ColladaOptions::getLoadAnimations(void) const
134 return _loadAnimations;
137 void
138 ColladaOptions::setLoadAnimations(bool value)
140 _loadAnimations = value;
143 bool
144 ColladaOptions::getLoadLights(void) const
146 return _loadLights;
149 void
150 ColladaOptions::setLoadLights(bool value)
152 _loadLights = value;
155 bool ColladaOptions::getTryMergeInvalidIndices(void) const
157 return _tryMergeInvalidIndices;
160 void ColladaOptions::setTryMergeInvalidIndices(bool value)
162 _tryMergeInvalidIndices = value;
165 ColladaOptions::ColladaOptions(void) :
166 Inherited ( ),
167 _invertTransparency (false),
168 _mergeTransforms (true ),
169 _createNameAttachments (true ),
170 _loadAnimations (true ),
171 _loadLights (true ),
172 _tryMergeInvalidIndices(false),
173 _oOptions ( )
177 ColladaOptions::~ColladaOptions(void)
181 OSG_END_NAMESPACE
183 #endif // OSG_WITH_COLLADA