| 1017 | |
| 1018 | template <typename Schema> |
| 1019 | typename Schema::IfcGeometricRepresentationContext* IfcHierarchyHelper<Schema>::getRepresentationContext(const std::string& s) { |
| 1020 | typename std::map<std::string, typename Schema::IfcGeometricRepresentationContext*>::const_iterator iter = contexts_.find(s); |
| 1021 | if (iter != contexts_.end()) { |
| 1022 | return iter->second; |
| 1023 | } |
| 1024 | typename Schema::IfcProject* project = getSingle<typename Schema::IfcProject>(); |
| 1025 | if (!project) { |
| 1026 | project = addProject(); |
| 1027 | } |
| 1028 | auto project_contexts = project->RepresentationContexts(); |
| 1029 | typename Schema::IfcGeometricRepresentationContext* context = new typename Schema::IfcGeometricRepresentationContext( |
| 1030 | boost::none, s, 3, 1e-5, addPlacement3d(), addDoublet<typename Schema::IfcDirection>(0, 1)); |
| 1031 | addEntity(context); |
| 1032 | push_back_to_maybe_optional(project_contexts, context); |
| 1033 | |
| 1034 | project->setRepresentationContexts(project_contexts); |
| 1035 | return contexts_[s] = context; |
| 1036 | } |
| 1037 | |
| 1038 | template <typename Schema> |
| 1039 | typename Schema::IfcGeometricRepresentationSubContext* IfcHierarchyHelper<Schema>::getRepresentationSubContext(const std::string& ident, const std::string& type) { |
no test coverage detected