props_io.hxx
propsfwd.hxx
tiedpropertylist.hxx
+ vectorPropTemplates.hxx
)
set(SOURCES
#include <cstdlib>
#include <cstring>
-// working around MSVC weirdness with props.hxx and SGMathFwd
-#include <simgear/math/SGMath.hxx>
-
#include "propertyObject.hxx"
#include <simgear/structure/exception.hxx>
#endif
#include "props.hxx"
+#include "vectorPropTemplates.hxx"
#include <algorithm>
return result;
}
-// Extended properties
-template<>
-std::istream& readFrom<SGVec3d>(std::istream& stream, SGVec3d& result);
-template<>
-std::istream& readFrom<SGVec4d>(std::istream& stream, SGVec4d& result);
-
-
/**
* Property value types.
*/
DEFINTERNALPROP(const char[], STRING);
#undef DEFINTERNALPROP
-template<>
-struct PropertyTraits<SGVec3d>
-{
- static const Type type_tag = VEC3D;
- enum { Internal = 0 };
-};
-
-template<>
-struct PropertyTraits<SGVec4d>
-{
- static const Type type_tag = VEC4D;
- enum { Internal = 0 };
-};
}
}
return stream;
}
-template<>
-std::ostream& SGRawBase<SGVec3d>::printOn(std::ostream& stream) const;
-template<>
-std::ostream& SGRawBase<SGVec4d>::printOn(std::ostream& stream) const;
-
\f
/**
* The smart pointer that manage reference counting
#include <simgear/compiler.h>
-#include <stdlib.h> // atof() atoi()
+#include <stdlib.h> // atof() atoi()
#include <simgear/sg_inlines.h>
#include <simgear/debug/logstream.hxx>
#include "props.hxx"
#include "props_io.hxx"
+#include "vectorPropTemplates.hxx"
#include <iostream>
#include <fstream>
#include <string>
-#include <cstring> // strcmp()
+#include <cstring> // strcmp()
#include <vector>
#include <map>
#include <iostream>
-// working around MSVC weirdness with props.hxx and SGMathFwd
-#include <simgear/math/SGMath.hxx>
-
#include "props.hxx"
#include "props_io.hxx"
--- /dev/null
+// vectorPropTemplates.hxx -- Templates Requiring Vector Properties
+//
+// Separate header file for any templates requiring SGVecXX vector types.
+
+#ifndef __VECTORPROPTEMPLATES_HXX
+#define __VECTORPROPTEMPLATES_HXX
+
+#include "props.hxx"
+
+// The templates below depend on the full SGMath.hxx include. Forward
+// declarations (SGMathFwd.hxx) would be insufficient here (at least with MSVC).
+#include <simgear/math/SGMath.hxx>
+
+namespace simgear
+{
+
+// Extended properties
+template<>
+std::istream& readFrom<SGVec3d>(std::istream& stream, SGVec3d& result);
+template<>
+std::istream& readFrom<SGVec4d>(std::istream& stream, SGVec4d& result);
+
+namespace props
+{
+
+template<>
+struct PropertyTraits<SGVec3d>
+{
+ static const Type type_tag = VEC3D;
+ enum { Internal = 0 };
+};
+
+template<>
+struct PropertyTraits<SGVec4d>
+{
+ static const Type type_tag = VEC4D;
+ enum { Internal = 0 };
+};
+}
+}
+
+template<>
+std::ostream& SGRawBase<SGVec3d>::printOn(std::ostream& stream) const;
+template<>
+std::ostream& SGRawBase<SGVec4d>::printOn(std::ostream& stream) const;
+
+#endif // __VECTORPROPTEMPLATES_HXX
+
+// end of vectorPropTemplates.hxx
#include <simgear/scene/util/StateAttributeFactory.hxx>
#include <simgear/structure/OSGUtils.hxx>
#include <simgear/structure/SGExpression.hxx>
-
+#include <simgear/props/vectorPropTemplates.hxx>
namespace simgear
#include <simgear/scene/util/SGSceneFeatures.hxx>
#include <simgear/scene/util/StateAttributeFactory.hxx>
#include <simgear/structure/OSGUtils.hxx>
+#include <simgear/props/vectorPropTemplates.hxx>
namespace simgear
{
#include <simgear/misc/sgstream.hxx>
#include <simgear/scene/util/SGReaderWriterOptions.hxx>
#include <simgear/props/props_io.hxx>
+#include <simgear/props/vectorPropTemplates.hxx>
#include <simgear/scene/model/model.hxx>
#include <simgear/scene/util/RenderConstants.hxx>
#include <simgear/scene/util/StateAttributeFactory.hxx>
makeChild(propRoot, "inherits-from")->setStringValue(effect);
SGPropertyNode* paramProp = makeChild(propRoot, "parameters");
SGPropertyNode* materialProp = makeChild(paramProp, "material");
- makeChild(materialProp, "ambient")->setValue(SGVec4d(ambient));
+ makeChild(materialProp, "ambient")->setValue(SGVec4d(ambient));
makeChild(materialProp, "diffuse")->setValue(SGVec4d(diffuse));
makeChild(materialProp, "specular")->setValue(SGVec4d(specular));
makeChild(materialProp, "emissive")->setValue(SGVec4d(emission));
#include <osg/Geometry>
#include <osg/MatrixTransform>
+#include <simgear/props/vectorPropTemplates.hxx>
#include <simgear/scene/material/EffectGeode.hxx>
#include <simgear/scene/material/Technique.hxx>
#include <simgear/scene/material/Pass.hxx>