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

Function getFeatureNormal

source/MRMesh/MRFeatureHelpers.cpp:37–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37std::optional<Vector3f> getFeatureNormal( FeatureObject* feature )
38{
39 std::optional <Vector3f> normal;
40 [[maybe_unused]] bool ok = forEachObjectKind( [&] ( auto thisKind )
41 {
42 if constexpr ( HasGetNormalMethod<typename ObjKindTraits<thisKind.value>::type> )
43 {
44 auto obj = dynamic_cast< typename ObjKindTraits<thisKind.value>::type* >( feature );
45 if ( obj )
46 {
47 normal = obj->getNormal();
48 return true;
49 }
50 }
51 return false;
52 } );
53 return normal;
54}
55
56std::optional <Vector3f> getFeatureDirection( FeatureObject* feature )
57{

Callers

nothing calls this directly

Calls 2

forEachObjectKindFunction · 0.85
getNormalMethod · 0.45

Tested by

no test coverage detected