Files
IfcOpenShell/src/ifcgeom/abstract_mapping.h
T

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

56 lines
1.5 KiB
C++
Raw Normal View History

2019-08-16 17:40:13 +02:00
#ifndef ABSTRACT_MAPPING_H
#define ABSTRACT_MAPPING_H
2019-08-04 09:36:31 +02:00
#include "../ifcparse/IfcBaseClass.h"
2019-08-16 17:40:13 +02:00
#include "../ifcparse/IfcEntityList.h"
2019-08-04 09:36:31 +02:00
#include "../ifcgeom/taxonomy.h"
2019-08-16 17:40:13 +02:00
#include "../ifcgeom/settings.h"
#include <boost/function.hpp>
#include <map>
#include <string>
2019-08-04 09:36:31 +02:00
namespace ifcopenshell {
namespace geometry {
2019-08-16 17:40:13 +02:00
struct geometry_conversion_task {
int index;
IfcUtil::IfcBaseEntity* representation;
IfcEntityList::ptr products;
};
typedef boost::function<bool(IfcUtil::IfcBaseEntity*)> filter_t;
2019-08-04 09:36:31 +02:00
class abstract_mapping {
2019-10-06 19:03:31 +02:00
protected:
settings settings_;
2019-08-04 09:36:31 +02:00
public:
2019-10-06 19:03:31 +02:00
abstract_mapping(settings& s) : settings_(s) {}
2019-08-04 09:36:31 +02:00
virtual ifcopenshell::geometry::taxonomy::item* map(const IfcUtil::IfcBaseClass*) = 0;
2019-08-16 17:40:13 +02:00
virtual void get_representations(std::vector<geometry_conversion_task>& tasks, std::vector<filter_t>& filters, settings& s) = 0;
virtual IfcUtil::IfcBaseEntity* get_decomposing_entity(IfcUtil::IfcBaseEntity* product, bool include_openings = true) = 0;
2019-08-18 14:31:22 +02:00
virtual std::map<std::string, IfcUtil::IfcBaseEntity*> get_layers(IfcUtil::IfcBaseEntity*) = 0;
2019-08-04 09:36:31 +02:00
};
2019-08-16 17:40:13 +02:00
namespace impl {
2019-10-06 19:03:31 +02:00
typedef boost::function2<abstract_mapping*, IfcParse::IfcFile*, settings&> mapping_fn;
2019-08-16 17:40:13 +02:00
class MappingFactoryImplementation : public std::map<std::string, mapping_fn> {
public:
MappingFactoryImplementation();
void bind(const std::string& schema_name, mapping_fn);
2019-10-06 19:03:31 +02:00
abstract_mapping* construct(IfcParse::IfcFile*, settings&);
2019-08-16 17:40:13 +02:00
};
MappingFactoryImplementation& mapping_implementations();
}
2019-08-04 09:36:31 +02:00
}
2019-08-16 17:40:13 +02:00
}
#endif