Skip to content

Commit

Permalink
alpha for each mesh
Browse files Browse the repository at this point in the history
  • Loading branch information
kerautret committed Oct 8, 2023
1 parent 6922162 commit 65d737f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions visualisation/meshViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ using namespace DGtal;
-z,--scaleZ FLOAT set the scale value in the z direction (default 1.0)
--minLineWidth FLOAT=1.5 set the min line width of the mesh faces (default 1.5)
--customColorMesh UINT ... set the R, G, B, A components of the colors of the mesh faces and eventually the color R, G, B, A of the mesh edge lines (set by default to black).
--customAlphaMesh INT set the alpha components of the colors of the mesh faces.
--customAlphaMesh UINT ... set the alpha components of the colors of the mesh faces (can be applied for each mesh).
--customColorSDP UINT x 4 set the R, G, B, A components of the colors of the sdp view
-f,--displayVectorField TEXT display a vector field from a simple sdp file (two points per line)
--vectorFieldIndex UINT x 6 specify special indices for the two point coordinates (instead usinf the default indices: 0 1, 2, 3, 4, 5)
Expand Down Expand Up @@ -189,7 +189,7 @@ int main( int argc, char** argv )
bool useLastCamSet {false};
bool fixLightToScene {false};
float ambiantLight {0.0};
unsigned int customAlphaMesh {255};
std::vector<unsigned int> customAlphaMesh;

// parse command line using CLI ----------------------------------------------
CLI::App app;
Expand All @@ -204,7 +204,7 @@ int main( int argc, char** argv )
app.add_option("-z,--scaleZ", sz, "set the scale value in the z direction (default 1.0)");
app.add_option("--minLineWidth", lineWidth, "set the min line width of the mesh faces (default 1.5)", true);
app.add_option("--customColorMesh", customColorMesh, "set the R, G, B, A components of the colors of the mesh faces and eventually the color R, G, B, A of the mesh edge lines (set by default to black).");
app.add_option("--customAlphaMesh", customAlphaMesh, "set the alpha components of the colors of the mesh faces.");
app.add_option("--customAlphaMesh", customAlphaMesh, "set the alpha components of the colors of the mesh faces (can be applied for each mesh).");

app.add_option("--customColorSDP", customColorSDP, "set the R, G, B, A components of the colors of the sdp view")
->expected(4);
Expand Down Expand Up @@ -294,10 +294,10 @@ int main( int argc, char** argv )
for (unsigned int j = 0; j < aMesh.nbFaces(); j++){
aMesh.setFaceColor(j, Color(meshColorR, meshColorG, meshColorB, meshColorA));
}
}else if (customAlphaMesh != 255) {
}else if (customAlphaMesh.size() > 0 ) {
for (unsigned int j = 0; j < aMesh.nbFaces(); j++){
auto c = aMesh.getFaceColor(j);
aMesh.setFaceColor(j, Color(c.red(), c.green(), c.blue(), customAlphaMesh));
aMesh.setFaceColor(j, Color(c.red(), c.green(), c.blue(), customAlphaMesh.at(i<customAlphaMesh.size() ? i: 0)));
}

}
Expand Down

0 comments on commit 65d737f

Please sign in to comment.