Skip to content

Commit

Permalink
Merge pull request #272 from kerautret/FixMeshColorSDPViewer
Browse files Browse the repository at this point in the history
fix colors in 3dSDPViewer
  • Loading branch information
kerautret authored Jun 23, 2016
2 parents 15a2a3e + 7ed094f commit ca5ca79
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
- renaming of the shapeGenerator folder to generators (David Coeurjolly, [#268](https://github.com/DGtal-team/DGtalTools/pull/268)))

- *visualisation*:
- 3dSDPViewer: fix the mesh display which was not given with their original
colors. (Bertrand Kerautret,
[#272](https://github.com/DGtal-team/DGtalTools/pull/272))

- 3dSDPViewer: add the possibility to display a set of point by using
different sphere sizes (specified in the input sdp file).
(Bertrand Kerautret,
Expand Down
13 changes: 5 additions & 8 deletions visualisation/3dSDPViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,19 +428,16 @@ int main( int argc, char** argv )
}
if(vm.count("addMesh"))
{
DGtal::Color meshColor = DGtal::Color::White;
if(vm.count("customColorMesh")){
bool customColorMesh = vm.count("customColorMesh");
if(customColorMesh){
std::vector<unsigned int > vectCol = vm["customColorMesh"].as<std::vector<unsigned int> >();
if(vectCol.size()!=4){
trace.error() << "colors specification should contain R,G,B and Alpha values"<< std::endl;
}
meshColor = DGtal::Color(vectCol[0], vectCol[1], vectCol[2], vectCol[3]);
}
viewer.setFillColor(meshColor);


viewer.setFillColor(DGtal::Color(vectCol[0], vectCol[1], vectCol[2], vectCol[3]));
}
std::string meshName = vm["addMesh"].as<std::string>();
Mesh<Z3i::RealPoint> mesh;
Mesh<Z3i::RealPoint> mesh(!customColorMesh);
mesh << meshName ;
viewer << mesh;
}
Expand Down

0 comments on commit ca5ca79

Please sign in to comment.