MCPcopy Create free account
hub / github.com/ThatOpen/engine_web-ifc / GetLocalPlacement

Method GetLocalPlacement

src/cpp/web-ifc/geometry/IfcGeometryLoader.cpp:3853–4198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3851 }
3852
3853 glm::dmat4 IfcGeometryLoader::GetLocalPlacement(uint32_t expressID, glm::dvec3 vector) const
3854 {
3855 if (_cache.GetExpressIDToPlacement().contains(expressID))
3856 {
3857 return _cache.GetExpressIDToPlacement()[expressID];
3858 }
3859 else
3860 {
3861 spdlog::debug("[GetLocalPlacement({})]", expressID);
3862 auto lineType = _loader.GetLineType(expressID);
3863 switch (lineType)
3864 {
3865 case schema::IFCPOINTBYDISTANCEEXPRESSION:
3866 {
3867 // IfcPointByDistanceExpression : public IfcPoint
3868 // IfcCurveMeasureSelect DistanceAlong;
3869 // IfcLengthMeasure OffsetLateral; //optional
3870 // IfcLengthMeasure OffsetVertical; //optional
3871 // IfcLengthMeasure OffsetLongitudinal; //optional
3872 // IfcCurve BasisCurve;
3873
3874 _loader.MoveToArgumentOffset(expressID, 0);
3875 IfcCurve curve;
3876 double DistanceAlong = 0;
3877 double OffsetLateral = 0;
3878 double OffsetVertical = 0;
3879 double OffsetLongitudinal = 0;
3880
3881 if (_loader.GetTokenType() != parsing::IfcTokenType::EMPTY)
3882 {
3883 _loader.StepBack();
3884 DistanceAlong = ReadLenghtMeasure();
3885 }
3886
3887 _loader.MoveToArgumentOffset(expressID, 2);
3888 auto tokenTypeOffsetLateral = _loader.GetTokenType();
3889 if (tokenTypeOffsetLateral == parsing::LABEL)
3890 {
3891 OffsetLateral = ReadLenghtMeasure();
3892 }
3893 else if (tokenTypeOffsetLateral == parsing::REAL)
3894 {
3895 _loader.StepBack();
3896 OffsetLateral = _loader.GetDoubleArgument();
3897 }
3898
3899 _loader.MoveToArgumentOffset(expressID, 3);
3900 auto tokenTypeOffsetVertical = _loader.GetTokenType();
3901 if (tokenTypeOffsetVertical == parsing::LABEL)
3902 {
3903 OffsetVertical = ReadLenghtMeasure();
3904 }
3905 else if (tokenTypeOffsetVertical == parsing::REAL)
3906 {
3907 _loader.StepBack();
3908 OffsetVertical = _loader.GetDoubleArgument();
3909 }
3910

Callers 3

GetWorldTransformMatrixFunction · 0.80
GetMeshMethod · 0.80
GetSurfaceMethod · 0.80

Calls 10

debugFunction · 0.85
errorFunction · 0.85
MoveToArgumentOffsetMethod · 0.80
GetTokenTypeMethod · 0.80
StepBackMethod · 0.80
GetDoubleArgumentMethod · 0.80
GetRefArgumentMethod · 0.80
containsMethod · 0.45
GetLineTypeMethod · 0.45

Tested by

no test coverage detected