mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 19:16:24 +00:00
Use vanilla C arrays instead of std::tr::array
Fixes https://github.com/IfcOpenShell/IfcOpenShell/issues/17
This commit is contained in:
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#include "IfcGeom.h"
|
#include "IfcGeom.h"
|
||||||
|
|
||||||
bool process_colour(IfcSchema::IfcColourRgb* colour, std::tr1::array<double, 3>& rgb) {
|
bool process_colour(IfcSchema::IfcColourRgb* colour, double* rgb) {
|
||||||
if (colour != 0) {
|
if (colour != 0) {
|
||||||
rgb[0] = colour->Red();
|
rgb[0] = colour->Red();
|
||||||
rgb[1] = colour->Green();
|
rgb[1] = colour->Green();
|
||||||
@@ -30,7 +30,7 @@ bool process_colour(IfcSchema::IfcColourRgb* colour, std::tr1::array<double, 3>&
|
|||||||
return colour != 0;
|
return colour != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool process_colour(IfcSchema::IfcNormalisedRatioMeasure* factor, std::tr1::array<double, 3>& rgb) {
|
bool process_colour(IfcSchema::IfcNormalisedRatioMeasure* factor, double* rgb) {
|
||||||
if (factor != 0) {
|
if (factor != 0) {
|
||||||
const double f = *factor;
|
const double f = *factor;
|
||||||
rgb[0] = rgb[1] = rgb[2] = f;
|
rgb[0] = rgb[1] = rgb[2] = f;
|
||||||
@@ -38,7 +38,7 @@ bool process_colour(IfcSchema::IfcNormalisedRatioMeasure* factor, std::tr1::arra
|
|||||||
return factor != 0;
|
return factor != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool process_colour(IfcSchema::IfcColourOrFactor* colour_or_factor, std::tr1::array<double, 3>& rgb) {
|
bool process_colour(IfcSchema::IfcColourOrFactor* colour_or_factor, double* rgb) {
|
||||||
if (colour_or_factor == 0) {
|
if (colour_or_factor == 0) {
|
||||||
return false;
|
return false;
|
||||||
} else if (colour_or_factor->is(IfcSchema::Type::IfcColourRgb)) {
|
} else if (colour_or_factor->is(IfcSchema::Type::IfcColourRgb)) {
|
||||||
@@ -66,7 +66,7 @@ const IfcGeom::SurfaceStyle* IfcGeom::Kernel::get_style(const IfcSchema::IfcRepr
|
|||||||
} else {
|
} else {
|
||||||
surface_style = SurfaceStyle(surface_style_id);
|
surface_style = SurfaceStyle(surface_style_id);
|
||||||
}
|
}
|
||||||
std::tr1::array<double, 3> rgb;
|
double rgb[3];
|
||||||
if (process_colour(shading_styles.second->SurfaceColour(), rgb)) {
|
if (process_colour(shading_styles.second->SurfaceColour(), rgb)) {
|
||||||
surface_style.Diffuse().reset(SurfaceStyle::ColorComponent(rgb[0], rgb[1], rgb[2]));
|
surface_style.Diffuse().reset(SurfaceStyle::ColorComponent(rgb[0], rgb[1], rgb[2]));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,16 +20,6 @@
|
|||||||
#ifndef IFCGEOMRENDERSTYLES_H
|
#ifndef IFCGEOMRENDERSTYLES_H
|
||||||
#define IFCGEOMRENDERSTYLES_H
|
#define IFCGEOMRENDERSTYLES_H
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#include <tr1/array>
|
|
||||||
#else
|
|
||||||
#if _MSC_VER < 1600
|
|
||||||
#include <boost/tr1/array.hpp>
|
|
||||||
#else
|
|
||||||
#include <array>
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_IFC4
|
#ifdef USE_IFC4
|
||||||
#include "../ifcparse/Ifc4.h"
|
#include "../ifcparse/Ifc4.h"
|
||||||
#else
|
#else
|
||||||
@@ -41,7 +31,7 @@ namespace IfcGeom {
|
|||||||
public:
|
public:
|
||||||
class ColorComponent {
|
class ColorComponent {
|
||||||
private:
|
private:
|
||||||
std::tr1::array<double, 3> data;
|
double data[3];
|
||||||
public:
|
public:
|
||||||
ColorComponent(double r, double g, double b) {
|
ColorComponent(double r, double g, double b) {
|
||||||
data[0] = r; data[1] = g; data[2] = b;
|
data[0] = r; data[1] = g; data[2] = b;
|
||||||
|
|||||||
Reference in New Issue
Block a user