mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 06:39:13 +00:00
Rewrite IfcFile::AddEntity() not to rely on exceptions, as suggested by ch0kee.
This commit is contained in:
+81
-11
@@ -346,6 +346,27 @@ bool TokenFunc::isEnumeration(const Token& t) {
|
|||||||
bool TokenFunc::isDatatype(const Token& t) {
|
bool TokenFunc::isDatatype(const Token& t) {
|
||||||
return ! isOperator(t) && startsWith(t, 'I');
|
return ! isOperator(t) && startsWith(t, 'I');
|
||||||
}
|
}
|
||||||
|
bool TokenFunc::isInt(const Token& t) {
|
||||||
|
if (isOperator(t)) return false;
|
||||||
|
const std::string str = asString(t);
|
||||||
|
const char* start = str.c_str();
|
||||||
|
char* end;
|
||||||
|
long result = strtol(start,&end,10);
|
||||||
|
return ((end - start) == str.length());
|
||||||
|
}
|
||||||
|
bool TokenFunc::isBool(const Token& t) {
|
||||||
|
if (!isEnumeration(t)) return false;
|
||||||
|
const std::string str = asString(t);
|
||||||
|
return str == "T" || str == "F";
|
||||||
|
}
|
||||||
|
bool TokenFunc::isFloat(const Token& t) {
|
||||||
|
if (isOperator(t)) return false;
|
||||||
|
const std::string str = asString(t);
|
||||||
|
const char* start = str.c_str();
|
||||||
|
char* end;
|
||||||
|
double result = strtod(start,&end);
|
||||||
|
return ((end - start) == str.length());
|
||||||
|
}
|
||||||
int TokenFunc::asInt(const Token& t) {
|
int TokenFunc::asInt(const Token& t) {
|
||||||
const std::string str = asString(t);
|
const std::string str = asString(t);
|
||||||
// In case of an ENTITY_INSTANCE_NAME skip the leading #
|
// In case of an ENTITY_INSTANCE_NAME skip the leading #
|
||||||
@@ -415,6 +436,22 @@ ArgumentList::ArgumentList(Tokens* t, std::vector<unsigned int>& ids) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IfcUtil::ArgumentType ArgumentList::type() const {
|
||||||
|
if (list.empty()) return IfcUtil::Argument_UNKNOWN;
|
||||||
|
const IfcUtil::ArgumentType elem_type = list[0]->type();
|
||||||
|
if (elem_type == IfcUtil::Argument_INT) {
|
||||||
|
return IfcUtil::Argument_VECTOR_INT;
|
||||||
|
} else if (elem_type == IfcUtil::Argument_DOUBLE) {
|
||||||
|
return IfcUtil::Argument_VECTOR_DOUBLE;
|
||||||
|
} else if (elem_type == IfcUtil::Argument_STRING) {
|
||||||
|
return IfcUtil::Argument_VECTOR_STRING;
|
||||||
|
} else if (elem_type == IfcUtil::Argument_ENTITY) {
|
||||||
|
return IfcUtil::Argument_ENTITY_LIST;
|
||||||
|
} else {
|
||||||
|
return IfcUtil::Argument_UNKNOWN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ArgumentList::Push(Argument* l) {
|
void ArgumentList::Push(Argument* l) {
|
||||||
list.push_back(l);
|
list.push_back(l);
|
||||||
}
|
}
|
||||||
@@ -499,6 +536,24 @@ ArgumentList::~ArgumentList() {
|
|||||||
list.clear();
|
list.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IfcUtil::ArgumentType TokenArgument::type() const {
|
||||||
|
if (TokenFunc::isInt(token)) {
|
||||||
|
return IfcUtil::Argument_INT;
|
||||||
|
} else if (TokenFunc::isBool(token)) {
|
||||||
|
return IfcUtil::Argument_BOOL;
|
||||||
|
} else if (TokenFunc::isFloat(token)) {
|
||||||
|
return IfcUtil::Argument_DOUBLE;
|
||||||
|
} else if (TokenFunc::isString(token)) {
|
||||||
|
return IfcUtil::Argument_STRING;
|
||||||
|
} else if (TokenFunc::isEnumeration(token)) {
|
||||||
|
return IfcUtil::Argument_ENUMERATION;
|
||||||
|
} else if (TokenFunc::isIdentifier(token)) {
|
||||||
|
return IfcUtil::Argument_ENTITY;
|
||||||
|
} else {
|
||||||
|
return IfcUtil::Argument_UNKNOWN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Functions for casting the TokenArgument to other types
|
// Functions for casting the TokenArgument to other types
|
||||||
//
|
//
|
||||||
@@ -522,6 +577,11 @@ std::string TokenArgument::toString(bool upper) const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool TokenArgument::isNull() const { return TokenFunc::isOperator(token,'$'); }
|
bool TokenArgument::isNull() const { return TokenFunc::isOperator(token,'$'); }
|
||||||
|
|
||||||
|
IfcUtil::ArgumentType EntityArgument::type() const {
|
||||||
|
return IfcUtil::Argument_ENTITY;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Functions for casting the EntityArgument to other types
|
// Functions for casting the EntityArgument to other types
|
||||||
//
|
//
|
||||||
@@ -679,8 +739,8 @@ IfcEntityList::ptr Entity::getInverse(IfcSchema::Type::Enum c, int i, const std:
|
|||||||
bool Entity::is(IfcSchema::Type::Enum v) const { return _type == v; }
|
bool Entity::is(IfcSchema::Type::Enum v) const { return _type == v; }
|
||||||
unsigned int Entity::id() { return _id; }
|
unsigned int Entity::id() { return _id; }
|
||||||
|
|
||||||
bool Entity::isWritable() {
|
IfcWrite::IfcWritableEntity* Entity::isWritable() {
|
||||||
return false;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
IfcFile::IfcFile() {
|
IfcFile::IfcFile() {
|
||||||
@@ -822,7 +882,7 @@ void IfcFile::AddEntity(IfcUtil::IfcBaseClass* entity) {
|
|||||||
// For newly created entities ensure a valid ENTITY_INSTANCE_NAME is set
|
// For newly created entities ensure a valid ENTITY_INSTANCE_NAME is set
|
||||||
if ( entity->entity->isWritable() ) {
|
if ( entity->entity->isWritable() ) {
|
||||||
if ( ! entity->entity->file ) entity->entity->file = this;
|
if ( ! entity->entity->file ) entity->entity->file = this;
|
||||||
new_id = ((IfcWrite::IfcWritableEntity*)(entity->entity))->setId();
|
new_id = entity->entity->isWritable()->setId();
|
||||||
} else {
|
} else {
|
||||||
// TODO: Detect and fix ENTITY_INSTANCE_NAME collisions
|
// TODO: Detect and fix ENTITY_INSTANCE_NAME collisions
|
||||||
new_id = entity->entity->id();
|
new_id = entity->entity->id();
|
||||||
@@ -837,22 +897,32 @@ void IfcFile::AddEntity(IfcUtil::IfcBaseClass* entity) {
|
|||||||
unsigned arg_count = entity->entity->getArgumentCount();
|
unsigned arg_count = entity->entity->getArgumentCount();
|
||||||
for (unsigned i = 0; i < arg_count; ++i) {
|
for (unsigned i = 0; i < arg_count; ++i) {
|
||||||
Argument* arg = entity->entity->getArgument(i);
|
Argument* arg = entity->entity->getArgument(i);
|
||||||
|
|
||||||
|
// Create a flat list of entity instances referenced by the instance that is being added
|
||||||
IfcEntityList::ptr entity_attributes(new IfcEntityList);
|
IfcEntityList::ptr entity_attributes(new IfcEntityList);
|
||||||
try {
|
if (arg->type() == IfcUtil::Argument_ENTITY) {
|
||||||
IfcUtil::IfcBaseClass* entity_attribute = *arg;
|
IfcUtil::IfcBaseClass* entity_attribute = *arg;
|
||||||
entity_attributes->push(entity_attribute);
|
entity_attributes->push(entity_attribute);
|
||||||
} catch(IfcParse::IfcException&) {
|
} else if (arg->type() == IfcUtil::Argument_ENTITY_LIST) {
|
||||||
try {
|
IfcEntityList::ptr entity_list_attribute = *arg;
|
||||||
IfcEntityList::ptr entity_list_attribute = *arg;
|
entity_attributes->push(entity_list_attribute);
|
||||||
entity_attributes->push(entity_list_attribute);
|
} else if (arg->type() == IfcUtil::Argument_ENTITY_LIST_LIST) {
|
||||||
} catch(IfcParse::IfcException&) {}
|
IfcEntityListList::ptr entity_list_attribute = *arg;
|
||||||
|
for (IfcEntityListList::outer_it it = entity_list_attribute->begin(); it != entity_list_attribute->end(); ++it) {
|
||||||
|
for (IfcEntityListList::inner_it jt = it->begin(); jt != it->end(); ++jt) {
|
||||||
|
entity_attributes->push(*jt);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (IfcEntityList::it it = entity_attributes->begin(); it != entity_attributes->end(); ++it) {
|
for (IfcEntityList::it it = entity_attributes->begin(); it != entity_attributes->end(); ++it) {
|
||||||
IfcUtil::IfcBaseClass* entity_attribute = *it;
|
IfcUtil::IfcBaseClass* entity_attribute = *it;
|
||||||
try {
|
try {
|
||||||
if (entity_attribute->entity->isWritable()) {
|
if (entity_attribute->entity->isWritable()) {
|
||||||
if ( ! entity_attribute->entity->file ) entity_attribute->entity->file = this;
|
if ( ! entity_attribute->entity->file ) {
|
||||||
((IfcWrite::IfcWritableEntity*)(entity_attribute->entity))->setId();
|
entity_attribute->entity->file = this;
|
||||||
|
}
|
||||||
|
entity_attribute->entity->isWritable()->setId();
|
||||||
}
|
}
|
||||||
unsigned entity_attribute_id = entity_attribute->entity->id();
|
unsigned entity_attribute_id = entity_attribute->entity->id();
|
||||||
IfcEntityList::ptr refs = EntitiesByReference(entity_attribute_id);
|
IfcEntityList::ptr refs = EntitiesByReference(entity_attribute_id);
|
||||||
|
|||||||
+18
-6
@@ -69,12 +69,18 @@ namespace IfcParse {
|
|||||||
static bool isString(const Token& t);
|
static bool isString(const Token& t);
|
||||||
/// Returns whether the token can be interpreted as an identifier
|
/// Returns whether the token can be interpreted as an identifier
|
||||||
static bool isIdentifier(const Token& t);
|
static bool isIdentifier(const Token& t);
|
||||||
/// Returns whether the token can be interpreted as an syntactical operator
|
/// Returns whether the token can be interpreted as a syntactical operator
|
||||||
static bool isOperator(const Token& t, char op = 0);
|
static bool isOperator(const Token& t, char op = 0);
|
||||||
/// Returns whether the token can be interpreted as an enumerated value
|
/// Returns whether the token can be interpreted as an enumerated value
|
||||||
static bool isEnumeration(const Token& t);
|
static bool isEnumeration(const Token& t);
|
||||||
/// Returns whether the token can be interpreted as an datatype name
|
/// Returns whether the token can be interpreted as a datatype name
|
||||||
static bool isDatatype(const Token& t);
|
static bool isDatatype(const Token& t);
|
||||||
|
/// Returns whether the token can be interpreted as an integer
|
||||||
|
static bool isInt(const Token& t);
|
||||||
|
/// Returns whether the token can be interpreted as a boolean
|
||||||
|
static bool isBool(const Token& t);
|
||||||
|
/// Returns whether the token can be interpreted as a floating point number
|
||||||
|
static bool isFloat(const Token& t);
|
||||||
/// Returns the token interpreted as an integer
|
/// Returns the token interpreted as an integer
|
||||||
static int asInt(const Token& t);
|
static int asInt(const Token& t);
|
||||||
/// Returns the token interpreted as an boolean (.T. or .F.)
|
/// Returns the token interpreted as an boolean (.T. or .F.)
|
||||||
@@ -120,6 +126,9 @@ namespace IfcParse {
|
|||||||
public:
|
public:
|
||||||
ArgumentList(Tokens* t, std::vector<unsigned int>& ids);
|
ArgumentList(Tokens* t, std::vector<unsigned int>& ids);
|
||||||
~ArgumentList();
|
~ArgumentList();
|
||||||
|
|
||||||
|
IfcUtil::ArgumentType type() const;
|
||||||
|
|
||||||
operator int() const;
|
operator int() const;
|
||||||
operator bool() const;
|
operator bool() const;
|
||||||
operator double() const;
|
operator double() const;
|
||||||
@@ -128,7 +137,6 @@ namespace IfcParse {
|
|||||||
operator std::vector<int>() const;
|
operator std::vector<int>() const;
|
||||||
operator std::vector<std::string>() const;
|
operator std::vector<std::string>() const;
|
||||||
operator IfcUtil::IfcBaseClass*() const;
|
operator IfcUtil::IfcBaseClass*() const;
|
||||||
//operator IfcUtil::IfcAbstractSelect::ptr() const;
|
|
||||||
operator IfcEntityList::ptr() const;
|
operator IfcEntityList::ptr() const;
|
||||||
operator IfcEntityListList::ptr() const;
|
operator IfcEntityListList::ptr() const;
|
||||||
unsigned int Size() const;
|
unsigned int Size() const;
|
||||||
@@ -146,6 +154,9 @@ namespace IfcParse {
|
|||||||
public:
|
public:
|
||||||
Token token;
|
Token token;
|
||||||
TokenArgument(const Token& t);
|
TokenArgument(const Token& t);
|
||||||
|
|
||||||
|
IfcUtil::ArgumentType type() const;
|
||||||
|
|
||||||
operator int() const;
|
operator int() const;
|
||||||
operator bool() const;
|
operator bool() const;
|
||||||
operator double() const;
|
operator double() const;
|
||||||
@@ -154,7 +165,6 @@ namespace IfcParse {
|
|||||||
operator std::vector<int>() const;
|
operator std::vector<int>() const;
|
||||||
operator std::vector<std::string>() const;
|
operator std::vector<std::string>() const;
|
||||||
operator IfcUtil::IfcBaseClass*() const;
|
operator IfcUtil::IfcBaseClass*() const;
|
||||||
//operator IfcUtil::IfcAbstractSelect::ptr() const;
|
|
||||||
operator IfcEntityList::ptr() const;
|
operator IfcEntityList::ptr() const;
|
||||||
operator IfcEntityListList::ptr() const;
|
operator IfcEntityListList::ptr() const;
|
||||||
unsigned int Size() const;
|
unsigned int Size() const;
|
||||||
@@ -172,6 +182,9 @@ namespace IfcParse {
|
|||||||
public:
|
public:
|
||||||
EntityArgument(IfcSchema::Type::Enum ty, const Token& t);
|
EntityArgument(IfcSchema::Type::Enum ty, const Token& t);
|
||||||
~EntityArgument();
|
~EntityArgument();
|
||||||
|
|
||||||
|
IfcUtil::ArgumentType type() const;
|
||||||
|
|
||||||
operator int() const;
|
operator int() const;
|
||||||
operator bool() const;
|
operator bool() const;
|
||||||
operator double() const;
|
operator double() const;
|
||||||
@@ -180,7 +193,6 @@ namespace IfcParse {
|
|||||||
operator std::vector<int>() const;
|
operator std::vector<int>() const;
|
||||||
operator std::vector<std::string>() const;
|
operator std::vector<std::string>() const;
|
||||||
operator IfcUtil::IfcBaseClass*() const;
|
operator IfcUtil::IfcBaseClass*() const;
|
||||||
//operator IfcUtil::IfcAbstractSelect::ptr() const;
|
|
||||||
operator IfcEntityList::ptr() const;
|
operator IfcEntityList::ptr() const;
|
||||||
operator IfcEntityListList::ptr() const;
|
operator IfcEntityListList::ptr() const;
|
||||||
unsigned int Size() const;
|
unsigned int Size() const;
|
||||||
@@ -214,7 +226,7 @@ namespace IfcParse {
|
|||||||
IfcSchema::Type::Enum type() const;
|
IfcSchema::Type::Enum type() const;
|
||||||
bool is(IfcSchema::Type::Enum v) const;
|
bool is(IfcSchema::Type::Enum v) const;
|
||||||
unsigned int id();
|
unsigned int id();
|
||||||
bool isWritable();
|
IfcWrite::IfcWritableEntity* isWritable();
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::map<IfcSchema::Type::Enum, IfcEntityList::ptr> MapEntitiesByType;
|
typedef std::map<IfcSchema::Type::Enum, IfcEntityList::ptr> MapEntitiesByType;
|
||||||
|
|||||||
+17
-5
@@ -36,10 +36,24 @@ class Argument;
|
|||||||
class IfcEntityList;
|
class IfcEntityList;
|
||||||
class IfcEntityListList;
|
class IfcEntityListList;
|
||||||
class IfcAbstractEntity;
|
class IfcAbstractEntity;
|
||||||
|
namespace IfcWrite {
|
||||||
|
class IfcWritableEntity;
|
||||||
|
}
|
||||||
|
|
||||||
namespace IfcUtil {
|
namespace IfcUtil {
|
||||||
enum ArgumentType {
|
enum ArgumentType {
|
||||||
Argument_INT, Argument_BOOL, Argument_DOUBLE, Argument_STRING, Argument_VECTOR_INT, Argument_VECTOR_DOUBLE, Argument_VECTOR_STRING, Argument_ENTITY, Argument_ENTITY_LIST, Argument_ENTITY_LIST_LIST, Argument_ENUMERATION, Argument_UNKNOWN
|
Argument_INT,
|
||||||
|
Argument_BOOL,
|
||||||
|
Argument_DOUBLE,
|
||||||
|
Argument_STRING,
|
||||||
|
Argument_VECTOR_INT,
|
||||||
|
Argument_VECTOR_DOUBLE,
|
||||||
|
Argument_VECTOR_STRING,
|
||||||
|
Argument_ENUMERATION,
|
||||||
|
Argument_ENTITY,
|
||||||
|
Argument_ENTITY_LIST,
|
||||||
|
Argument_ENTITY_LIST_LIST,
|
||||||
|
Argument_UNKNOWN
|
||||||
};
|
};
|
||||||
|
|
||||||
class IfcBaseClass {
|
class IfcBaseClass {
|
||||||
@@ -208,8 +222,7 @@ namespace IfcParse {
|
|||||||
|
|
||||||
class Argument {
|
class Argument {
|
||||||
public:
|
public:
|
||||||
//void* file;
|
virtual IfcUtil::ArgumentType type() const = 0;
|
||||||
//public:
|
|
||||||
virtual operator int() const = 0;
|
virtual operator int() const = 0;
|
||||||
virtual operator bool() const = 0;
|
virtual operator bool() const = 0;
|
||||||
virtual operator double() const = 0;
|
virtual operator double() const = 0;
|
||||||
@@ -218,7 +231,6 @@ public:
|
|||||||
virtual operator std::vector<int>() const = 0;
|
virtual operator std::vector<int>() const = 0;
|
||||||
virtual operator std::vector<std::string>() const = 0;
|
virtual operator std::vector<std::string>() const = 0;
|
||||||
virtual operator IfcUtil::IfcBaseClass*() const = 0;
|
virtual operator IfcUtil::IfcBaseClass*() const = 0;
|
||||||
//virtual operator IfcUtil::IfcAbstractSelect::ptr() const = 0;
|
|
||||||
virtual operator IfcEntityList::ptr() const = 0;
|
virtual operator IfcEntityList::ptr() const = 0;
|
||||||
virtual operator IfcEntityListList::ptr() const = 0;
|
virtual operator IfcEntityListList::ptr() const = 0;
|
||||||
virtual unsigned int Size() const = 0;
|
virtual unsigned int Size() const = 0;
|
||||||
@@ -241,7 +253,7 @@ public:
|
|||||||
virtual bool is(IfcSchema::Type::Enum v) const = 0;
|
virtual bool is(IfcSchema::Type::Enum v) const = 0;
|
||||||
virtual std::string toString(bool upper=false) const = 0;
|
virtual std::string toString(bool upper=false) const = 0;
|
||||||
virtual unsigned int id() = 0;
|
virtual unsigned int id() = 0;
|
||||||
virtual bool isWritable() = 0;
|
virtual IfcWrite::IfcWritableEntity* isWritable() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Logger {
|
class Logger {
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ namespace IfcWrite {
|
|||||||
public:
|
public:
|
||||||
IfcWritableEntity(IfcSchema::Type::Enum t);
|
IfcWritableEntity(IfcSchema::Type::Enum t);
|
||||||
~IfcWritableEntity();
|
~IfcWritableEntity();
|
||||||
|
|
||||||
int setId(int i=-1);
|
int setId(int i=-1);
|
||||||
IfcWritableEntity(IfcAbstractEntity* e);
|
IfcWritableEntity(IfcAbstractEntity* e);
|
||||||
IfcEntityList::ptr getInverse(IfcSchema::Type::Enum c = IfcSchema::Type::ALL);
|
IfcEntityList::ptr getInverse(IfcSchema::Type::Enum c = IfcSchema::Type::ALL);
|
||||||
@@ -59,7 +60,8 @@ namespace IfcWrite {
|
|||||||
bool is(IfcSchema::Type::Enum v) const;
|
bool is(IfcSchema::Type::Enum v) const;
|
||||||
std::string toString(bool upper=false) const;
|
std::string toString(bool upper=false) const;
|
||||||
unsigned int id();
|
unsigned int id();
|
||||||
bool isWritable();
|
IfcWritableEntity* isWritable();
|
||||||
|
|
||||||
void setArgument(int i);
|
void setArgument(int i);
|
||||||
void setArgumentDerived(int i);
|
void setArgumentDerived(int i);
|
||||||
void setArgument(int i,bool v);
|
void setArgument(int i,bool v);
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ unsigned int IfcWritableEntity::id() {
|
|||||||
}
|
}
|
||||||
return *_id;
|
return *_id;
|
||||||
}
|
}
|
||||||
bool IfcWritableEntity::isWritable() { return true; }
|
IfcWritableEntity* IfcWritableEntity::isWritable() { return this; }
|
||||||
bool IfcWritableEntity::arg_writable(int i) {
|
bool IfcWritableEntity::arg_writable(int i) {
|
||||||
std::map<int,bool>::const_iterator it = writemask.find(i);
|
std::map<int,bool>::const_iterator it = writemask.find(i);
|
||||||
if ( it == writemask.end() ) return false;
|
if ( it == writemask.end() ) return false;
|
||||||
@@ -322,6 +322,16 @@ IfcWriteArgument::argument_type IfcWriteArgument::argumentType() const {
|
|||||||
return static_cast<argument_type>(container.which());
|
return static_cast<argument_type>(container.which());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IfcUtil::ArgumentType IfcWriteArgument::type() const {
|
||||||
|
// TODO: Make these the same enumeration
|
||||||
|
int ty = static_cast<int>(container.which()) - 2;
|
||||||
|
if (ty < 0) {
|
||||||
|
return IfcUtil::Argument_UNKNOWN;
|
||||||
|
} else {
|
||||||
|
static_cast<IfcUtil::ArgumentType>(ty);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
IfcEntityList::ptr IfcSelectHelperEntity::getInverse(IfcSchema::Type::Enum,int,const std::string &) {throw IfcParse::IfcException("Invalid cast");}
|
IfcEntityList::ptr IfcSelectHelperEntity::getInverse(IfcSchema::Type::Enum,int,const std::string &) {throw IfcParse::IfcException("Invalid cast");}
|
||||||
IfcEntityList::ptr IfcSelectHelperEntity::getInverse(IfcSchema::Type::Enum) {throw IfcParse::IfcException("Invalid cast");}
|
IfcEntityList::ptr IfcSelectHelperEntity::getInverse(IfcSchema::Type::Enum) {throw IfcParse::IfcException("Invalid cast");}
|
||||||
std::string IfcSelectHelperEntity::datatype() const { return IfcSchema::Type::ToString(_type); }
|
std::string IfcSelectHelperEntity::datatype() const { return IfcSchema::Type::ToString(_type); }
|
||||||
@@ -342,7 +352,7 @@ std::string IfcSelectHelperEntity::toString(bool upper) const {
|
|||||||
return ss.str();
|
return ss.str();
|
||||||
}
|
}
|
||||||
unsigned int IfcSelectHelperEntity::id() { throw IfcParse::IfcException("Invalid cast"); }
|
unsigned int IfcSelectHelperEntity::id() { throw IfcParse::IfcException("Invalid cast"); }
|
||||||
bool IfcSelectHelperEntity::isWritable() { throw IfcParse::IfcException("Invalid cast"); }
|
IfcWrite::IfcWritableEntity* IfcSelectHelperEntity::isWritable() { throw IfcParse::IfcException("Invalid cast"); }
|
||||||
|
|
||||||
IfcSelectHelper::IfcSelectHelper(const std::string& v, IfcSchema::Type::Enum t) {
|
IfcSelectHelper::IfcSelectHelper(const std::string& v, IfcSchema::Type::Enum t) {
|
||||||
IfcWriteArgument* a = new IfcWriteArgument(0);
|
IfcWriteArgument* a = new IfcWriteArgument(0);
|
||||||
|
|||||||
@@ -132,6 +132,7 @@ namespace IfcWrite {
|
|||||||
std::string toString(bool upper=false) const;
|
std::string toString(bool upper=false) const;
|
||||||
unsigned int Size() const;
|
unsigned int Size() const;
|
||||||
argument_type argumentType() const;
|
argument_type argumentType() const;
|
||||||
|
IfcUtil::ArgumentType IfcWriteArgument::type() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// An entity to help with passing of SELECT arguments that
|
/// An entity to help with passing of SELECT arguments that
|
||||||
@@ -154,7 +155,7 @@ namespace IfcWrite {
|
|||||||
bool is(IfcSchema::Type::Enum t) const;
|
bool is(IfcSchema::Type::Enum t) const;
|
||||||
std::string toString(bool upper = false) const;
|
std::string toString(bool upper = false) const;
|
||||||
unsigned int id();
|
unsigned int id();
|
||||||
bool isWritable();
|
IfcWritableEntity* isWritable();
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A helper class for passing of SELECT arguments that
|
/// A helper class for passing of SELECT arguments that
|
||||||
|
|||||||
Reference in New Issue
Block a user