diff --git a/src/examples/IfcOpenHouse.cpp b/src/examples/IfcOpenHouse.cpp index 12acd5e6de..cb96d92022 100644 --- a/src/examples/IfcOpenHouse.cpp +++ b/src/examples/IfcOpenHouse.cpp @@ -258,7 +258,7 @@ int main(int argc, char** argv) { IfcEntityList::ptr geometrical_entities(new IfcEntityList); IfcSchema::IfcProductDefinitionShape* ground_representation = IfcGeom::tesselate(shape, 100., geometrical_entities); file.getSingle()->setRepresentation(ground_representation); - file.AddEntities(geometrical_entities); + file.addEntities(geometrical_entities); IfcSchema::IfcShapeRepresentation::list::ptr ground_reps = geometrical_entities->as(); for (IfcSchema::IfcShapeRepresentation::list::it it = ground_reps->begin(); it != ground_reps->end(); ++it) { (*it)->setContextOfItems(file.getRepresentationContext("Model")); @@ -313,9 +313,9 @@ int main(int argc, char** argv) { null, null, #ifdef USE_IFC4 - file.EntitiesByType()->generalize(), + file.entitiesByType()->generalize(), #else - file.EntitiesByType()->as(), + file.entitiesByType()->as(), #endif layer_usage); diff --git a/src/examples/IfcParseExamples.cpp b/src/examples/IfcParseExamples.cpp index 2441565fc1..342a6e8674 100644 --- a/src/examples/IfcParseExamples.cpp +++ b/src/examples/IfcParseExamples.cpp @@ -40,7 +40,7 @@ int main(int argc, char** argv) { // Lets get a list of IfcBuildingElements, this is the parent // type of things like walls, windows and doors. - // EntitiesByType is a templated function and returns a + // entitiesByType is a templated function and returns a // templated class that behaves like a std::vector. // Note that the return types are all typedef'ed as members of // the generated classes, ::list for the templated vector class, @@ -54,7 +54,7 @@ int main(int argc, char** argv) { // we need to cast them to IfcWindows. Since these properties // are optional we need to make sure the properties are // defined for the window in question before accessing them. - IfcBuildingElement::list::ptr elements = file.EntitiesByType(); + IfcBuildingElement::list::ptr elements = file.entitiesByType(); std::cout << "Found " << elements->size() << " elements in " << argv[1] << ":" << std::endl; diff --git a/src/examples/arbitrary_open_profile_def.cpp b/src/examples/arbitrary_open_profile_def.cpp index 08f82dd547..20ae1bb561 100644 --- a/src/examples/arbitrary_open_profile_def.cpp +++ b/src/examples/arbitrary_open_profile_def.cpp @@ -116,7 +116,7 @@ int main(int argc, char** argv) { IfcSchema::IfcCartesianPoint::list points (new IfcTemplatedEntityList()); points->push(new IfcSchema::IfcCartesianPoint(std::vector(coords1, coords1+2))); points->push(new IfcSchema::IfcCartesianPoint(std::vector(coords2, coords2+2))); - file.AddEntities(points->generalize()); + file.addEntities(points->generalize()); IfcSchema::IfcPolyline* poly = new IfcSchema::IfcPolyline(points); file.addEntity(poly); diff --git a/src/examples/composite_profile_def.cpp b/src/examples/composite_profile_def.cpp index 63f49500c9..8e495e9231 100644 --- a/src/examples/composite_profile_def.cpp +++ b/src/examples/composite_profile_def.cpp @@ -79,7 +79,7 @@ int main(int argc, char** argv) { profiles->push(p6); profiles->push(p4); - file.AddEntities(profiles->generalize()); + file.addEntities(profiles->generalize()); IfcSchema::IfcCompositeProfileDef* composite = new IfcSchema::IfcCompositeProfileDef(IfcSchema::IfcProfileTypeEnum::IfcProfileType_AREA, S("IFC"), profiles, null); diff --git a/src/examples/ellipse_pies.cpp b/src/examples/ellipse_pies.cpp index 1d70842588..eeef6cc7f3 100644 --- a/src/examples/ellipse_pies.cpp +++ b/src/examples/ellipse_pies.cpp @@ -62,7 +62,7 @@ void create_testcase_for(IfcHierarchyHelper& file, const EllipsePie& pie, Ifc2x3 points->push(p3); points->push(p1); points->push(p2); - file.AddEntities(points->generalize()); + file.addEntities(points->generalize()); Ifc2x3::IfcEllipse* ellipse = new Ifc2x3::IfcEllipse(file.addPlacement2d(), pie.r1, pie.r2); @@ -88,7 +88,7 @@ void create_testcase_for(IfcHierarchyHelper& file, const EllipsePie& pie, Ifc2x3 segments->push(s1); segments->push(s2); - file.AddEntities(segments->generalize()); + file.addEntities(segments->generalize()); Ifc2x3::IfcCompositeCurve* ccurve = new Ifc2x3::IfcCompositeCurve(segments, false); Ifc2x3::IfcArbitraryClosedProfileDef* profile = new Ifc2x3::IfcArbitraryClosedProfileDef(Ifc2x3::IfcProfileTypeEnum::IfcProfileType_AREA, null, ccurve); diff --git a/src/ifcconvert/XmlSerializer.cpp b/src/ifcconvert/XmlSerializer.cpp index 8cd52d81b5..31f1286afa 100644 --- a/src/ifcconvert/XmlSerializer.cpp +++ b/src/ifcconvert/XmlSerializer.cpp @@ -201,7 +201,7 @@ void format_properties(IfcProperty::list::ptr properties, ptree& node) { void XmlSerializer::finalize() { argument_name_map.insert(std::make_pair("GlobalId", "id")); - IfcProject::list::ptr projects = file->EntitiesByType(); + IfcProject::list::ptr projects = file->entitiesByType(); if (projects->size() != 1) { Logger::Message(Logger::LOG_ERROR, "Expected a single IfcProject"); return; @@ -234,7 +234,7 @@ void XmlSerializer::finalize() { descend(project, decomposition); // Write all property sets and values as XML nodes. - IfcPropertySet::list::ptr psets = file->EntitiesByType(); + IfcPropertySet::list::ptr psets = file->entitiesByType(); for (IfcPropertySet::list::it it = psets->begin(); it != psets->end(); ++it) { IfcPropertySet* pset = *it; ptree& node = format_entity_instance(pset, properties); diff --git a/src/ifcgeom/IfcGeomIterator.h b/src/ifcgeom/IfcGeomIterator.h index a2fbbf64b5..8bb210115b 100644 --- a/src/ifcgeom/IfcGeomIterator.h +++ b/src/ifcgeom/IfcGeomIterator.h @@ -110,7 +110,7 @@ namespace IfcGeom { P unit_magnitude; void initUnits() { - IfcSchema::IfcProject::list::ptr projects = ifc_file->EntitiesByType(); + IfcSchema::IfcProject::list::ptr projects = ifc_file->entitiesByType(); if (projects->size() == 1) { IfcSchema::IfcProject* project = *projects->begin(); std::pair length_unit = kernel.initializeUnits(project->UnitsInContext()); @@ -165,7 +165,7 @@ namespace IfcGeom { IfcSchema::IfcGeometricRepresentationContext::list::it it; IfcSchema::IfcGeometricRepresentationSubContext::list::it jt; IfcSchema::IfcGeometricRepresentationContext::list::ptr contexts = - ifc_file->EntitiesByType(); + ifc_file->entitiesByType(); IfcSchema::IfcGeometricRepresentationContext::list::ptr filtered_contexts (new IfcSchema::IfcGeometricRepresentationContext::list); @@ -384,7 +384,7 @@ namespace IfcGeom { std::string instance_type, product_name, product_guid; try { - const IfcUtil::IfcBaseClass* ifc_entity = ifc_file->EntityById(id); + const IfcUtil::IfcBaseClass* ifc_entity = ifc_file->entityById(id); instance_type = IfcSchema::Type::ToString(ifc_entity->type()); if ( ifc_entity->is(IfcSchema::Type::IfcProduct) ) { IfcSchema::IfcProduct* ifc_product = (IfcSchema::IfcProduct*)ifc_entity; diff --git a/src/ifcgeom/IfcGeomRepresentation.h b/src/ifcgeom/IfcGeomRepresentation.h index f6d3e9900b..7e5066cf0b 100644 --- a/src/ifcgeom/IfcGeomRepresentation.h +++ b/src/ifcgeom/IfcGeomRepresentation.h @@ -147,7 +147,7 @@ namespace IfcGeom { } catch(...) { // TODO: Catch outside - // Logger::Message(Logger::LOG_ERROR,"Failed to triangulate shape:",ifc_file->EntityById(_id)->entity); + // Logger::Message(Logger::LOG_ERROR,"Failed to triangulate shape:",ifc_file->entityById(_id)->entity); Logger::Message(Logger::LOG_ERROR,"Failed to triangulate shape"); continue; } diff --git a/src/ifcparse/IfcFile.h b/src/ifcparse/IfcFile.h index 0d3601c36b..d40c6023a1 100644 --- a/src/ifcparse/IfcFile.h +++ b/src/ifcparse/IfcFile.h @@ -65,17 +65,19 @@ public: IfcFile(bool create_latebound_entities = false); ~IfcFile(); - /// Returns the first entity in the file, this probably is the entity with the lowest id (EXPRESS ENTITY_INSTANCE_NAME) + /// Returns the first entity in the file, this probably is the entity + /// with the lowest id (EXPRESS ENTITY_INSTANCE_NAME) const_iterator begin() const; - /// Returns the last entity in the file, this probably is the entity with the highes id (EXPRESS ENTITY_INSTANCE_NAME) + /// Returns the last entity in the file, this probably is the entity + /// with the highest id (EXPRESS ENTITY_INSTANCE_NAME) const_iterator end() const; /// Returns all entities in the file that match the template argument. /// NOTE: This also returns subtypes of the requested type, for example: /// IfcWall will also return IfcWallStandardCase entities template - typename T::list::ptr EntitiesByType() { - IfcEntityList::ptr untyped_list = EntitiesByType(T::Class()); + typename T::list::ptr entitiesByType() { + IfcEntityList::ptr untyped_list = entitiesByType(T::Class()); if (untyped_list) { return untyped_list->as(); } else { @@ -86,21 +88,21 @@ public: /// Returns all entities in the file that match the positional argument. /// NOTE: This also returns subtypes of the requested type, for example: /// IfcWall will also return IfcWallStandardCase entities - IfcEntityList::ptr EntitiesByType(IfcSchema::Type::Enum t); + IfcEntityList::ptr entitiesByType(IfcSchema::Type::Enum t); /// Returns all entities in the file that match the positional argument. /// NOTE: This also returns subtypes of the requested type, for example: /// IfcWall will also return IfcWallStandardCase entities - IfcEntityList::ptr EntitiesByType(const std::string& t); + IfcEntityList::ptr entitiesByType(const std::string& t); /// Returns all entities in the file that reference the id - IfcEntityList::ptr EntitiesByReference(int id); + IfcEntityList::ptr entitiesByReference(int id); /// Returns the entity with the specified id - IfcUtil::IfcBaseClass* EntityById(int id); + IfcUtil::IfcBaseClass* entityById(int id); /// Returns the entity with the specified GlobalId - IfcSchema::IfcRoot* EntityByGuid(const std::string& guid); + IfcSchema::IfcRoot* entityByGuid(const std::string& guid); /// Performs a depth-first traversal, returning all entity instance /// attributes as a flat list. NB: includes the root instance specified @@ -117,7 +119,7 @@ public: unsigned int FreshId() { return ++MaxId; } IfcUtil::IfcBaseClass* addEntity(IfcUtil::IfcBaseClass* entity); - void AddEntities(IfcEntityList::ptr es); + void addEntities(IfcEntityList::ptr es); void removeEntity(IfcUtil::IfcBaseClass* entity); diff --git a/src/ifcparse/IfcHierarchyHelper.h b/src/ifcparse/IfcHierarchyHelper.h index 3cb4bcb5e2..efa9fdd38f 100644 --- a/src/ifcparse/IfcHierarchyHelper.h +++ b/src/ifcparse/IfcHierarchyHelper.h @@ -58,7 +58,7 @@ public: template T* getSingle() { - typename T::list::ptr ts = EntitiesByType(); + typename T::list::ptr ts = entitiesByType(); if (ts->size() != 1) return 0; return *ts->begin(); } @@ -79,7 +79,7 @@ public: void addRelatedObject(IfcSchema::IfcObjectDefinition* related_object, IfcSchema::IfcObjectDefinition* relating_object, IfcSchema::IfcOwnerHistory* owner_hist = 0) { - typename T::list::ptr li = EntitiesByType(); + typename T::list::ptr li = entitiesByType(); bool found = false; for (typename T::list::it i = li->begin(); i != li->end(); ++i) { T* rel = *i; @@ -175,7 +175,7 @@ template <> inline void IfcHierarchyHelper::addRelatedObject (IfcSchema::IfcObjectDefinition* related_object, IfcSchema::IfcObjectDefinition* relating_object, IfcSchema::IfcOwnerHistory* owner_hist) { - IfcSchema::IfcRelContainedInSpatialStructure::list::ptr li = EntitiesByType(); + IfcSchema::IfcRelContainedInSpatialStructure::list::ptr li = entitiesByType(); bool found = false; for (IfcSchema::IfcRelContainedInSpatialStructure::list::it i = li->begin(); i != li->end(); ++i) { IfcSchema::IfcRelContainedInSpatialStructure* rel = *i; diff --git a/src/ifcparse/IfcParse.cpp b/src/ifcparse/IfcParse.cpp index 6af6ba0537..59a974c8a1 100644 --- a/src/ifcparse/IfcParse.cpp +++ b/src/ifcparse/IfcParse.cpp @@ -635,7 +635,7 @@ TokenArgument::operator std::string() const { return TokenFunc::asString(token); TokenArgument::operator std::vector() const { throw IfcException("Argument is not a list of floats"); } TokenArgument::operator std::vector() const { throw IfcException("Argument is not a list of ints"); } TokenArgument::operator std::vector() const { throw IfcException("Argument is not a list of strings"); } -TokenArgument::operator IfcUtil::IfcBaseClass*() const { return token.first->file->EntityById(TokenFunc::asInt(token)); } +TokenArgument::operator IfcUtil::IfcBaseClass*() const { return token.first->file->entityById(TokenFunc::asInt(token)); } TokenArgument::operator IfcEntityList::ptr() const { throw IfcException("Argument is not a list of entities"); } TokenArgument::operator IfcEntityListList::ptr() const { throw IfcException("Argument is not a list of entity lists"); } unsigned int TokenArgument::size() const { return 1; } @@ -882,7 +882,7 @@ bool IfcFile::Init(IfcParse::IfcSpfStream* s) { IfcSchema::Type::Enum ty = entity->type(); do { - IfcEntityList::ptr instances_by_type = EntitiesByType(ty); + IfcEntityList::ptr instances_by_type = entitiesByType(ty); if (!instances_by_type) { instances_by_type = IfcEntityList::ptr(new IfcEntityList()); bytype[ty] = instances_by_type; @@ -912,7 +912,7 @@ bool IfcFile::Init(IfcParse::IfcSpfStream* s) { if ( TokenFunc::isOperator(token,'=') ) { currentId = id; } else if (entity) { - IfcEntityList::ptr instances_by_ref = EntitiesByReference(id); + IfcEntityList::ptr instances_by_ref = entitiesByReference(id); if (!instances_by_ref) { instances_by_ref = IfcEntityList::ptr(new IfcEntityList()); byref[id] = instances_by_ref; @@ -963,7 +963,7 @@ IfcEntityList::ptr IfcFile::traverse(IfcUtil::IfcBaseClass* instance, int max_le return return_value; } -void IfcFile::AddEntities(IfcEntityList::ptr es) { +void IfcFile::addEntities(IfcEntityList::ptr es) { for( IfcEntityList::it i = es->begin(); i != es->end(); ++ i ) { addEntity(*i); } @@ -1078,7 +1078,7 @@ IfcUtil::IfcBaseClass* IfcFile::addEntity(IfcUtil::IfcBaseClass* entity) { // The mapping by entity type is updated. IfcSchema::Type::Enum ty = entity->type(); do { - IfcEntityList::ptr instances_by_type = EntitiesByType(ty); + IfcEntityList::ptr instances_by_type = entitiesByType(ty); if (!instances_by_type) { instances_by_type = IfcEntityList::ptr(new IfcEntityList()); bytype[ty] = instances_by_type; @@ -1113,7 +1113,7 @@ IfcUtil::IfcBaseClass* IfcFile::addEntity(IfcUtil::IfcBaseClass* entity) { try { if (!IfcSchema::Type::IsSimple(entity_attribute->type())) { unsigned entity_attribute_id = entity_attribute->entity->id(); - IfcEntityList::ptr refs = EntitiesByReference(entity_attribute_id); + IfcEntityList::ptr refs = entitiesByReference(entity_attribute_id); if (!refs) { refs = IfcEntityList::ptr(new IfcEntityList); byref[entity_attribute_id] = refs; @@ -1138,7 +1138,7 @@ IfcWrite::IfcWritableEntity* make_writable(IfcUtil::IfcBaseClass* instance) { void IfcFile::removeEntity(IfcUtil::IfcBaseClass* entity) { const unsigned id = entity->entity->id(); - IfcUtil::IfcBaseClass* file_entity = EntityById(id); + IfcUtil::IfcBaseClass* file_entity = entityById(id); // TODO: Create a set of weak relations. Inverse relations that do not dictate an // instance to be retained. For example: when deleting an IfcRepresentation, the @@ -1152,7 +1152,7 @@ void IfcFile::removeEntity(IfcUtil::IfcBaseClass* entity) { } std::set deletion_queue; - IfcEntityList::ptr references = EntitiesByReference(id); + IfcEntityList::ptr references = entitiesByReference(id); // Alter entity instances with INVERSE relations to the entity being // deleted. This is necessary to maintain a valid IFC file, because @@ -1214,8 +1214,8 @@ void IfcFile::removeEntity(IfcUtil::IfcBaseClass* entity) { for (IfcEntityList::it it = entity_attributes->begin(); it != entity_attributes->end(); ++it) { IfcUtil::IfcBaseClass* entity_attribute = *it; if (entity_attribute == entity) continue; - EntitiesByReference(entity_attribute->entity->id())->remove(entity); - if (EntitiesByReference(entity_attribute->entity->id())->filtered(weak_roots)->size() == 0) { + entitiesByReference(entity_attribute->entity->id())->remove(entity); + if (entitiesByReference(entity_attribute->entity->id())->filtered(weak_roots)->size() == 0) { deletion_queue.insert(entity_attribute); } } @@ -1227,7 +1227,7 @@ void IfcFile::removeEntity(IfcUtil::IfcBaseClass* entity) { byid.erase(byid.find(id)); - IfcEntityList::ptr instances_of_same_type = EntitiesByType(entity->type()); + IfcEntityList::ptr instances_of_same_type = entitiesByType(entity->type()); instances_of_same_type->remove(entity); while (!deletion_queue.empty()) { @@ -1239,23 +1239,23 @@ void IfcFile::removeEntity(IfcUtil::IfcBaseClass* entity) { delete entity; } -IfcEntityList::ptr IfcFile::EntitiesByType(IfcSchema::Type::Enum t) { +IfcEntityList::ptr IfcFile::entitiesByType(IfcSchema::Type::Enum t) { entities_by_type_t::const_iterator it = bytype.find(t); return (it == bytype.end()) ? IfcEntityList::ptr() : it->second; } -IfcEntityList::ptr IfcFile::EntitiesByType(const std::string& t) { +IfcEntityList::ptr IfcFile::entitiesByType(const std::string& t) { std::string ty = t; for (std::string::iterator p = ty.begin(); p != ty.end(); ++p ) *p = toupper(*p); - return EntitiesByType(IfcSchema::Type::FromString(ty)); + return entitiesByType(IfcSchema::Type::FromString(ty)); } -IfcEntityList::ptr IfcFile::EntitiesByReference(int t) { +IfcEntityList::ptr IfcFile::entitiesByReference(int t) { entities_by_ref_t::const_iterator it = byref.find(t); return (it == byref.end()) ? IfcEntityList::ptr() : it->second; } -IfcUtil::IfcBaseClass* IfcFile::EntityById(int id) { +IfcUtil::IfcBaseClass* IfcFile::entityById(int id) { entity_by_id_t::const_iterator it = byid.find(id); if (it == byid.end()) { throw IfcException("Entity not found"); @@ -1263,7 +1263,7 @@ IfcUtil::IfcBaseClass* IfcFile::EntityById(int id) { return it->second; } -IfcSchema::IfcRoot* IfcFile::EntityByGuid(const std::string& guid) { +IfcSchema::IfcRoot* IfcFile::entityByGuid(const std::string& guid) { entity_by_guid_t::const_iterator it = byguid.find(guid); if ( it == byguid.end() ) { throw IfcException("Entity not found"); @@ -1327,10 +1327,10 @@ std::string IfcFile::createTimestamp() const { } IfcEntityList::ptr IfcFile::getInverse(int instance_id, IfcSchema::Type::Enum type, int attribute_index) { - IfcUtil::IfcBaseClass* instance = EntityById(instance_id); + IfcUtil::IfcBaseClass* instance = entityById(instance_id); IfcEntityList::ptr l = IfcEntityList::ptr(new IfcEntityList); - IfcEntityList::ptr all = EntitiesByReference(instance_id); + IfcEntityList::ptr all = entitiesByReference(instance_id); if (!all) return l; for(IfcEntityList::it it = all->begin(); it != all->end(); ++it) { @@ -1378,7 +1378,7 @@ void IfcFile::setDefaultHeaderValues() { std::pair IfcFile::getUnit(IfcSchema::IfcUnitEnum::IfcUnitEnum type) { std::pair return_value((IfcSchema::IfcNamedUnit*)0, 1.); - IfcSchema::IfcProject::list::ptr projects = EntitiesByType(); + IfcSchema::IfcProject::list::ptr projects = entitiesByType(); if (projects->size() == 1) { IfcSchema::IfcProject* project = *projects->begin(); IfcEntityList::ptr units = project->UnitsInContext()->Units(); diff --git a/src/ifcwrap/IfcGeomWrapper.i b/src/ifcwrap/IfcGeomWrapper.i index 1e8654f064..2b705a1cd9 100644 --- a/src/ifcwrap/IfcGeomWrapper.i +++ b/src/ifcwrap/IfcGeomWrapper.i @@ -202,7 +202,7 @@ if (instance->is(IfcSchema::Type::IfcProduct)) { IfcParse::IfcFile* file = instance->entity->file; - IfcSchema::IfcProject::list::ptr projects = file->EntitiesByType(); + IfcSchema::IfcProject::list::ptr projects = file->entitiesByType(); if (projects->size() != 1) { throw IfcParse::IfcException("Not a single IfcProject instance"); } diff --git a/src/ifcwrap/IfcParseWrapper.i b/src/ifcwrap/IfcParseWrapper.i index e0eda4844d..d61b319edf 100644 --- a/src/ifcwrap/IfcParseWrapper.i +++ b/src/ifcwrap/IfcParseWrapper.i @@ -36,8 +36,8 @@ namespace IfcUtil { %ignore IfcParse::IfcLateBoundEntity::IfcLateBoundEntity(IfcAbstractEntity*); %ignore IfcParse::IfcFile::Init; -%ignore IfcParse::IfcFile::EntityById; -%ignore IfcParse::IfcFile::EntityByGuid; +%ignore IfcParse::IfcFile::entityById; +%ignore IfcParse::IfcFile::entityByGuid; %ignore IfcParse::IfcFile::addEntity; %ignore IfcParse::IfcFile::removeEntity; %ignore IfcParse::IfcFile::traverse(IfcUtil::IfcBaseClass*, int); @@ -54,7 +54,7 @@ namespace IfcUtil { %ignore IfcParse::IfcSpfHeader::stream; %ignore IfcParse::HeaderEntity::is; -%rename("by_type") EntitiesByType; +%rename("by_type") entitiesByType; %rename("__len__") getArgumentCount; %rename("get_argument_type") getArgumentType; %rename("get_argument_name") getArgumentName; @@ -180,10 +180,10 @@ namespace IfcUtil { %extend IfcParse::IfcFile { IfcParse::IfcLateBoundEntity* by_id(unsigned id) { - return (IfcParse::IfcLateBoundEntity*) $self->EntityById(id); + return (IfcParse::IfcLateBoundEntity*) $self->entityById(id); } IfcParse::IfcLateBoundEntity* by_guid(const std::string& guid) { - return (IfcParse::IfcLateBoundEntity*) $self->EntityByGuid(guid); + return (IfcParse::IfcLateBoundEntity*) $self->entityByGuid(guid); } IfcParse::IfcLateBoundEntity* add(IfcParse::IfcLateBoundEntity* e) { return (IfcParse::IfcLateBoundEntity*) $self->addEntity(e);