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

Function addLabel

source/MRViewer/MRViewer.cpp:353–365  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

351}
352
353void addLabel( ObjectMesh& obj, const std::string& str, const Vector3f& pos, bool depthTest )
354{
355 auto label = std::make_shared<ObjectLabel>();
356 label->setFrontColor( Color::white(), false );
357 label->setLabel( { str, pos } );
358 label->setPivotPoint( Vector2f( 0.5f, 0.5f ) );
359 label->setVisualizeProperty( depthTest, VisualizeMaskType::DepthTest, ViewportMask::all() );
360 float fontSize = 20.0f;
361 if ( auto menu = getViewerInstance().getMenuPlugin() )
362 fontSize *= menu->menuScaling();
363 label->setFontHeight( fontSize );
364 obj.addChild( label );
365}
366
367int launchDefaultViewer( const Viewer::LaunchParams& params, const ViewerSetup& setup )
368{

Callers 1

initBasisAxesObject_Method · 0.85

Calls 7

setPivotPointMethod · 0.80
setVisualizePropertyMethod · 0.80
menuScalingMethod · 0.80
setFontHeightMethod · 0.80
addChildMethod · 0.80
setFrontColorMethod · 0.45
setLabelMethod · 0.45

Tested by

no test coverage detected