MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / computeDistance

Method computeDistance

source/MRMesh/MRDistanceMeasurementObject.cpp:93–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93float DistanceMeasurementObject::computeDistance() const
94{
95 if ( !cachedValue_ )
96 {
97 int axis = -1;
98 switch ( perCoordDeltas_ )
99 {
100 case DistanceMode::xAbsolute:
101 axis = 0;
102 break;
103 case DistanceMode::yAbsolute:
104 axis = 1;
105 break;
106 case DistanceMode::zAbsolute:
107 axis = 2;
108 break;
109 default:
110 // Nothing.
111 break;
112 }
113 cachedValue_ = ( axis == -1 ? getWorldDelta().length() : std::abs( getWorldDelta()[axis] ) ) * ( isNegative() ? -1.f : 1.f );
114 }
115 return *cachedValue_;
116}
117
118std::vector<std::string> DistanceMeasurementObject::getInfoLines() const
119{

Callers 1

ImGuiMenu.cppFile · 0.80

Calls 3

absFunction · 0.85
isNegativeFunction · 0.85
lengthMethod · 0.45

Tested by

no test coverage detected