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

Method drawMruInnerFormats_

source/MRViewer/MRViewerSettingsPlugin.cpp:1332–1419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1330}
1331
1332void ViewerSettingsPlugin::drawMruInnerFormats_( float menuWidth )
1333{
1334 drawSeparator_( _t( "MRU Inner Formats" ) );
1335
1336 const std::vector<std::string> meshFormatNames = { "CTM", "PLY", "MRMESH" };
1337 const std::vector<std::string> pointsFormatNames = { meshFormatNames[0], meshFormatNames[1] };
1338 const std::vector<std::string> voxelsFormatNames = { "VDB", "RAW" };
1339
1340 const std::vector<std::string> meshFormatTooltips = { _tr( "Slowest, high memory consumption, but best compression (typically) format" ),
1341 _tr( "Fast and still relatively small format" ),
1342 _tr( "Largest by size, but fastest to load / save and without any losses" ) };
1343 const std::vector<std::string> pointsFormatTooltips = { meshFormatTooltips[0], meshFormatTooltips[1] };
1344 const std::vector<std::string> voxelsFormatTooltips = { _tr( "Fast and efficient format for sparse data" ),
1345 _tr( "Simplest but high disk space consumption format" ) };
1346
1347 std::string format = defaultSerializeMeshFormat();
1348 if ( format == ".ctm" )
1349 mruFormatParameters_.meshFormat = MruFormatParameters::MeshFormat::Ctm;
1350 else if ( format == ".mrmesh" )
1351 mruFormatParameters_.meshFormat = MruFormatParameters::MeshFormat::Mrmesh;
1352 else // format == ".ply"
1353 mruFormatParameters_.meshFormat = MruFormatParameters::MeshFormat::Ply;
1354
1355 format = defaultSerializePointsFormat();
1356 if ( format == ".ctm" )
1357 mruFormatParameters_.pointsFormat = MruFormatParameters::PointsFormat::Ctm;
1358 else // format == ".ply"
1359 mruFormatParameters_.pointsFormat = MruFormatParameters::PointsFormat::Ply;
1360
1361 #ifndef MRVIEWER_NO_VOXELS
1362 format = defaultSerializeVoxelsFormat();
1363 if ( format == ".raw" )
1364 mruFormatParameters_.voxelsFormat = MruFormatParameters::VoxelsFormat::Raw;
1365 else // format == ".vdb"
1366 mruFormatParameters_.voxelsFormat = MruFormatParameters::VoxelsFormat::Vdb;
1367 #endif
1368
1369 ImGui::PushItemWidth( menuWidth * 0.5f );
1370 if ( UI::combo( _tr( "Mesh Format" ), ( int* )&mruFormatParameters_.meshFormat, meshFormatNames, true, meshFormatTooltips ) )
1371 {
1372 switch ( mruFormatParameters_.meshFormat )
1373 {
1374 case MruFormatParameters::MeshFormat::Ctm:
1375 format = ".ctm";
1376 break;
1377 case MruFormatParameters::MeshFormat::Mrmesh:
1378 format = ".mrmesh";
1379 break;
1380 case MruFormatParameters::MeshFormat::Ply:
1381 default:
1382 format = ".ply";
1383 break;
1384 }
1385 setDefaultSerializeMeshFormat( format );
1386 }
1387
1388 if ( UI::combo( _tr( "Points Format" ), ( int* )&mruFormatParameters_.pointsFormat, pointsFormatNames, true, pointsFormatTooltips ) )
1389 {

Callers

nothing calls this directly

Calls 4

comboFunction · 0.85

Tested by

no test coverage detected