|
@@ -55,14 +55,12 @@ namespace FBX {
|
|
// Forward declarations
|
|
// Forward declarations
|
|
class Element;
|
|
class Element;
|
|
|
|
|
|
-
|
|
|
|
/** Represents a dynamic property. Type info added by deriving classes,
|
|
/** Represents a dynamic property. Type info added by deriving classes,
|
|
* see #TypedProperty.
|
|
* see #TypedProperty.
|
|
Example:
|
|
Example:
|
|
@verbatim
|
|
@verbatim
|
|
P: "ShininessExponent", "double", "Number", "",0.5
|
|
P: "ShininessExponent", "double", "Number", "",0.5
|
|
@endvebatim
|
|
@endvebatim
|
|
-
|
|
|
|
*/
|
|
*/
|
|
class Property
|
|
class Property
|
|
{
|
|
{
|
|
@@ -79,7 +77,6 @@ public:
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
-
|
|
|
|
template<typename T>
|
|
template<typename T>
|
|
class TypedProperty : public Property
|
|
class TypedProperty : public Property
|
|
{
|
|
{
|
|
@@ -138,38 +135,35 @@ private:
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
template <typename T>
|
|
template <typename T>
|
|
-inline T PropertyGet(const PropertyTable& in, const std::string& name,
|
|
|
|
- const T& defaultValue)
|
|
|
|
-{
|
|
|
|
|
|
+inline
|
|
|
|
+T PropertyGet(const PropertyTable& in, const std::string& name, const T& defaultValue) {
|
|
const Property* const prop = in.Get(name);
|
|
const Property* const prop = in.Get(name);
|
|
- if(!prop) {
|
|
|
|
|
|
+ if( nullptr == prop) {
|
|
return defaultValue;
|
|
return defaultValue;
|
|
}
|
|
}
|
|
|
|
|
|
// strong typing, no need to be lenient
|
|
// strong typing, no need to be lenient
|
|
const TypedProperty<T>* const tprop = prop->As< TypedProperty<T> >();
|
|
const TypedProperty<T>* const tprop = prop->As< TypedProperty<T> >();
|
|
- if(!tprop) {
|
|
|
|
|
|
+ if( nullptr == tprop) {
|
|
return defaultValue;
|
|
return defaultValue;
|
|
}
|
|
}
|
|
|
|
|
|
return tprop->Value();
|
|
return tprop->Value();
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
template <typename T>
|
|
template <typename T>
|
|
-inline T PropertyGet(const PropertyTable& in, const std::string& name,
|
|
|
|
- bool& result)
|
|
|
|
-{
|
|
|
|
|
|
+inline
|
|
|
|
+T PropertyGet(const PropertyTable& in, const std::string& name, bool& result) {
|
|
const Property* const prop = in.Get(name);
|
|
const Property* const prop = in.Get(name);
|
|
- if(!prop) {
|
|
|
|
|
|
+ if( nullptr == prop) {
|
|
result = false;
|
|
result = false;
|
|
return T();
|
|
return T();
|
|
}
|
|
}
|
|
|
|
|
|
// strong typing, no need to be lenient
|
|
// strong typing, no need to be lenient
|
|
const TypedProperty<T>* const tprop = prop->As< TypedProperty<T> >();
|
|
const TypedProperty<T>* const tprop = prop->As< TypedProperty<T> >();
|
|
- if(!tprop) {
|
|
|
|
|
|
+ if( nullptr == tprop) {
|
|
result = false;
|
|
result = false;
|
|
return T();
|
|
return T();
|
|
}
|
|
}
|
|
@@ -178,7 +172,6 @@ inline T PropertyGet(const PropertyTable& in, const std::string& name,
|
|
return tprop->Value();
|
|
return tprop->Value();
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
} //! FBX
|
|
} //! FBX
|
|
} //! Assimp
|
|
} //! Assimp
|
|
|
|
|