From 5270710fc235665591b22246d762ab19b2146a4e Mon Sep 17 00:00:00 2001 From: aothms Date: Mon, 25 Jan 2016 14:44:35 +0100 Subject: [PATCH] Use vanilla C arrays instead of std::tr::array Fixes https://github.com/IfcOpenShell/IfcOpenShell/issues/17 --- src/ifcgeom/IfcGeomRenderStyles.cpp | 8 ++++---- src/ifcgeom/IfcGeomRenderStyles.h | 12 +----------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/ifcgeom/IfcGeomRenderStyles.cpp b/src/ifcgeom/IfcGeomRenderStyles.cpp index f8730391d6..2d9da9a042 100644 --- a/src/ifcgeom/IfcGeomRenderStyles.cpp +++ b/src/ifcgeom/IfcGeomRenderStyles.cpp @@ -21,7 +21,7 @@ #include "IfcGeom.h" -bool process_colour(IfcSchema::IfcColourRgb* colour, std::tr1::array& rgb) { +bool process_colour(IfcSchema::IfcColourRgb* colour, double* rgb) { if (colour != 0) { rgb[0] = colour->Red(); rgb[1] = colour->Green(); @@ -30,7 +30,7 @@ bool process_colour(IfcSchema::IfcColourRgb* colour, std::tr1::array& return colour != 0; } -bool process_colour(IfcSchema::IfcNormalisedRatioMeasure* factor, std::tr1::array& rgb) { +bool process_colour(IfcSchema::IfcNormalisedRatioMeasure* factor, double* rgb) { if (factor != 0) { const double f = *factor; rgb[0] = rgb[1] = rgb[2] = f; @@ -38,7 +38,7 @@ bool process_colour(IfcSchema::IfcNormalisedRatioMeasure* factor, std::tr1::arra return factor != 0; } -bool process_colour(IfcSchema::IfcColourOrFactor* colour_or_factor, std::tr1::array& rgb) { +bool process_colour(IfcSchema::IfcColourOrFactor* colour_or_factor, double* rgb) { if (colour_or_factor == 0) { return false; } else if (colour_or_factor->is(IfcSchema::Type::IfcColourRgb)) { @@ -66,7 +66,7 @@ const IfcGeom::SurfaceStyle* IfcGeom::Kernel::get_style(const IfcSchema::IfcRepr } else { surface_style = SurfaceStyle(surface_style_id); } - std::tr1::array rgb; + double rgb[3]; if (process_colour(shading_styles.second->SurfaceColour(), rgb)) { surface_style.Diffuse().reset(SurfaceStyle::ColorComponent(rgb[0], rgb[1], rgb[2])); } diff --git a/src/ifcgeom/IfcGeomRenderStyles.h b/src/ifcgeom/IfcGeomRenderStyles.h index cd8d771246..d84b85d737 100644 --- a/src/ifcgeom/IfcGeomRenderStyles.h +++ b/src/ifcgeom/IfcGeomRenderStyles.h @@ -20,16 +20,6 @@ #ifndef IFCGEOMRENDERSTYLES_H #define IFCGEOMRENDERSTYLES_H -#ifdef __GNUC__ -#include -#else -#if _MSC_VER < 1600 -#include -#else -#include -#endif -#endif - #ifdef USE_IFC4 #include "../ifcparse/Ifc4.h" #else @@ -41,7 +31,7 @@ namespace IfcGeom { public: class ColorComponent { private: - std::tr1::array data; + double data[3]; public: ColorComponent(double r, double g, double b) { data[0] = r; data[1] = g; data[2] = b;