| 1037 | |
| 1038 | template <typename Schema> |
| 1039 | typename Schema::IfcGeometricRepresentationSubContext* IfcHierarchyHelper<Schema>::getRepresentationSubContext(const std::string& ident, const std::string& type) { |
| 1040 | auto geometric_representation_context = getRepresentationContext(type); // creates the representation context if it doesn't already exist |
| 1041 | |
| 1042 | // search for a subcontext that matches the ContextIdentifier |
| 1043 | auto subcontexts = geometric_representation_context->HasSubContexts(); |
| 1044 | typename Schema::IfcGeometricRepresentationSubContext* rep_subcontext = nullptr; |
| 1045 | for (auto subcontext : *subcontexts) { |
| 1046 | if (subcontext->ContextIdentifier().get_value_or("") == ident) { |
| 1047 | rep_subcontext = subcontext; |
| 1048 | break; // found it, break out of the loop |
| 1049 | } |
| 1050 | } |
| 1051 | |
| 1052 | if (rep_subcontext == nullptr) { |
| 1053 | // didn't find the subcontext, create it |
| 1054 | rep_subcontext = new typename Schema::IfcGeometricRepresentationSubContext(ident, type, geometric_representation_context, boost::none, Schema::IfcGeometricProjectionEnum::IfcGeometricProjection_MODEL_VIEW, boost::none); |
| 1055 | addEntity(rep_subcontext); |
| 1056 | } |
| 1057 | |
| 1058 | return rep_subcontext; |
| 1059 | } |
| 1060 | |
| 1061 | #ifdef HAS_SCHEMA_2x3 |
| 1062 | template IFC_PARSE_API class IfcHierarchyHelper<Ifc2x3>; |
no outgoing calls
no test coverage detected