mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-10-02 21:12:07 +00:00
Use boost::variant for writable arguments in the IFC serializer
This commit is contained in:
@@ -92,15 +92,15 @@ private:
|
|||||||
};
|
};
|
||||||
class DeferredObject {
|
class DeferredObject {
|
||||||
public:
|
public:
|
||||||
const std::string guid, name, type;
|
std::string guid, name, type;
|
||||||
int obj_id;
|
int obj_id;
|
||||||
const std::vector<float> matrix;
|
std::vector<float> matrix;
|
||||||
const std::vector<float> vertices;
|
std::vector<float> vertices;
|
||||||
const std::vector<float> normals;
|
std::vector<float> normals;
|
||||||
const std::vector<int> indices;
|
std::vector<int> indices;
|
||||||
const std::vector<int> material_ids;
|
std::vector<int> material_ids;
|
||||||
const std::vector<IfcGeomObjects::Material> materials;
|
std::vector<IfcGeomObjects::Material> materials;
|
||||||
const std::vector<std::string> material_references;
|
std::vector<std::string> material_references;
|
||||||
DeferredObject(const std::string& guid, const std::string& name, const std::string& type, int obj_id, const std::vector<float>& matrix, const std::vector<float>& vertices,
|
DeferredObject(const std::string& guid, const std::string& name, const std::string& type, int obj_id, const std::vector<float>& matrix, const std::vector<float>& vertices,
|
||||||
const std::vector<float>& normals, const std::vector<int>& indices, const std::vector<int>& material_ids,
|
const std::vector<float>& normals, const std::vector<int>& indices, const std::vector<int>& material_ids,
|
||||||
const std::vector<IfcGeomObjects::Material>& materials, const std::vector<std::string>& material_references)
|
const std::vector<IfcGeomObjects::Material>& materials, const std::vector<std::string>& material_references)
|
||||||
|
|||||||
@@ -44,8 +44,10 @@ namespace IfcWrite {
|
|||||||
int* _id;
|
int* _id;
|
||||||
bool arg_writable(int i);
|
bool arg_writable(int i);
|
||||||
void arg_writable(int i, bool b);
|
void arg_writable(int i, bool b);
|
||||||
|
template <typename T> void _setArgument(int i, const T&);
|
||||||
public:
|
public:
|
||||||
IfcWritableEntity(Ifc2x3::Type::Enum t);
|
IfcWritableEntity(Ifc2x3::Type::Enum t);
|
||||||
|
~IfcWritableEntity();
|
||||||
int setId(int i=-1);
|
int setId(int i=-1);
|
||||||
IfcWritableEntity(IfcAbstractEntity* e);
|
IfcWritableEntity(IfcAbstractEntity* e);
|
||||||
IfcEntities getInverse(Ifc2x3::Type::Enum c = Ifc2x3::Type::ALL);
|
IfcEntities getInverse(Ifc2x3::Type::Enum c = Ifc2x3::Type::ALL);
|
||||||
|
|||||||
+163
-249
@@ -29,6 +29,9 @@ IfcWritableEntity::IfcWritableEntity(Ifc2x3::Type::Enum t) {
|
|||||||
_id = 0;
|
_id = 0;
|
||||||
file = 0;
|
file = 0;
|
||||||
}
|
}
|
||||||
|
IfcWritableEntity::~IfcWritableEntity() {
|
||||||
|
delete _id;
|
||||||
|
}
|
||||||
int IfcWritableEntity::setId(int i) {
|
int IfcWritableEntity::setId(int i) {
|
||||||
return *(_id = new int(i > 0 ? i : file->FreshId()));
|
return *(_id = new int(i > 0 ? i : file->FreshId()));
|
||||||
}
|
}
|
||||||
@@ -36,6 +39,7 @@ IfcWritableEntity::IfcWritableEntity(IfcAbstractEntity* e)
|
|||||||
{
|
{
|
||||||
file = e->file;
|
file = e->file;
|
||||||
_type = e->type();
|
_type = e->type();
|
||||||
|
delete _id;
|
||||||
_id = new int(e->id());
|
_id = new int(e->id());
|
||||||
|
|
||||||
const unsigned int count = e->getArgumentCount();
|
const unsigned int count = e->getArgumentCount();
|
||||||
@@ -90,7 +94,12 @@ std::string IfcWritableEntity::toString(bool upper) {
|
|||||||
ss << ")";
|
ss << ")";
|
||||||
return ss.str();
|
return ss.str();
|
||||||
}
|
}
|
||||||
unsigned int IfcWritableEntity::id() { if ( !_id ) _id = new int(file->FreshId()); return *_id; }
|
unsigned int IfcWritableEntity::id() {
|
||||||
|
if ( !_id ) {
|
||||||
|
_id = new int(file->FreshId());
|
||||||
|
}
|
||||||
|
return *_id;
|
||||||
|
}
|
||||||
bool IfcWritableEntity::isWritable() { return true; }
|
bool IfcWritableEntity::isWritable() { return true; }
|
||||||
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);
|
||||||
@@ -100,285 +109,185 @@ bool IfcWritableEntity::arg_writable(int i) {
|
|||||||
void IfcWritableEntity::arg_writable(int i, bool b) {
|
void IfcWritableEntity::arg_writable(int i, bool b) {
|
||||||
writemask[i] = b;
|
writemask[i] = b;
|
||||||
}
|
}
|
||||||
void IfcWritableEntity::setArgument(int i) {
|
|
||||||
|
template <typename T> void IfcWritableEntity::_setArgument(int i, const T& t) {
|
||||||
if ( arg_writable(i) ) delete args[i];
|
if ( arg_writable(i) ) delete args[i];
|
||||||
args[i] = new IfcWriteNullArgument(this);
|
IfcWriteArgument* arg = new IfcWriteArgument(this);
|
||||||
|
args[i] = arg;
|
||||||
|
arg->set(t);
|
||||||
arg_writable(i,true);
|
arg_writable(i,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IfcWritableEntity::setArgument(int i) {
|
||||||
|
_setArgument(i, boost::none);
|
||||||
|
}
|
||||||
void IfcWritableEntity::setArgumentDerived(int i) {
|
void IfcWritableEntity::setArgumentDerived(int i) {
|
||||||
if ( arg_writable(i) ) delete args[i];
|
_setArgument(i, IfcWriteArgument::Derived());
|
||||||
args[i] = new IfcWriteDerivedArgument(this);
|
|
||||||
arg_writable(i,true);
|
|
||||||
}
|
}
|
||||||
void IfcWritableEntity::setArgument(int i,int v) {
|
void IfcWritableEntity::setArgument(int i,int v) {
|
||||||
if ( arg_writable(i) ) delete args[i];
|
_setArgument(i, v);
|
||||||
args[i] = new IfcWriteIntegralArgument(this,v);
|
|
||||||
arg_writable(i,true);
|
|
||||||
}
|
}
|
||||||
void IfcWritableEntity::setArgument(int i,bool v) {
|
void IfcWritableEntity::setArgument(int i,bool v) {
|
||||||
if ( arg_writable(i) ) delete args[i];
|
_setArgument(i, v);
|
||||||
args[i] = new IfcWriteIntegralArgument(this,v);
|
|
||||||
arg_writable(i,true);
|
|
||||||
}
|
}
|
||||||
void IfcWritableEntity::setArgument(int i,int v, const char* c){
|
void IfcWritableEntity::setArgument(int i,int v, const char* c){
|
||||||
if ( arg_writable(i) ) delete args[i];
|
_setArgument(i, IfcWriteArgument::EnumerationReference(v, c));
|
||||||
args[i] = new IfcWriteEnumerationArgument(this,v,c);
|
|
||||||
arg_writable(i,true);
|
|
||||||
}
|
}
|
||||||
void IfcWritableEntity::setArgument(int i,const std::string& v){
|
void IfcWritableEntity::setArgument(int i,const std::string& v){
|
||||||
if ( arg_writable(i) ) delete args[i];
|
_setArgument(i, v);
|
||||||
args[i] = new IfcWriteIntegralArgument(this,v);
|
|
||||||
arg_writable(i,true);
|
|
||||||
}
|
}
|
||||||
void IfcWritableEntity::setArgument(int i,double v){
|
void IfcWritableEntity::setArgument(int i,double v){
|
||||||
if ( arg_writable(i) ) delete args[i];
|
_setArgument(i, v);
|
||||||
args[i] = new IfcWriteIntegralArgument(this,v);
|
|
||||||
arg_writable(i,true);
|
|
||||||
}
|
}
|
||||||
void IfcWritableEntity::setArgument(int i,IfcUtil::IfcSchemaEntity v){
|
void IfcWritableEntity::setArgument(int i,IfcUtil::IfcSchemaEntity v){
|
||||||
if ( arg_writable(i) ) delete args[i];
|
if ( v ) {
|
||||||
if ( v ) args[i] = new IfcWriteIntegralArgument(this,v);
|
_setArgument(i, v);
|
||||||
else args[i] = new IfcWriteNullArgument(this);
|
} else {
|
||||||
arg_writable(i,true);
|
_setArgument(i, boost::none);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
void IfcWritableEntity::setArgument(int i,IfcEntities v){
|
void IfcWritableEntity::setArgument(int i,IfcEntities v){
|
||||||
if ( arg_writable(i) ) delete args[i];
|
if ( v.get() ) {
|
||||||
if ( v.get() ) args[i] = new IfcWriteEntityListArgument(this,v);
|
_setArgument(i, v);
|
||||||
else args[i] = new IfcWriteNullArgument(this);
|
} else {
|
||||||
arg_writable(i,true);
|
_setArgument(i, boost::none);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
void IfcWritableEntity::setArgument(int i,const std::vector<double>& v){
|
void IfcWritableEntity::setArgument(int i,const std::vector<double>& v){
|
||||||
if ( arg_writable(i) ) delete args[i];
|
_setArgument(i, v);
|
||||||
args[i] = new IfcWriteIntegralArgument(this,v);
|
|
||||||
arg_writable(i,true);
|
|
||||||
}
|
}
|
||||||
void IfcWritableEntity::setArgument(int i,const std::vector<std::string>& v){
|
void IfcWritableEntity::setArgument(int i,const std::vector<std::string>& v){
|
||||||
if ( arg_writable(i) ) delete args[i];
|
_setArgument(i, v);
|
||||||
args[i] = new IfcWriteIntegralArgument(this,v);
|
|
||||||
arg_writable(i,true);
|
|
||||||
}
|
}
|
||||||
void IfcWritableEntity::setArgument(int i,const std::vector<int>& v){
|
void IfcWritableEntity::setArgument(int i,const std::vector<int>& v){
|
||||||
if ( arg_writable(i) ) delete args[i];
|
_setArgument(i, v);
|
||||||
args[i] = new IfcWriteIntegralArgument(this,v);
|
|
||||||
arg_writable(i,true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IfcWriteNullArgument::operator int() const { throw IfcParse::IfcException("Invalid cast"); }
|
class SizeVisitor : public boost::static_visitor<int> {
|
||||||
IfcWriteNullArgument::operator bool() const { throw IfcParse::IfcException("Invalid cast"); }
|
public:
|
||||||
IfcWriteNullArgument::operator double() const { throw IfcParse::IfcException("Invalid cast"); }
|
int operator()(const boost::none_t& i) const { return -1; }
|
||||||
IfcWriteNullArgument::operator std::string() const { throw IfcParse::IfcException("Invalid cast"); }
|
int operator()(const IfcWriteArgument::Derived& i) const { return -1; }
|
||||||
IfcWriteNullArgument::operator std::vector<double>() const { throw IfcParse::IfcException("Invalid cast"); }
|
int operator()(const int& i) const { return -1; }
|
||||||
IfcWriteNullArgument::operator std::vector<int>() const { throw IfcParse::IfcException("Invalid cast"); }
|
int operator()(const bool& i) const { return -1; }
|
||||||
IfcWriteNullArgument::operator std::vector<std::string>() const { throw IfcParse::IfcException("Invalid cast"); }
|
int operator()(const double& i) const { return -1; }
|
||||||
IfcWriteNullArgument::operator IfcUtil::IfcSchemaEntity() const { throw IfcParse::IfcException("Invalid cast"); }
|
int operator()(const std::string& i) const { return i.size(); }
|
||||||
IfcWriteNullArgument::operator IfcEntities() const { throw IfcParse::IfcException("Invalid cast"); }
|
int operator()(const std::vector<int>& i) const { return i.size(); }
|
||||||
bool IfcWriteNullArgument::isNull() const { return true; }
|
int operator()(const std::vector<double>& i) const { return i.size(); }
|
||||||
ArgumentPtr IfcWriteNullArgument::operator [] (unsigned int i) const { throw IfcParse::IfcException("Invalid cast"); }
|
int operator()(const std::vector<std::string>& i) const { return i.size(); }
|
||||||
std::string IfcWriteNullArgument::toString(bool upper) const { return "$"; }
|
int operator()(const IfcWriteArgument::EnumerationReference& i) const { return -1; }
|
||||||
unsigned int IfcWriteNullArgument::Size() const { throw IfcParse::IfcException("Invalid cast"); }
|
int operator()(const IfcUtil::IfcSchemaEntity& i) const { return -1; }
|
||||||
|
int operator()(const IfcEntities& i) const { return i->Size(); }
|
||||||
|
};
|
||||||
|
|
||||||
IfcWriteDerivedArgument::operator int() const { throw IfcParse::IfcException("Invalid cast"); }
|
class StringBuilderVisitor : public boost::static_visitor<void> {
|
||||||
IfcWriteDerivedArgument::operator bool() const { throw IfcParse::IfcException("Invalid cast"); }
|
private:
|
||||||
IfcWriteDerivedArgument::operator double() const { throw IfcParse::IfcException("Invalid cast"); }
|
std::ostringstream& data;
|
||||||
IfcWriteDerivedArgument::operator std::string() const { throw IfcParse::IfcException("Invalid cast"); }
|
template <typename T> void serialize(const std::vector<T>& i) {
|
||||||
IfcWriteDerivedArgument::operator std::vector<double>() const { throw IfcParse::IfcException("Invalid cast"); }
|
data << "(";
|
||||||
IfcWriteDerivedArgument::operator std::vector<int>() const { throw IfcParse::IfcException("Invalid cast"); }
|
for (typename std::vector<T>::const_iterator it = i.begin(); it != i.end(); ++it) {
|
||||||
IfcWriteDerivedArgument::operator std::vector<std::string>() const { throw IfcParse::IfcException("Invalid cast"); }
|
if (it != i.begin()) data << ",";
|
||||||
IfcWriteDerivedArgument::operator IfcUtil::IfcSchemaEntity() const { throw IfcParse::IfcException("Invalid cast"); }
|
data << *it;
|
||||||
IfcWriteDerivedArgument::operator IfcEntities() const { throw IfcParse::IfcException("Invalid cast"); }
|
}
|
||||||
bool IfcWriteDerivedArgument::isNull() const { throw IfcParse::IfcException("Invalid cast"); }
|
data << ")";
|
||||||
ArgumentPtr IfcWriteDerivedArgument::operator [] (unsigned int i) const { throw IfcParse::IfcException("Invalid cast"); }
|
}
|
||||||
std::string IfcWriteDerivedArgument::toString(bool upper) const { return "*"; }
|
// The REAL token definition from the IFC SPF standard does not necessarily match
|
||||||
unsigned int IfcWriteDerivedArgument::Size() const { throw IfcParse::IfcException("Invalid cast"); }
|
// the output of the C++ ostream formatting operation.
|
||||||
|
// REAL = [ SIGN ] DIGIT { DIGIT } "." { DIGIT } [ "E" [ SIGN ] DIGIT { DIGIT } ] .
|
||||||
IfcWriteEntityListArgument::IfcWriteEntityListArgument(IfcAbstractEntity* e, const IfcEntities& v) : IfcWriteArgument(e) { value = v; }
|
std::string format_double(const double& d) {
|
||||||
IfcWriteEntityListArgument::operator int() const { throw IfcParse::IfcException("Invalid cast"); }
|
std::ostringstream oss;
|
||||||
IfcWriteEntityListArgument::operator bool() const { throw IfcParse::IfcException("Invalid cast"); }
|
oss << d;
|
||||||
IfcWriteEntityListArgument::operator double() const { throw IfcParse::IfcException("Invalid cast"); }
|
const std::string str = oss.str();
|
||||||
IfcWriteEntityListArgument::operator std::string() const { throw IfcParse::IfcException("Invalid cast"); }
|
oss.str("");
|
||||||
IfcWriteEntityListArgument::operator std::vector<double>() const { throw IfcParse::IfcException("Invalid cast"); }
|
std::string::size_type e = str.find('e');
|
||||||
IfcWriteEntityListArgument::operator std::vector<int>() const { throw IfcParse::IfcException("Invalid cast"); }
|
if (e == std::string::npos) {
|
||||||
IfcWriteEntityListArgument::operator std::vector<std::string>() const { throw IfcParse::IfcException("Invalid cast"); }
|
e = str.find('E');
|
||||||
IfcWriteEntityListArgument::operator IfcUtil::IfcSchemaEntity() const { throw IfcParse::IfcException("Invalid cast"); }
|
}
|
||||||
IfcWriteEntityListArgument::operator IfcEntities() const { return value; }
|
const std::string mantissa = str.substr(0,e);
|
||||||
bool IfcWriteEntityListArgument::isNull() const { return false; }
|
oss << mantissa;
|
||||||
unsigned int IfcWriteEntityListArgument::Size() const { return value->Size(); }
|
if (mantissa.find('.') == std::string::npos) {
|
||||||
ArgumentPtr IfcWriteEntityListArgument::operator [] (unsigned int i) const { throw IfcParse::IfcException("Invalid cast"); }
|
oss << ".";
|
||||||
std::string IfcWriteEntityListArgument::toString(bool upper) const {
|
}
|
||||||
std::ostringstream ss;
|
if (e != std::string::npos) {
|
||||||
ss << "(";
|
oss << "E";
|
||||||
for ( IfcEntityList::it it = value->begin(); it != value->end(); ++ it ) {
|
oss << str.substr(e+1);
|
||||||
if ( it != value->begin() ) ss << ",";
|
}
|
||||||
IfcAbstractEntity* e = (*it)->entity;
|
return oss.str();
|
||||||
|
}
|
||||||
|
void serialize_double(const std::vector<double>& i) {
|
||||||
|
data << "(";
|
||||||
|
for (std::vector<double>::const_iterator it = i.begin(); it != i.end(); ++it) {
|
||||||
|
if (it != i.begin()) data << ",";
|
||||||
|
data << format_double(*it);
|
||||||
|
}
|
||||||
|
data << ")";
|
||||||
|
}
|
||||||
|
bool upper;
|
||||||
|
public:
|
||||||
|
StringBuilderVisitor(std::ostringstream& stream, bool upper = false)
|
||||||
|
: data(stream), upper(upper) {}
|
||||||
|
void operator()(const boost::none_t& i) { data << "$"; }
|
||||||
|
void operator()(const IfcWriteArgument::Derived& i) { data << "*"; }
|
||||||
|
void operator()(const int& i) { data << i; }
|
||||||
|
void operator()(const bool& i) { data << (i ? ".T." : ".F."); }
|
||||||
|
void operator()(const double& i) { data << format_double(i); }
|
||||||
|
void operator()(const std::string& i) {
|
||||||
|
std::string s = i;
|
||||||
|
if (upper) s = IfcCharacterEncoder(s);
|
||||||
|
data << s;
|
||||||
|
}
|
||||||
|
void operator()(const std::vector<int>& i) { serialize(i); }
|
||||||
|
void operator()(const std::vector<double>& i) { serialize_double(i); }
|
||||||
|
void operator()(const std::vector<std::string>& i) { serialize(i); }
|
||||||
|
void operator()(const IfcWriteArgument::EnumerationReference& i) {
|
||||||
|
data << "." << i.enumeration_value << ".";
|
||||||
|
}
|
||||||
|
void operator()(const IfcUtil::IfcSchemaEntity& i) {
|
||||||
|
IfcAbstractEntity* e = i->entity;
|
||||||
if ( Ifc2x3::Type::IsSimple(e->type()) ) {
|
if ( Ifc2x3::Type::IsSimple(e->type()) ) {
|
||||||
ss << e->toString(upper);
|
data << e->toString(upper);
|
||||||
} else {
|
} else {
|
||||||
if (!e->file) e->file = entity->file;
|
data << "#" << e->id();
|
||||||
ss << "#" << e->id();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ss << ")";
|
void operator()(const IfcEntities& i) {
|
||||||
return ss.str();
|
data << "(";
|
||||||
}
|
for (IfcEntityList::it it = i->begin(); it != i->end(); ++it) {
|
||||||
|
if (it != i->begin()) data << ",";
|
||||||
IfcWriteEnumerationArgument::IfcWriteEnumerationArgument(IfcAbstractEntity* e, int v, const char* c) : IfcWriteArgument(e) {data=v; enumeration_value = c;}
|
(*this)(*it);
|
||||||
IfcWriteEnumerationArgument::operator int() const { throw IfcParse::IfcException("Invalid cast"); }
|
}
|
||||||
IfcWriteEnumerationArgument::operator bool() const { throw IfcParse::IfcException("Invalid cast"); }
|
data << ")";
|
||||||
IfcWriteEnumerationArgument::operator double() const { throw IfcParse::IfcException("Invalid cast"); }
|
|
||||||
IfcWriteEnumerationArgument::operator std::string() const { return std::string(enumeration_value); }
|
|
||||||
IfcWriteEnumerationArgument::operator std::vector<double>() const { throw IfcParse::IfcException("Invalid cast"); }
|
|
||||||
IfcWriteEnumerationArgument::operator std::vector<int>() const { throw IfcParse::IfcException("Invalid cast"); }
|
|
||||||
IfcWriteEnumerationArgument::operator std::vector<std::string>() const { throw IfcParse::IfcException("Invalid cast"); }
|
|
||||||
IfcWriteEnumerationArgument::operator IfcUtil::IfcSchemaEntity() const { throw IfcParse::IfcException("Invalid cast"); }
|
|
||||||
IfcWriteEnumerationArgument::operator IfcEntities() const { throw IfcParse::IfcException("Invalid cast"); }
|
|
||||||
bool IfcWriteEnumerationArgument::isNull() const { return false; }
|
|
||||||
ArgumentPtr IfcWriteEnumerationArgument::operator [] (unsigned int i) const { throw IfcParse::IfcException("Invalid cast"); }
|
|
||||||
std::string IfcWriteEnumerationArgument::toString(bool upper) const { return std::string(".") + enumeration_value + '.';}
|
|
||||||
unsigned int IfcWriteEnumerationArgument::Size() const { throw IfcParse::IfcException("Invalid cast"); }
|
|
||||||
|
|
||||||
IfcWriteIntegralArgument::IfcWriteIntegralArgument(IfcAbstractEntity* e, int v) : IfcWriteArgument(e) {data=new int(v); type = Argument_INT;}
|
|
||||||
IfcWriteIntegralArgument::IfcWriteIntegralArgument(IfcAbstractEntity* e, bool v) : IfcWriteArgument(e) {data=new bool(v); type = Argument_BOOL;}
|
|
||||||
IfcWriteIntegralArgument::IfcWriteIntegralArgument(IfcAbstractEntity* e, double v) : IfcWriteArgument(e) {data=new double(v); type = Argument_DOUBLE;}
|
|
||||||
IfcWriteIntegralArgument::IfcWriteIntegralArgument(IfcAbstractEntity* e, const std::string& v) : IfcWriteArgument(e) {data=new std::string(v); type = Argument_STRING;}
|
|
||||||
IfcWriteIntegralArgument::IfcWriteIntegralArgument(IfcAbstractEntity* e, const std::vector<int> v) : IfcWriteArgument(e) {data=new std::vector<int>(v); type = Argument_VECTOR_INT;}
|
|
||||||
IfcWriteIntegralArgument::IfcWriteIntegralArgument(IfcAbstractEntity* e, const std::vector<double> v) : IfcWriteArgument(e) {data=new std::vector<double>(v); type = Argument_VECTOR_DOUBLE;}
|
|
||||||
IfcWriteIntegralArgument::IfcWriteIntegralArgument(IfcAbstractEntity* e, const std::vector<std::string> v) : IfcWriteArgument(e) {data=new std::vector<std::string>(v); type = Argument_VECTOR_STRING;}
|
|
||||||
IfcWriteIntegralArgument::IfcWriteIntegralArgument(IfcAbstractEntity* e, IfcUtil::IfcSchemaEntity v) : IfcWriteArgument(e) {data=v; type = Argument_ENTITY;}
|
|
||||||
IfcWriteIntegralArgument::~IfcWriteIntegralArgument() {
|
|
||||||
switch ( type ) {
|
|
||||||
case Argument_INT:
|
|
||||||
delete (int*) data;
|
|
||||||
break;
|
|
||||||
case Argument_BOOL:
|
|
||||||
delete (bool*) data;
|
|
||||||
break;
|
|
||||||
case Argument_DOUBLE:
|
|
||||||
delete (double*) data;
|
|
||||||
break;
|
|
||||||
case Argument_STRING:
|
|
||||||
delete (std::string*) data;
|
|
||||||
break;
|
|
||||||
case Argument_VECTOR_INT:
|
|
||||||
delete (std::vector<int>*) data;
|
|
||||||
break;
|
|
||||||
case Argument_VECTOR_DOUBLE:
|
|
||||||
delete (std::vector<double>*) data;
|
|
||||||
break;
|
|
||||||
case Argument_VECTOR_STRING:
|
|
||||||
delete (std::vector<std::string>*) data;
|
|
||||||
break;
|
|
||||||
case Argument_ENTITY:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
operator std::string() { return data.str(); }
|
||||||
|
};
|
||||||
|
|
||||||
|
IfcWriteArgument::operator int() const { return as<int>(); }
|
||||||
|
IfcWriteArgument::operator bool() const { return as<bool>(); }
|
||||||
|
IfcWriteArgument::operator double() const { return as<double>(); }
|
||||||
|
IfcWriteArgument::operator std::string() const { return as<std::string>(); }
|
||||||
|
IfcWriteArgument::operator std::vector<double>() const { return as<std::vector<double> >(); }
|
||||||
|
IfcWriteArgument::operator std::vector<int>() const { return as<std::vector<int> >(); }
|
||||||
|
IfcWriteArgument::operator std::vector<std::string>() const { return as<std::vector<std::string > >(); }
|
||||||
|
IfcWriteArgument::operator IfcUtil::IfcSchemaEntity() const { return as<IfcUtil::IfcSchemaEntity>(); }
|
||||||
|
IfcWriteArgument::operator IfcEntities() const { return as<IfcEntities>(); }
|
||||||
|
bool IfcWriteArgument::isNull() const { return argumentType() == argument_type_null; }
|
||||||
|
ArgumentPtr IfcWriteArgument::operator [] (unsigned int i) const { throw IfcParse::IfcException("Invalid cast"); }
|
||||||
|
std::string IfcWriteArgument::toString(bool upper) const {
|
||||||
|
std::ostringstream str;
|
||||||
|
StringBuilderVisitor v(str, upper);
|
||||||
|
container.apply_visitor(v);
|
||||||
|
return v;
|
||||||
}
|
}
|
||||||
IfcWriteIntegralArgument::operator int() const { if ( type != Argument_INT ) throw IfcParse::IfcException("Invalid cast"); return *(int*)data; }
|
unsigned int IfcWriteArgument::Size() const {
|
||||||
IfcWriteIntegralArgument::operator bool() const { if ( type != Argument_BOOL ) throw IfcParse::IfcException("Invalid cast"); return *(bool*)data; }
|
SizeVisitor v;
|
||||||
IfcWriteIntegralArgument::operator double() const { if ( type != Argument_DOUBLE ) throw IfcParse::IfcException("Invalid cast"); return *(double*)data; }
|
const int size = container.apply_visitor(v);
|
||||||
IfcWriteIntegralArgument::operator std::string() const { if ( type != Argument_STRING ) throw IfcParse::IfcException("Invalid cast"); return *(std::string*)data; }
|
if (size == -1) {
|
||||||
IfcWriteIntegralArgument::operator std::vector<double>() const { if ( type != Argument_VECTOR_DOUBLE ) throw IfcParse::IfcException("Invalid cast"); return *(std::vector<double>*)data; }
|
|
||||||
IfcWriteIntegralArgument::operator std::vector<int>() const { if ( type != Argument_VECTOR_INT ) throw IfcParse::IfcException("Invalid cast"); return *(std::vector<int>*)data; }
|
|
||||||
IfcWriteIntegralArgument::operator std::vector<std::string>() const { if ( type != Argument_VECTOR_STRING ) throw IfcParse::IfcException("Invalid cast"); return *(std::vector<std::string>*)data; }
|
|
||||||
IfcWriteIntegralArgument::operator IfcUtil::IfcSchemaEntity() const { if ( type != Argument_ENTITY ) throw IfcParse::IfcException("Invalid cast"); return (IfcUtil::IfcSchemaEntity)data; }
|
|
||||||
IfcWriteIntegralArgument::operator IfcEntities() const { throw IfcParse::IfcException("Invalid cast"); }
|
|
||||||
bool IfcWriteIntegralArgument::isNull() const { return false; }
|
|
||||||
unsigned int IfcWriteIntegralArgument::Size() const {
|
|
||||||
switch ( type ) {
|
|
||||||
case Argument_VECTOR_INT:
|
|
||||||
return ((std::vector<int>*) data)->size();
|
|
||||||
break;
|
|
||||||
case Argument_VECTOR_DOUBLE:
|
|
||||||
return ((std::vector<double>*) data)->size();
|
|
||||||
break;
|
|
||||||
case Argument_VECTOR_STRING:
|
|
||||||
return ((std::vector<std::string>*) data)->size();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw IfcParse::IfcException("Invalid cast");
|
throw IfcParse::IfcException("Invalid cast");
|
||||||
break;
|
} else {
|
||||||
|
return size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
IfcWriteArgument::argument_type IfcWriteArgument::argumentType() const {
|
||||||
// The REAL token definition from the IFC SPF standard does not necessarily match
|
return static_cast<argument_type>(container.which());
|
||||||
// the output of the C++ ostream formatting operation.
|
|
||||||
// REAL = [ SIGN ] DIGIT { DIGIT } "." { DIGIT } [ "E" [ SIGN ] DIGIT { DIGIT } ] .
|
|
||||||
std::string format_double(const double& d) {
|
|
||||||
std::ostringstream oss;
|
|
||||||
oss << d;
|
|
||||||
const std::string str = oss.str();
|
|
||||||
oss.str("");
|
|
||||||
std::string::size_type e = str.find('e');
|
|
||||||
if (e == std::string::npos) {
|
|
||||||
e = str.find('E');
|
|
||||||
}
|
|
||||||
const std::string mantissa = str.substr(0,e);
|
|
||||||
oss << mantissa;
|
|
||||||
if (mantissa.find('.') == std::string::npos) {
|
|
||||||
oss << ".";
|
|
||||||
}
|
|
||||||
if (e != std::string::npos) {
|
|
||||||
oss << "E";
|
|
||||||
oss << str.substr(e+1);
|
|
||||||
}
|
|
||||||
return oss.str();
|
|
||||||
}
|
|
||||||
|
|
||||||
ArgumentPtr IfcWriteIntegralArgument::operator [] (unsigned int i) const { throw IfcParse::IfcException("Invalid cast"); }
|
|
||||||
std::string IfcWriteIntegralArgument::toString(bool upper) const {
|
|
||||||
std::ostringstream ss;
|
|
||||||
switch ( type ) {
|
|
||||||
case Argument_INT:
|
|
||||||
ss << *(int*)data;
|
|
||||||
break;
|
|
||||||
case Argument_BOOL:
|
|
||||||
ss << ((*(bool*) data) ? ".T." : ".F.");
|
|
||||||
break;
|
|
||||||
case Argument_DOUBLE:
|
|
||||||
ss << format_double(*(double*) data);
|
|
||||||
break;
|
|
||||||
case Argument_STRING: {
|
|
||||||
std::string d = *(std::string*) data;
|
|
||||||
if ( upper ) d = IfcCharacterEncoder(d);
|
|
||||||
ss << d;
|
|
||||||
break;
|
|
||||||
} case Argument_VECTOR_INT:
|
|
||||||
ss << "(";
|
|
||||||
{const std::vector<int>& v = *(std::vector<int>*) data;
|
|
||||||
for ( std::vector<int>::const_iterator it = v.begin(); it != v.end(); ++ it ) {
|
|
||||||
if ( it != v.begin() ) ss << ",";
|
|
||||||
ss << *it;
|
|
||||||
}}
|
|
||||||
ss << ")";
|
|
||||||
break;
|
|
||||||
case Argument_VECTOR_DOUBLE:
|
|
||||||
ss << "(";
|
|
||||||
{const std::vector<double>& v = *(std::vector<double>*) data;
|
|
||||||
for ( std::vector<double>::const_iterator it = v.begin(); it != v.end(); ++ it ) {
|
|
||||||
if ( it != v.begin() ) ss << ",";
|
|
||||||
ss << format_double(*it);
|
|
||||||
}}
|
|
||||||
ss << ")";
|
|
||||||
break;
|
|
||||||
case Argument_VECTOR_STRING:
|
|
||||||
ss << "(";
|
|
||||||
{const std::vector<std::string>& v = *(std::vector<std::string>*) data;
|
|
||||||
for ( std::vector<std::string>::const_iterator it = v.begin(); it != v.end(); ++ it ) {
|
|
||||||
if ( it != v.begin() ) ss << ",";
|
|
||||||
ss << '\'' << *it << '\'';
|
|
||||||
}}
|
|
||||||
ss << ")";
|
|
||||||
break;
|
|
||||||
case Argument_ENTITY:
|
|
||||||
{IfcAbstractEntity* e = ((IfcUtil::IfcSchemaEntity)data)->entity;
|
|
||||||
if ( Ifc2x3::Type::IsSimple(e->type()) ) {
|
|
||||||
ss << e->toString(upper);
|
|
||||||
} else {
|
|
||||||
if (!e->file) e->file = entity->file;
|
|
||||||
ss << "#" << e->id();
|
|
||||||
}}
|
|
||||||
break;
|
|
||||||
default: throw IfcParse::IfcException("Invalid cast");
|
|
||||||
}
|
|
||||||
return ss.str();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IfcEntities IfcSelectHelperEntity::getInverse(Ifc2x3::Type::Enum,int,const std::string &) {throw IfcParse::IfcException("Invalid cast");}
|
IfcEntities IfcSelectHelperEntity::getInverse(Ifc2x3::Type::Enum,int,const std::string &) {throw IfcParse::IfcException("Invalid cast");}
|
||||||
@@ -404,23 +313,28 @@ unsigned int IfcSelectHelperEntity::id() { throw IfcParse::IfcException("Invalid
|
|||||||
bool IfcSelectHelperEntity::isWritable() { throw IfcParse::IfcException("Invalid cast"); }
|
bool IfcSelectHelperEntity::isWritable() { throw IfcParse::IfcException("Invalid cast"); }
|
||||||
|
|
||||||
IfcSelectHelper::IfcSelectHelper(const std::string& v, Ifc2x3::Type::Enum t) {
|
IfcSelectHelper::IfcSelectHelper(const std::string& v, Ifc2x3::Type::Enum t) {
|
||||||
IfcWriteArgument* a = new IfcWriteIntegralArgument(0,v);
|
IfcWriteArgument* a = new IfcWriteArgument(0);
|
||||||
|
a->set(v);
|
||||||
this->entity = new IfcSelectHelperEntity(t,a);
|
this->entity = new IfcSelectHelperEntity(t,a);
|
||||||
}
|
}
|
||||||
IfcSelectHelper::IfcSelectHelper(const char* const v, Ifc2x3::Type::Enum t) {
|
IfcSelectHelper::IfcSelectHelper(const char* const v, Ifc2x3::Type::Enum t) {
|
||||||
IfcWriteArgument* a = new IfcWriteIntegralArgument(0,std::string(v));
|
IfcWriteArgument* a = new IfcWriteArgument(0);
|
||||||
|
a->set<std::string>(v);
|
||||||
this->entity = new IfcSelectHelperEntity(t,a);
|
this->entity = new IfcSelectHelperEntity(t,a);
|
||||||
}
|
}
|
||||||
IfcSelectHelper::IfcSelectHelper(int v, Ifc2x3::Type::Enum t) {
|
IfcSelectHelper::IfcSelectHelper(int v, Ifc2x3::Type::Enum t) {
|
||||||
IfcWriteArgument* a = new IfcWriteIntegralArgument(0,v);
|
IfcWriteArgument* a = new IfcWriteArgument(0);
|
||||||
|
a->set(v);
|
||||||
this->entity = new IfcSelectHelperEntity(t,a);
|
this->entity = new IfcSelectHelperEntity(t,a);
|
||||||
}
|
}
|
||||||
IfcSelectHelper::IfcSelectHelper(double v, Ifc2x3::Type::Enum t) {
|
IfcSelectHelper::IfcSelectHelper(double v, Ifc2x3::Type::Enum t) {
|
||||||
IfcWriteArgument* a = new IfcWriteIntegralArgument(0,v);
|
IfcWriteArgument* a = new IfcWriteArgument(0);
|
||||||
|
a->set(v);
|
||||||
this->entity = new IfcSelectHelperEntity(t,a);
|
this->entity = new IfcSelectHelperEntity(t,a);
|
||||||
}
|
}
|
||||||
IfcSelectHelper::IfcSelectHelper(bool v, Ifc2x3::Type::Enum t) {
|
IfcSelectHelper::IfcSelectHelper(bool v, Ifc2x3::Type::Enum t) {
|
||||||
IfcWriteArgument* a = new IfcWriteIntegralArgument(0,v);
|
IfcWriteArgument* a = new IfcWriteArgument(0);
|
||||||
|
a->set(v);
|
||||||
this->entity = new IfcSelectHelperEntity(t,a);
|
this->entity = new IfcSelectHelperEntity(t,a);
|
||||||
}
|
}
|
||||||
bool IfcSelectHelper::is(Ifc2x3::Type::Enum t) const { return entity->is(t); }
|
bool IfcSelectHelper::is(Ifc2x3::Type::Enum t) const { return entity->is(t); }
|
||||||
|
|||||||
+79
-111
@@ -28,22 +28,92 @@
|
|||||||
#ifndef IFCWRITE_H
|
#ifndef IFCWRITE_H
|
||||||
#define IFCWRITE_H
|
#define IFCWRITE_H
|
||||||
|
|
||||||
|
#include <boost/variant.hpp>
|
||||||
|
#include <boost/optional.hpp>
|
||||||
|
|
||||||
#include "../ifcparse/IfcUtil.h"
|
#include "../ifcparse/IfcUtil.h"
|
||||||
#include "../ifcparse/IfcParse.h"
|
#include "../ifcparse/IfcParse.h"
|
||||||
|
|
||||||
namespace IfcWrite {
|
namespace IfcWrite {
|
||||||
|
|
||||||
/// A placeholder class for grouping functionality geared towards writing IFC files
|
/// This class is a writable container for attributes. A fundamental
|
||||||
|
/// difference with the attribute types counterparts defined in the
|
||||||
|
/// IfcParse namespace is that this class has a Boost.Variant member
|
||||||
|
/// for storing its value, whereas the IfcParse classes only contain
|
||||||
|
/// lazy references to byte offsets in the IFC-SPF file.
|
||||||
class IfcWriteArgument : public Argument {
|
class IfcWriteArgument : public Argument {
|
||||||
protected:
|
public:
|
||||||
|
class EnumerationReference {
|
||||||
|
public:
|
||||||
|
int data;
|
||||||
|
const char* enumeration_value;
|
||||||
|
EnumerationReference(int data, const char* enumeration_value)
|
||||||
|
: data(data), enumeration_value(enumeration_value) {}
|
||||||
|
};
|
||||||
|
class Derived {};
|
||||||
|
private:
|
||||||
IfcAbstractEntity* entity;
|
IfcAbstractEntity* entity;
|
||||||
|
boost::variant<
|
||||||
|
// A null argument, it will always serialize to $
|
||||||
|
boost::none_t,
|
||||||
|
// A derived argument, it will always serialize to *
|
||||||
|
Derived,
|
||||||
|
// An integer argument, e.g. 123
|
||||||
|
int,
|
||||||
|
// A boolean argument, it will serialize to either .T. or .F.
|
||||||
|
bool,
|
||||||
|
// A floating point argument, e.g. 12.3
|
||||||
|
double,
|
||||||
|
// A character string argument, e.g. 'IfcOpenShell'
|
||||||
|
std::string,
|
||||||
|
// A list of integers, e.g. (1,2,3)
|
||||||
|
std::vector<int>,
|
||||||
|
// A list of floats, e.g. (12.3,4.)
|
||||||
|
std::vector<double>,
|
||||||
|
// A list of strings, e.g. ('Ifc','Open','Shell')
|
||||||
|
std::vector<std::string>,
|
||||||
|
// An enumeration argument, e.g. .USERDEFINED.
|
||||||
|
// To initialize the argument a string representation
|
||||||
|
// has to be explicitely passed of the enumeration value
|
||||||
|
// which is stored internally as an integer. The argument
|
||||||
|
// itself does not keep track of what schema enumeration
|
||||||
|
// type is represented.
|
||||||
|
EnumerationReference,
|
||||||
|
// An entity instance argument. It will either serialize to
|
||||||
|
// e.g. #123 or datatype identifier for simple types, e.g.
|
||||||
|
// IFCREAL(12.3)
|
||||||
|
IfcUtil::IfcSchemaEntity,
|
||||||
|
// An entity list argument. It will either serialize to
|
||||||
|
// e.g. (#1,#2,#3) or datatype identifier for simple types,
|
||||||
|
// e.g. (IFCREAL(1.2),IFCINTEGER(3.))
|
||||||
|
IfcEntities
|
||||||
|
> container;
|
||||||
|
public:
|
||||||
|
enum argument_type {
|
||||||
|
argument_type_null,
|
||||||
|
argument_type_derived,
|
||||||
|
argument_type_int,
|
||||||
|
argument_type_bool,
|
||||||
|
argument_type_double,
|
||||||
|
argument_type_string,
|
||||||
|
argument_type_vector_int,
|
||||||
|
argument_type_vector_double,
|
||||||
|
argument_type_vector_string,
|
||||||
|
argument_type_enumeration,
|
||||||
|
argument_type_schema_entity,
|
||||||
|
argument_type_entities
|
||||||
|
};
|
||||||
IfcWriteArgument(IfcAbstractEntity* e) : entity(e) {}
|
IfcWriteArgument(IfcAbstractEntity* e) : entity(e) {}
|
||||||
};
|
template <typename T> const T& as() const {
|
||||||
|
if (const T* val = boost::get<T>(&container)) {
|
||||||
/// A null argument. It will always serialize to $
|
return *val;
|
||||||
class IfcWriteNullArgument : public IfcWriteArgument {
|
} else {
|
||||||
public:
|
throw IfcParse::IfcException("Invalid cast");
|
||||||
IfcWriteNullArgument(IfcAbstractEntity* e) : IfcWriteArgument(e) {};
|
}
|
||||||
|
}
|
||||||
|
template <typename T> void set(const T& t) {
|
||||||
|
container = t;
|
||||||
|
}
|
||||||
operator int() const;
|
operator int() const;
|
||||||
operator bool() const;
|
operator bool() const;
|
||||||
operator double() const;
|
operator double() const;
|
||||||
@@ -57,107 +127,7 @@ namespace IfcWrite {
|
|||||||
ArgumentPtr operator [] (unsigned int i) const;
|
ArgumentPtr operator [] (unsigned int i) const;
|
||||||
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;
|
||||||
|
|
||||||
/// A derived argument. It will always serialize to *
|
|
||||||
class IfcWriteDerivedArgument : public IfcWriteArgument {
|
|
||||||
public:
|
|
||||||
IfcWriteDerivedArgument(IfcAbstractEntity* e) : IfcWriteArgument(e) {};
|
|
||||||
operator int() const;
|
|
||||||
operator bool() const;
|
|
||||||
operator double() const;
|
|
||||||
operator std::string() const;
|
|
||||||
operator std::vector<double>() const;
|
|
||||||
operator std::vector<int>() const;
|
|
||||||
operator std::vector<std::string>() const;
|
|
||||||
operator IfcUtil::IfcSchemaEntity() const;
|
|
||||||
operator IfcEntities() const;
|
|
||||||
bool isNull() const;
|
|
||||||
ArgumentPtr operator [] (unsigned int i) const;
|
|
||||||
std::string toString(bool upper=false) const;
|
|
||||||
unsigned int Size() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
/// An entity list argument. It will serialize to (#1,#2,#3)
|
|
||||||
/// with possibly a datatype identifier for SELECT types, e.g:
|
|
||||||
/// (IFCREAL(1.0),IFCINTEGER(1))
|
|
||||||
class IfcWriteEntityListArgument : public IfcWriteArgument {
|
|
||||||
private:
|
|
||||||
IfcEntities value;
|
|
||||||
public:
|
|
||||||
IfcWriteEntityListArgument(IfcAbstractEntity* e, const IfcEntities& v);
|
|
||||||
operator int() const;
|
|
||||||
operator bool() const;
|
|
||||||
operator double() const;
|
|
||||||
operator std::string() const;
|
|
||||||
operator std::vector<double>() const;
|
|
||||||
operator std::vector<int>() const;
|
|
||||||
operator std::vector<std::string>() const;
|
|
||||||
operator IfcUtil::IfcSchemaEntity() const;
|
|
||||||
operator IfcEntities() const;
|
|
||||||
bool isNull() const;
|
|
||||||
unsigned int Size() const;
|
|
||||||
ArgumentPtr operator [] (unsigned int i) const;
|
|
||||||
std::string toString(bool upper=false) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
/// An enumeration argument. It will serialize to e.g:
|
|
||||||
/// .USERDEFINED. To initialize the argument a string representation
|
|
||||||
/// has to be explicitely passed of the enumeration value which
|
|
||||||
/// is stored internally as an integer. The argument itself
|
|
||||||
/// does not keep track of what schema enumeration type is
|
|
||||||
/// represented.
|
|
||||||
class IfcWriteEnumerationArgument : public IfcWriteArgument {
|
|
||||||
private:
|
|
||||||
int data;
|
|
||||||
const char* enumeration_value;
|
|
||||||
public:
|
|
||||||
IfcWriteEnumerationArgument(IfcAbstractEntity* e, int v, const char* c);
|
|
||||||
operator int() const;
|
|
||||||
operator bool() const;
|
|
||||||
operator double() const;
|
|
||||||
operator std::string() const;
|
|
||||||
operator std::vector<double>() const;
|
|
||||||
operator std::vector<int>() const;
|
|
||||||
operator std::vector<std::string>() const;
|
|
||||||
operator IfcUtil::IfcSchemaEntity() const;
|
|
||||||
operator IfcEntities() const;
|
|
||||||
bool isNull() const;
|
|
||||||
ArgumentPtr operator [] (unsigned int i) const;
|
|
||||||
std::string toString(bool upper=false) const;
|
|
||||||
unsigned int Size() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
/// An argument for all remaining types of arguments. For example:
|
|
||||||
/// #123 | 1 | 'Value' | (1.0,2.0,3.0). All data is casted to a
|
|
||||||
/// void pointer.
|
|
||||||
class IfcWriteIntegralArgument : public IfcWriteArgument {
|
|
||||||
private:
|
|
||||||
void* data;
|
|
||||||
IfcUtil::ArgumentType type;
|
|
||||||
public:
|
|
||||||
IfcWriteIntegralArgument(IfcAbstractEntity* e, int v);
|
|
||||||
IfcWriteIntegralArgument(IfcAbstractEntity* e, bool v);
|
|
||||||
IfcWriteIntegralArgument(IfcAbstractEntity* e, double v);
|
|
||||||
IfcWriteIntegralArgument(IfcAbstractEntity* e, const std::string& v);
|
|
||||||
IfcWriteIntegralArgument(IfcAbstractEntity* e, const std::vector<int> v);
|
|
||||||
IfcWriteIntegralArgument(IfcAbstractEntity* e, const std::vector<double> v);
|
|
||||||
IfcWriteIntegralArgument(IfcAbstractEntity* e, const std::vector<std::string> v);
|
|
||||||
IfcWriteIntegralArgument(IfcAbstractEntity* e, IfcUtil::IfcSchemaEntity v);
|
|
||||||
~IfcWriteIntegralArgument();
|
|
||||||
operator int() const;
|
|
||||||
operator bool() const;
|
|
||||||
operator double() const;
|
|
||||||
operator std::string() const;
|
|
||||||
operator std::vector<double>() const;
|
|
||||||
operator std::vector<int>() const;
|
|
||||||
operator std::vector<std::string>() const;
|
|
||||||
operator IfcUtil::IfcSchemaEntity() const;
|
|
||||||
operator IfcEntities() const;
|
|
||||||
bool isNull() const;
|
|
||||||
unsigned int Size() const;
|
|
||||||
ArgumentPtr operator [] (unsigned int i) const;
|
|
||||||
std::string toString(bool upper=false) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// An entity to help with passing of SELECT arguments that
|
/// An entity to help with passing of SELECT arguments that
|
||||||
@@ -199,8 +169,6 @@ namespace IfcWrite {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/// A helper class for the creation of IFC GlobalIds.
|
/// A helper class for the creation of IFC GlobalIds.
|
||||||
/// At this moment an actual UUID is not generated according to
|
|
||||||
/// the ISO standard, but merely a sequence of random characters.
|
|
||||||
class IfcGuidHelper {
|
class IfcGuidHelper {
|
||||||
private:
|
private:
|
||||||
std::string data;
|
std::string data;
|
||||||
|
|||||||
Reference in New Issue
Block a user