From 8ac18752b29da15d3c98768e1893e2aa813540dc Mon Sep 17 00:00:00 2001 From: Balleux Benjamin Date: Fri, 21 Apr 2017 15:59:54 +0200 Subject: [PATCH] Remove temp file --- src/ifcgeom/IfcGeomElement.h~RF5ff49ef.TMP | 198 --------------------- 1 file changed, 198 deletions(-) delete mode 100644 src/ifcgeom/IfcGeomElement.h~RF5ff49ef.TMP diff --git a/src/ifcgeom/IfcGeomElement.h~RF5ff49ef.TMP b/src/ifcgeom/IfcGeomElement.h~RF5ff49ef.TMP deleted file mode 100644 index 3a38905ea1..0000000000 --- a/src/ifcgeom/IfcGeomElement.h~RF5ff49ef.TMP +++ /dev/null @@ -1,198 +0,0 @@ -/******************************************************************************** - * * - * This file is part of IfcOpenShell. * - * * - * IfcOpenShell is free software: you can redistribute it and/or modify * - * it under the terms of the Lesser GNU General Public License as published by * - * the Free Software Foundation, either version 3.0 of the License, or * - * (at your option) any later version. * - * * - * IfcOpenShell is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * Lesser GNU General Public License for more details. * - * * - * You should have received a copy of the Lesser GNU General Public License * - * along with this program. If not, see . * - * * - ********************************************************************************/ - -#ifndef IFCGEOMELEMENT_H -#define IFCGEOMELEMENT_H - -#include -#include - -#include "../ifcparse/IfcGlobalId.h" - -#include "../ifcgeom/IfcGeomRepresentation.h" -#include "../ifcgeom/IfcGeomIteratorSettings.h" -#include "ifc_geom_api.h" - -namespace IfcGeom { - - template - class Matrix { - private: - std::vector

_data; - public: - Matrix(const ElementSettings& settings, const gp_Trsf& trsf) { - // Convert the gp_Trsf into a 4x3 Matrix - // Note that in case the CONVERT_BACK_UNITS setting is enabled - // the translation component of the matrix needs to be divided - // by the magnitude of the IFC model length unit because - // internally in IfcOpenShell everything is measured in meters. - for(int i = 1; i < 5; ++i) { - for (int j = 1; j < 4; ++j) { - const double trsf_value = trsf.Value(j,i); - const double matrix_value = i == 4 && settings.get(IteratorSettings::CONVERT_BACK_UNITS) - ? trsf_value / settings.unit_magnitude() - : trsf_value; - _data.push_back(static_cast

(matrix_value)); - } - } - } - const std::vector

& data() const { return _data; } - }; - - template - class Transformation { - private: - gp_Trsf trsf; - Matrix

_matrix; - public: - Transformation(const ElementSettings& settings, const gp_Trsf& trsf) - : trsf(trsf) - , _matrix(settings, trsf) - {} - const gp_Trsf& data() const { return trsf; } - const Matrix

& matrix() const { return _matrix; } - }; - - template - class Element { - private: - int _id; - int _parent_id; - std::string _name; - std::string _type; - std::string _guid; - std::string _context; - std::string _unique_id; - Transformation

_transformation; - IfcSchema::IfcProduct* product_; - Element

* _storey; - public: - int id() const { return _id; } - int parent_id() const { return _parent_id; } - const std::string& name() const { return _name; } - const std::string& type() const { return _type; } - const std::string& guid() const { return _guid; } - const std::string& context() const { return _context; } - const std::string& unique_id() const { return _unique_id; } - const Transformation

& transformation() const { return _transformation; } - IfcSchema::IfcProduct* product() const { return product_; } - const Element

* storey() const { return _storey; } - - Element(const ElementSettings& settings, int id, int parent_id, const std::string& name, const std::string& type, - const std::string& guid, const std::string& context, const gp_Trsf& trsf, IfcSchema::IfcProduct *product) - : _id(id), _parent_id(parent_id), _name(name), _type(type), _guid(guid), _context(context), _transformation(settings, trsf) - , product_(product) - { - std::ostringstream oss; - oss << "product-" << IfcParse::IfcGlobalId(guid).formatted(); - if (!_context.empty()) { - std::string ctx = _context; - std::transform(ctx.begin(), ctx.end(), ctx.begin(), ::tolower); - std::replace(ctx.begin(), ctx.end(), ' ', '-'); - oss << "-" << ctx; - } - _unique_id = oss.str(); - - _storey = NULL; - // If we want to retrieve the storey hierarchy - if (settings.get(IteratorSettings::SEARCH_FLOOR)) - { - if (_parent_id != -1) - { - bool hasParent = true; - try { _storey = context_iterator.getObject(_parent_id); } - catch (std::exception e) - { - hasParent = false; - } - - while (_storey != NULL && parent_object->type() != "IfcBuildingStorey" && hasParent) - { - try { parent_object = context_iterator.getObject(parent_object->parent_id()); } - catch (std::exception e) - { - hasParent = false; - } - - hasParent = hasParent && parent_object->parent_id() != 1; - } - } - } - } - virtual ~Element() {} - }; - - template - class BRepElement : public Element

{ - private: - boost::shared_ptr _geometry; - public: - const boost::shared_ptr& geometry_pointer() const { return _geometry; } - const Representation::BRep& geometry() const { return *_geometry; } - BRepElement(int id, int parent_id, const std::string& name, const std::string& type, const std::string& guid, - const std::string& context, const gp_Trsf& trsf, const boost::shared_ptr& geometry, - IfcSchema::IfcProduct* product) - : Element

(geometry->settings(),id,parent_id,name,type,guid,context,trsf, product) - , _geometry(geometry) - {} - private: - BRepElement(const BRepElement& other); - BRepElement& operator=(const BRepElement& other); - }; - - template - class TriangulationElement : public Element

{ - private: - boost::shared_ptr< Representation::Triangulation

> _geometry; - public: - const Representation::Triangulation

& geometry() const { return *_geometry; } - const boost::shared_ptr< Representation::Triangulation

>& geometry_pointer() const { return _geometry; } - TriangulationElement(const BRepElement

& shape_model) - : Element

(shape_model) - , _geometry(boost::shared_ptr >(new Representation::Triangulation

(shape_model.geometry()))) - {} - TriangulationElement(const Element

& element, const boost::shared_ptr >& geometry) - : Element

(element) - , _geometry(geometry) - {} - private: - TriangulationElement(const TriangulationElement& other); - TriangulationElement& operator=(const TriangulationElement& other); - }; - - template - class SerializedElement : public Element

{ - private: - Representation::Serialization* _geometry; - public: - const Representation::Serialization& geometry() const { return *_geometry; } - SerializedElement(const BRepElement

& shape_model) - : Element

(shape_model) - , _geometry(new Representation::Serialization(shape_model.geometry())) - {} - virtual ~SerializedElement() { - delete _geometry; - } - private: - SerializedElement(const SerializedElement& other); - SerializedElement& operator=(const SerializedElement& other); - }; -} - -#endif \ No newline at end of file