Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions source/MRMesh/MREnums.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include "MREnums.h"
#include <cassert>

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
5 changes: 5 additions & 0 deletions source/MRMesh/MREnums.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include "MRMeshFwd.h"

namespace MR
{

Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions source/MRMesh/MRMesh.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@
<ClCompile Include="MRDirMax.cpp" />
<ClCompile Include="MRDirMaxBruteForce.cpp" />
<ClCompile Include="MREdgeLengthMesh.cpp" />
<ClCompile Include="MREnums.cpp" />
<ClCompile Include="MRMeshMath.cpp" />
<ClCompile Include="MRMeshOrPointsObject.cpp" />
<ClCompile Include="MRMeshDoubleLayer.cpp" />
Expand Down
3 changes: 3 additions & 0 deletions source/MRMesh/MRMesh.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -2165,6 +2165,9 @@
<ClCompile Include="MROneMeshContours.cpp">
<Filter>Source Files\Contours</Filter>
</ClCompile>
<ClCompile Include="MREnums.cpp">
<Filter>Source Files\Basic</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="..\.editorconfig" />
Expand Down
2 changes: 2 additions & 0 deletions source/MRMesh/MRObjectMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ std::vector<std::string> 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() ) );
Expand Down
Loading