Track inverse attributes more correctly

Rename Size() to size() on EntityList and friends
This commit is contained in:
Thomas Krijnen
2015-01-10 22:13:52 +00:00
parent 1d319f7ac4
commit 8581fed39b
22 changed files with 396 additions and 402 deletions
+2 -2
View File
@@ -113,7 +113,7 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcFace* l, TopoDS_Shape& face) {
er = mf.Error();
}
if ( er != BRepBuilderAPI_FaceDone ) return false;
if ( bounds->Size() == 1 ) {
if ( bounds->size() == 1 ) {
face = mf.Face();
} else {
for( ++it; it != bounds->end(); ++ it) {
@@ -807,7 +807,7 @@ bool convert_surf(IfcSchema::IfcBSplineSurfaceWithKnots* l, Handle_Geom_Surface&
std::vector<int> umults = l->UMultiplicities();
std::vector<int> vmults = l->VMultiplicities();
TColgp_Array2OfPnt Poles (0, cps->Size() - 1, 0, (*cps->begin()).size() - 1);
TColgp_Array2OfPnt Poles (0, cps->size() - 1, 0, (*cps->begin()).size() - 1);
TColStd_Array1OfReal UKnots(0, uknots.size() - 1);
TColStd_Array1OfReal VKnots(0, vknots.size() - 1);
TColStd_Array1OfInteger UMults(0, umults.size() - 1);
+7 -7
View File
@@ -871,7 +871,7 @@ IfcGeom::BRepElement<P>* IfcGeom::Kernel::create_brep_for_representation_and_pro
const std::string product_type = IfcSchema::Type::ToString(product->type());
ElementSettings element_settings(settings, getValue(GV_LENGTH_UNIT), product_type);
if ( !settings.disable_opening_subtractions() && openings && openings->Size() ) {
if ( !settings.disable_opening_subtractions() && openings && openings->size() ) {
IfcGeom::IfcRepresentationShapeItems opened_shapes;
try {
if ( settings.faster_booleans() ) {
@@ -921,7 +921,7 @@ IfcSchema::IfcObjectDefinition* IfcGeom::Kernel::get_decomposing_entity(IfcSchem
if ( product->is(IfcSchema::Type::IfcOpeningElement ) ) {
IfcSchema::IfcOpeningElement* opening = (IfcSchema::IfcOpeningElement*)product;
IfcSchema::IfcRelVoidsElement::list::ptr voids = opening->VoidsElements();
if ( voids->Size() ) {
if ( voids->size() ) {
IfcSchema::IfcRelVoidsElement* ifc_void = *voids->begin();
parent = ifc_void->RelatingBuildingElement();
}
@@ -929,7 +929,7 @@ IfcSchema::IfcObjectDefinition* IfcGeom::Kernel::get_decomposing_entity(IfcSchem
IfcSchema::IfcElement* element = (IfcSchema::IfcElement*)product;
IfcSchema::IfcRelFillsElement::list::ptr fills = element->FillsVoids();
// Incase of a RelatedBuildingElement parent to the opening element
if ( fills->Size() ) {
if ( fills->size() ) {
for ( IfcSchema::IfcRelFillsElement::list::it it = fills->begin(); it != fills->end(); ++ it ) {
IfcSchema::IfcRelFillsElement* fill = *it;
IfcSchema::IfcObjectDefinition* ifc_objectdef = fill->RelatingOpeningElement();
@@ -940,7 +940,7 @@ IfcSchema::IfcObjectDefinition* IfcGeom::Kernel::get_decomposing_entity(IfcSchem
// Else simply parent to the containing structure
if (!parent) {
IfcSchema::IfcRelContainedInSpatialStructure::list::ptr parents = element->ContainedInStructure();
if ( parents->Size() ) {
if ( parents->size() ) {
IfcSchema::IfcRelContainedInSpatialStructure* container = *parents->begin();
parent = container->RelatingStructure();
}
@@ -948,8 +948,8 @@ IfcSchema::IfcObjectDefinition* IfcGeom::Kernel::get_decomposing_entity(IfcSchem
}
// Parent decompositions to the RelatingObject
if (!parent) {
IfcEntityList::ptr parents = product->entity->getInverse(IfcSchema::Type::IfcRelAggregates);
parents->push(product->entity->getInverse(IfcSchema::Type::IfcRelNests));
IfcEntityList::ptr parents = product->entity->getInverse(IfcSchema::Type::IfcRelAggregates, -1);
parents->push(product->entity->getInverse(IfcSchema::Type::IfcRelNests, -1));
for ( IfcEntityList::it it = parents->begin(); it != parents->end(); ++ it ) {
IfcSchema::IfcRelDecomposes* decompose = (IfcSchema::IfcRelDecomposes*)*it;
IfcSchema::IfcObjectDefinition* ifc_objectdef;
@@ -982,7 +982,7 @@ std::pair<std::string, double> IfcGeom::Kernel::initializeUnits(IfcSchema::IfcUn
try {
IfcEntityList::ptr units = unit_assignment->Units();
if (!units || !units->Size()) {
if (!units || !units->size()) {
Logger::Message(Logger::LOG_ERROR, "No unit information found");
} else {
for ( IfcEntityList::it it = units->begin(); it != units->end(); ++ it ) {
+6 -6
View File
@@ -111,7 +111,7 @@ namespace IfcGeom {
void initUnits() {
IfcSchema::IfcProject::list::ptr projects = ifc_file->EntitiesByType<IfcSchema::IfcProject>();
if (projects->Size() == 1) {
if (projects->size() == 1) {
IfcSchema::IfcProject* project = *projects->begin();
std::pair<std::string, double> length_unit = kernel.initializeUnits(project->UnitsInContext());
unit_name = length_unit.first;
@@ -162,7 +162,7 @@ namespace IfcGeom {
}
}
if (filtered_contexts->Size() == 0) {
if (filtered_contexts->size() == 0) {
filtered_contexts = contexts;
}
@@ -197,7 +197,7 @@ namespace IfcGeom {
kernel.setValue(IfcGeom::Kernel::GV_PRECISION, 1.e-5);
}
if (representations->Size() == 0) return false;
if (representations->size() == 0) return false;
representation_iterator = representations->begin();
entities.reset();
@@ -207,7 +207,7 @@ namespace IfcGeom {
}
done = 0;
total = representations->Size();
total = representations->size();
return true;
}
@@ -267,14 +267,14 @@ namespace IfcGeom {
// IfcProductRepresentation also lacks the INVERSE relation to IfcProduct
// Let's find the IfcProducts that reference the IfcProductRepresentation anyway
IfcEntityList::ptr products = (*it)->entity->getInverse(IfcSchema::Type::IfcProduct);
IfcEntityList::ptr products = (*it)->entity->getInverse(IfcSchema::Type::IfcProduct, -1);
for ( IfcEntityList::it it = products->begin(); it != products->end(); ++ it ) {
entities->push((IfcSchema::IfcProduct*)*it);
}
}
}
// Does this representation have any IfcProducts?
if ( ! entities->Size() ) {
if ( ! entities->size() ) {
_nextShape();
continue;
}
+3 -3
View File
@@ -384,7 +384,7 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcBooleanResult* l, TopoDS_Shape
bool IfcGeom::Kernel::convert(const IfcSchema::IfcConnectedFaceSet* l, TopoDS_Shape& shape) {
IfcSchema::IfcFace::list::ptr faces = l->CfsFaces();
bool facesAdded = false;
const unsigned int num_faces = faces->Size();
const unsigned int num_faces = faces->size();
bool valid_shell = false;
if ( num_faces < getValue(GV_MAX_FACES_TO_SEW) ) {
BRepOffsetAPI_Sewing builder;
@@ -488,7 +488,7 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcMappedItem* l, IfcRepresentati
bool IfcGeom::Kernel::convert(const IfcSchema::IfcShapeRepresentation* l, IfcRepresentationShapeItems& shapes) {
IfcSchema::IfcRepresentationItem::list::ptr items = l->Items();
bool part_succes = false;
if ( items->Size() ) {
if ( items->size() ) {
for ( IfcSchema::IfcRepresentationItem::list::it it = items->begin(); it != items->end(); ++ it ) {
IfcSchema::IfcRepresentationItem* representation_item = *it;
if ( is_shape_collection(representation_item) ) {
@@ -507,7 +507,7 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcShapeRepresentation* l, IfcRep
bool IfcGeom::Kernel::convert(const IfcSchema::IfcGeometricSet* l, IfcRepresentationShapeItems& shapes) {
IfcEntityList::ptr elements = l->Elements();
if ( !elements->Size() ) return false;
if ( !elements->size() ) return false;
bool part_succes = false;
const IfcGeom::SurfaceStyle* parent_style = get_style(l);
for ( IfcEntityList::it it = elements->begin(); it != elements->end(); ++ it ) {