1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2009 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
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. *
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. *
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. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 #if __GNUC__ >= 4 || __GNUC_MINOR__ >=3
40 #pragma GCC diagnostic ignored "-Wold-style-cast"
43 #include "OSGColladaOptions.h"
45 #if defined(OSG_WITH_COLLADA) || defined(OSG_DO_DOC)
47 #include "OSGColladaLog.h"
48 #include "OSGIOFileTypeBase.h"
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
);
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
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
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
99 ColladaOptions::getMergeTransforms(void) const
101 return _mergeTransforms
;
104 /*! Set if transform tags should be merged.
105 Options name: "mergeTransforms".
108 ColladaOptions::setMergeTransforms(bool value
)
110 _mergeTransforms
= value
;
113 /*! Return \c true if NameAttachments should be created, \c false otherwise.
114 Option name: "createNameAttachments".
117 ColladaOptions::getCreateNameAttachments(void) const
119 return _createNameAttachments
;
122 /*! Set if NameAttachments should be created.
123 Option name: "createNameAttachments".
126 ColladaOptions::setCreateNameAttachments(bool value
)
128 _createNameAttachments
= value
;
132 ColladaOptions::getLoadAnimations(void) const
134 return _loadAnimations
;
138 ColladaOptions::setLoadAnimations(bool value
)
140 _loadAnimations
= value
;
144 ColladaOptions::getLoadLights(void) const
150 ColladaOptions::setLoadLights(bool value
)
155 bool ColladaOptions::getTryMergeInvalidIndices(void) const
157 return _tryMergeInvalidIndices
;
160 void ColladaOptions::setTryMergeInvalidIndices(bool value
)
162 _tryMergeInvalidIndices
= value
;
165 ColladaOptions::ColladaOptions(void) :
167 _invertTransparency (false),
168 _mergeTransforms (true ),
169 _createNameAttachments (true ),
170 _loadAnimations (true ),
172 _tryMergeInvalidIndices(false),
177 ColladaOptions::~ColladaOptions(void)
183 #endif // OSG_WITH_COLLADA