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

Function pointOnObjectToPickedPoint

source/MRMesh/MRPointOnObject.cpp:14–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12{
13
14PickedPoint pointOnObjectToPickedPoint( const VisualObject* object, const PointOnObject& pos )
15{
16 if ( auto* objMesh = dynamic_cast< const ObjectMeshHolder* >( object ) )
17 return objMesh->mesh()->toTriPoint( pos );
18
19 if ( dynamic_cast< const ObjectPointsHolder* >( object ) )
20 return pos.vert;
21
22 if ( auto* objLines = dynamic_cast< const ObjectLinesHolder* >( object ) )
23 return objLines->polyline()->toEdgePoint( EdgeId( pos.uedge ), pos.point );
24
25 assert( false );
26 return {};
27}
28
29std::optional<Vector3f> getPickedPointPosition( const VisualObject& object, const PickedPoint& point )
30{

Callers 4

onMouseMove_Method · 0.85
setCurrentPositionMethod · 0.85
onMouseDown_Method · 0.85

Calls 2

toTriPointMethod · 0.45
toEdgePointMethod · 0.45

Tested by

no test coverage detected