Files
IfcOpenShell/src/ifcgeom_schema_agnostic/IteratorImplementation.h
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

82 lines
3.3 KiB
C++
Raw Normal View History

/********************************************************************************
* *
* 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 <http://www.gnu.org/licenses/>. *
* *
********************************************************************************/
2017-12-19 20:24:00 +01:00
#ifndef ITERATOR_IMPLEMENTATION_H
#define ITERATOR_IMPLEMENTATION_H
2022-06-15 13:41:13 +02:00
#include "../ifcparse/IfcFile.h"
#include "../ifcgeom_schema_agnostic/IfcGeomFilter.h"
#include "../ifcgeom_schema_agnostic/GeometrySerializer.h"
2022-06-15 13:41:13 +02:00
#include "../ifcgeom_schema_agnostic/IfcGeomIteratorSettings.h"
2017-12-19 20:24:00 +01:00
#include <gp_XYZ.hxx>
2017-12-19 20:24:00 +01:00
#include <boost/function.hpp>
#include <map>
#include <string>
2017-12-20 11:10:27 +01:00
namespace IfcGeom {
class IteratorImplementation;
class Element;
class BRepElement;
}
2017-12-19 20:24:00 +01:00
2021-07-11 15:00:59 +02:00
typedef boost::function4<IfcGeom::IteratorImplementation*, const IfcGeom::IteratorSettings&, IfcParse::IfcFile*, const std::vector<IfcGeom::filter_t>&, int> iterator_fn;
2017-12-19 20:24:00 +01:00
class IFC_GEOM_API IteratorFactoryImplementation : public std::map<std::string, iterator_fn> {
2017-12-19 20:24:00 +01:00
public:
IteratorFactoryImplementation();
2021-07-11 15:00:59 +02:00
void bind(const std::string& schema_name, iterator_fn fn);
IfcGeom::IteratorImplementation* construct(const std::string& schema_name, const IfcGeom::IteratorSettings&, IfcParse::IfcFile*, const std::vector<IfcGeom::filter_t>&, int);
2017-12-19 20:24:00 +01:00
};
2022-04-26 11:46:21 +02:00
IFC_GEOM_API IteratorFactoryImplementation& iterator_implementations();
2017-12-19 20:24:00 +01:00
2017-12-20 11:10:27 +01:00
namespace IfcGeom {
2017-12-19 20:24:00 +01:00
2017-12-20 11:10:27 +01:00
class IteratorImplementation {
2021-10-08 15:38:46 +02:00
protected:
GeometrySerializer* cache_ = nullptr;
2017-12-20 11:10:27 +01:00
public:
void set_cache(GeometrySerializer* cache) { cache_ = cache; }
2021-10-08 15:38:46 +02:00
2017-12-20 11:10:27 +01:00
virtual bool initialize() = 0;
2020-02-12 11:38:08 +01:00
virtual void compute_bounds(bool with_geometry) = 0;
virtual const gp_XYZ& bounds_min() const = 0;
virtual const gp_XYZ& bounds_max() const = 0;
2017-12-20 11:10:27 +01:00
virtual int progress() const = 0;
virtual const std::string& getUnitName() const = 0;
virtual double getUnitMagnitude() const = 0;
virtual IfcParse::IfcFile* file() const = 0;
virtual IfcUtil::IfcBaseClass* next() = 0;
2021-07-11 15:00:59 +02:00
virtual Element* get() = 0;
virtual BRepElement* get_native() = 0;
virtual const Element* get_object(int id) = 0;
2017-12-20 11:10:27 +01:00
virtual IfcUtil::IfcBaseClass* create() = 0;
virtual ~IteratorImplementation() {}
2017-12-20 11:10:27 +01:00
};
}
2017-12-19 20:24:00 +01:00
#endif