mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
Merge remote-tracking branch 'official/master'
Conflicts: src/ifcconvert/IfcConvert.cpp src/ifcgeom/IfcGeomIterator.h
This commit is contained in:
+24
-23
@@ -85,7 +85,7 @@ Argument* IfcWritableEntity::getArgument (unsigned int i) {
|
||||
}
|
||||
return args[i];
|
||||
}
|
||||
unsigned int IfcWritableEntity::getArgumentCount() const {return args.size(); }
|
||||
unsigned int IfcWritableEntity::getArgumentCount() const { return (unsigned)args.size(); }
|
||||
IfcSchema::Type::Enum IfcWritableEntity::type() const { return _type; }
|
||||
bool IfcWritableEntity::is(IfcSchema::Type::Enum v) const { return _type == v; }
|
||||
std::string IfcWritableEntity::toString(bool upper) const {
|
||||
@@ -105,7 +105,6 @@ std::string IfcWritableEntity::toString(bool upper) const {
|
||||
ss << dt << "(";
|
||||
for (std::map<int,Argument*>::const_iterator it = args.begin(); it != args.end(); ++ it) {
|
||||
if ( it != args.begin() ) ss << ",";
|
||||
const Argument* a = it->second;
|
||||
ss << it->second->toString(upper);
|
||||
}
|
||||
ss << ")";
|
||||
@@ -141,7 +140,6 @@ void IfcWritableEntity::setArgument(int i) {
|
||||
}
|
||||
|
||||
void IfcWritableEntity::setArgument(int i, Argument* a) {
|
||||
IfcWrite::IfcWriteArgument* wa = new IfcWrite::IfcWriteArgument(this);
|
||||
IfcUtil::ArgumentType attr_type = a->type();
|
||||
switch(attr_type) {
|
||||
case IfcUtil::Argument_NULL:
|
||||
@@ -183,7 +181,7 @@ void IfcWritableEntity::setArgument(int i, Argument* a) {
|
||||
this->setArgument(i, attr_value); }
|
||||
break;
|
||||
case IfcUtil::Argument_ENUMERATION: {
|
||||
IfcSchema::Type::Enum ty = IfcSchema::Type::GetAttributeEntity(_type, i);
|
||||
IfcSchema::Type::Enum ty = IfcSchema::Type::GetAttributeEntity(_type, (unsigned char)i);
|
||||
std::string enum_literal = a->toString();
|
||||
// Remove leading and trailing '.'
|
||||
enum_literal = enum_literal.substr(1, enum_literal.size() - 2);
|
||||
@@ -292,27 +290,30 @@ void IfcWritableEntity::setArgument(int i,const std::vector< boost::dynamic_bits
|
||||
|
||||
class SizeVisitor : public boost::static_visitor<int> {
|
||||
public:
|
||||
int operator()(const boost::none_t& i) const { return -1; }
|
||||
int operator()(const IfcWriteArgument::Derived& i) const { return -1; }
|
||||
int operator()(const int& i) const { return -1; }
|
||||
int operator()(const bool& i) const { return -1; }
|
||||
int operator()(const double& i) const { return -1; }
|
||||
int operator()(const std::string& i) const { return -1; }
|
||||
int operator()(const boost::dynamic_bitset<>& i) const { return -1; }
|
||||
int operator()(const std::vector<int>& i) const { return i.size(); }
|
||||
int operator()(const std::vector<double>& i) const { return i.size(); }
|
||||
int operator()(const std::vector< std::vector<int> >& i) const { return i.size(); }
|
||||
int operator()(const std::vector< std::vector<double> >& i) const { return i.size(); }
|
||||
int operator()(const std::vector<std::string>& i) const { return i.size(); }
|
||||
int operator()(const std::vector< boost::dynamic_bitset<> >& i) const { return i.size(); }
|
||||
int operator()(const IfcWriteArgument::EnumerationReference& i) const { return -1; }
|
||||
int operator()(const IfcUtil::IfcBaseClass* const& i) const { return -1; }
|
||||
int operator()(const boost::none_t& /*i*/) const { return -1; }
|
||||
int operator()(const IfcWriteArgument::Derived& /*i*/) const { return -1; }
|
||||
int operator()(const int& /*i*/) const { return -1; }
|
||||
int operator()(const bool& /*i*/) const { return -1; }
|
||||
int operator()(const double& /*i*/) const { return -1; }
|
||||
int operator()(const std::string& /*i*/) const { return -1; }
|
||||
int operator()(const boost::dynamic_bitset<>& /*i*/) const { return -1; }
|
||||
int operator()(const std::vector<int>& i) const { return (int)i.size(); }
|
||||
int operator()(const std::vector<double>& i) const { return (int)i.size(); }
|
||||
int operator()(const std::vector< std::vector<int> >& i) const { return (int)i.size(); }
|
||||
int operator()(const std::vector< std::vector<double> >& i) const { return (int)i.size(); }
|
||||
int operator()(const std::vector<std::string>& i) const { return (int)i.size(); }
|
||||
int operator()(const std::vector< boost::dynamic_bitset<> >& i) const { return (int)i.size(); }
|
||||
int operator()(const IfcWriteArgument::EnumerationReference& /*i*/) const { return -1; }
|
||||
int operator()(const IfcUtil::IfcBaseClass* const& /*i*/) const { return -1; }
|
||||
int operator()(const IfcEntityList::ptr& i) const { return i->size(); }
|
||||
int operator()(const IfcEntityListList::ptr& i) const { return i->size(); }
|
||||
};
|
||||
|
||||
class StringBuilderVisitor : public boost::static_visitor<void> {
|
||||
private:
|
||||
StringBuilderVisitor(const StringBuilderVisitor&); //N/A
|
||||
StringBuilderVisitor& operator =(const StringBuilderVisitor&); //N/A
|
||||
|
||||
std::ostringstream& data;
|
||||
template <typename T> void serialize(const std::vector<T>& i) {
|
||||
data << "(";
|
||||
@@ -352,7 +353,7 @@ private:
|
||||
oss.imbue(std::locale::classic());
|
||||
oss.put('"');
|
||||
oss << std::hex << std::setw(1);
|
||||
unsigned c = b.size();
|
||||
unsigned c = (unsigned)b.size();
|
||||
unsigned n = (4 - (c % 4)) & 3;
|
||||
oss << n;
|
||||
for (unsigned i = 0; i < c + n;) {
|
||||
@@ -371,8 +372,8 @@ private:
|
||||
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 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); }
|
||||
@@ -502,7 +503,7 @@ IfcWriteArgument::operator std::vector< std::vector<int> >() const { return as<s
|
||||
IfcWriteArgument::operator std::vector< std::vector<double> >() const { return as<std::vector< std::vector<double> > >(); }
|
||||
IfcWriteArgument::operator IfcEntityListList::ptr() const { throw; }
|
||||
bool IfcWriteArgument::isNull() const { return type() == IfcUtil::Argument_NULL; }
|
||||
Argument* IfcWriteArgument::operator [] (unsigned int i) const { throw IfcParse::IfcException("Invalid cast"); }
|
||||
Argument* IfcWriteArgument::operator [] (unsigned int /*i*/) const { throw IfcParse::IfcException("Invalid cast"); }
|
||||
std::string IfcWriteArgument::toString(bool upper) const {
|
||||
std::ostringstream str;
|
||||
str.imbue(std::locale::classic());
|
||||
|
||||
Reference in New Issue
Block a user