MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / getRepresentationContext

Method getRepresentationContext

src/ifcparse/IfcHierarchyHelper.cpp:1019–1036  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1017
1018template <typename Schema>
1019typename 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
1038template <typename Schema>
1039typename Schema::IfcGeometricRepresentationSubContext* IfcHierarchyHelper<Schema>::getRepresentationSubContext(const std::string& ident, const std::string& type) {

Callers 5

create_testcaseFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80

Calls 3

findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected