diff --git a/source/MRMesh/MREnums.cpp b/source/MRMesh/MREnums.cpp new file mode 100644 index 000000000000..7138f47bd246 --- /dev/null +++ b/source/MRMesh/MREnums.cpp @@ -0,0 +1,23 @@ +#include "MREnums.h" +#include + +namespace MR +{ + +const char * asString( ColoringType ct ) +{ + switch ( ct ) + { + case ColoringType::SolidColor: + return "SolidColor"; + case ColoringType::PrimitivesColorMap: + return "PrimitivesColorMap"; + case ColoringType::VertsColorMap: + return "VertsColorMap"; + default: + assert( false ); + return ""; + } +} + +} //namespace MR diff --git a/source/MRMesh/MREnums.h b/source/MRMesh/MREnums.h index 258d241b0f1c..51d57152cda9 100644 --- a/source/MRMesh/MREnums.h +++ b/source/MRMesh/MREnums.h @@ -1,5 +1,7 @@ #pragma once +#include "MRMeshFwd.h" + namespace MR { @@ -59,6 +61,9 @@ enum class ColoringType VertsColorMap ///< Use different color (taken from verts colormap) for each vertex }; +/// returns string representation of enum values +[[nodiscard]] MRMESH_API const char * asString( ColoringType ct ); + enum class UseAABBTree : char { No, // AABB-tree of the mesh will not be used, even if it is available diff --git a/source/MRMesh/MRMesh.vcxproj b/source/MRMesh/MRMesh.vcxproj index 725d818db32c..69723d4dc4a7 100644 --- a/source/MRMesh/MRMesh.vcxproj +++ b/source/MRMesh/MRMesh.vcxproj @@ -426,6 +426,7 @@ + diff --git a/source/MRMesh/MRMesh.vcxproj.filters b/source/MRMesh/MRMesh.vcxproj.filters index 8b4e0751bee6..45e52ce3d7e7 100644 --- a/source/MRMesh/MRMesh.vcxproj.filters +++ b/source/MRMesh/MRMesh.vcxproj.filters @@ -2165,6 +2165,9 @@ Source Files\Contours + + Source Files\Basic + diff --git a/source/MRMesh/MRObjectMesh.cpp b/source/MRMesh/MRObjectMesh.cpp index f217dbbc46d2..34130373de11 100644 --- a/source/MRMesh/MRObjectMesh.cpp +++ b/source/MRMesh/MRObjectMesh.cpp @@ -95,6 +95,8 @@ std::vector ObjectMesh::getInfoLines() const for ( TextureId i = TextureId{ 0 }; i < textures_.size(); ++i ) res.push_back( "texture " + std::to_string( i ) + ": " + std::to_string( textures_[i].resolution.x) + " x " + std::to_string(textures_[i].resolution.y)); + res.push_back( std::string( "coloring type: " ) + asString( getColoringType() ) ); + if ( !data_.uvCoordinates.empty() ) { res.push_back( "uv-coords: " + std::to_string( data_.uvCoordinates.size() ) );