mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-14 19:34:34 +00:00
Work on python wrapper
This commit is contained in:
@@ -18,7 +18,9 @@
|
||||
********************************************************************************/
|
||||
|
||||
#include "IfcLogger.h"
|
||||
|
||||
#include "../ifcparse/IfcException.h"
|
||||
#include "../ifcparse/Argument.h"
|
||||
|
||||
#include <boost/algorithm/string/replace.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#ifndef IFCLOGGER_H
|
||||
#define IFCLOGGER_H
|
||||
|
||||
#include "../ifcparse/IfcBaseClass.h"
|
||||
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -27,12 +29,6 @@
|
||||
#include <algorithm>
|
||||
#include <exception>
|
||||
|
||||
#ifdef USE_IFC4
|
||||
#include "../ifcparse/Ifc4.h"
|
||||
#else
|
||||
#include "../ifcparse/Ifc2x3.h"
|
||||
#endif
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
#include "ifc_parse_api.h"
|
||||
|
||||
@@ -47,12 +47,6 @@
|
||||
#include "../ifcparse/IfcLogger.h"
|
||||
#include "../ifcparse/Argument.h"
|
||||
|
||||
#ifdef USE_IFC4
|
||||
#include "../ifcparse/Ifc4.h"
|
||||
#else
|
||||
#include "../ifcparse/Ifc2x3.h"
|
||||
#endif
|
||||
|
||||
#include "../ifcparse/IfcSpfStream.h"
|
||||
|
||||
namespace IfcParse {
|
||||
|
||||
@@ -44,7 +44,9 @@ IfcParse::schema_definition::schema_definition(const std::string& name, const st
|
||||
, factory_(factory)
|
||||
{
|
||||
std::sort(declarations_.begin(), declarations_.end(), declaration_by_index_sort());
|
||||
for (std::vector<const declaration*>::const_iterator it = declarations_.begin(); it != declarations_.end(); ++it) {
|
||||
for (std::vector<const declaration*>::iterator it = declarations_.begin(); it != declarations_.end(); ++it) {
|
||||
(**it).schema_ = this;
|
||||
|
||||
if ((**it).as_type_declaration()) type_declarations_.push_back((**it).as_type_declaration());
|
||||
if ((**it).as_select_type()) select_types_.push_back((**it).as_select_type());
|
||||
if ((**it).as_enumeration_type()) enumeration_types_.push_back((**it).as_enumeration_type());
|
||||
|
||||
@@ -55,6 +55,8 @@ namespace IfcParse {
|
||||
class simple_type;
|
||||
class aggregation_type;
|
||||
|
||||
class schema_definition;
|
||||
|
||||
class parameter_type {
|
||||
public:
|
||||
virtual const named_type* as_named_type() const { return static_cast<named_type*>(0); }
|
||||
@@ -118,19 +120,23 @@ namespace IfcParse {
|
||||
};
|
||||
|
||||
class declaration {
|
||||
friend class schema_definition;
|
||||
|
||||
protected:
|
||||
std::string name_, name_lower_;
|
||||
int index_in_schema_;
|
||||
mutable const schema_definition* schema_;
|
||||
|
||||
public:
|
||||
declaration(const std::string& name, int index_in_schema)
|
||||
: name_(name)
|
||||
, name_lower_(boost::to_lower_copy(name))
|
||||
, index_in_schema_(index_in_schema)
|
||||
, schema_(0)
|
||||
{}
|
||||
|
||||
std::string name() const { return name_; }
|
||||
std::string name_lc() const { return name_lower_; }
|
||||
const std::string& name() const { return name_; }
|
||||
const std::string& name_lc() const { return name_lower_; }
|
||||
|
||||
virtual const type_declaration* as_type_declaration() const { return static_cast<type_declaration*>(0); }
|
||||
virtual const select_type* as_select_type() const { return static_cast<select_type*>(0); }
|
||||
@@ -143,6 +149,8 @@ namespace IfcParse {
|
||||
int index_in_schema() const { return index_in_schema_; }
|
||||
|
||||
int type() const { return index_in_schema_; }
|
||||
|
||||
const schema_definition* schema() const { return schema_; }
|
||||
};
|
||||
|
||||
class type_declaration : public declaration {
|
||||
|
||||
Reference in New Issue
Block a user