Skip to content

Commit

Permalink
change option type from bool to vector<double>
Browse files Browse the repository at this point in the history
  • Loading branch information
gapry committed Nov 29, 2024
1 parent 9f9a2e9 commit f8bbaac
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion application/F3DOptionsTools.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ static inline const std::array<CLIGroup, 8> CLIOptions = {{
{"bar", "b", "Show scalar bar", "<bool>", "1" },
{"colormap-file", "", "Specify a colormap image", "<filePath/filename/fileStem>", ""},
{"colormap", "", "Specify a custom colormap (ignored if \"colormap-file\" is specified)", "<color_list>", ""},
{"colormap-discretization", "", "test", "<bool>", "1"},
{"colormap-discretization", "", "test colormap discretization", "<color_list>", ""},
{"volume", "v", "Show volume if the file is compatible", "<bool>", "1"},
{"inverse", "i", "Inverse opacity function for volume rendering", "<bool>", "1"} } },
{"Camera",
Expand Down
4 changes: 2 additions & 2 deletions library/options.json
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@
"default_value": "0.0, 0.0, 0.0, 0.0, 0.4, 0.9, 0.0, 0.0, 0.8, 0.9, 0.9, 0.0, 1.0, 1.0, 1.0, 1.0"
},
"discretization" : {
"type": "bool",
"default_value": "false"
"type": "double_vector",
"default_value": "1.0, 1.0, 1.0, 1.0"
},
"range": {
"type": "double_vector"
Expand Down
6 changes: 5 additions & 1 deletion vtkext/private/module/vtkF3DRenderer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2230,9 +2230,13 @@ void vtkF3DRenderer::SetColormap(const std::vector<double>& colormap)
}
}

void vtkF3DRenderer::SetColorDiscretization(const bool discretization) {
void vtkF3DRenderer::SetColorDiscretization(const std::vector<double>& discretization) {
auto logMsg = std::string("[Gapry PoC][Add CLI Options] " + std::string(__PRETTY_FUNCTION__));
F3DLog::Print(F3DLog::Severity::Warning, logMsg);
for(auto& e : discretization) {
F3DLog::Print(F3DLog::Severity::Warning, std::to_string(e) + std::string(" "));
}
F3DLog::Print(F3DLog::Severity::Warning, std::string("\n"));
}

//----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion vtkext/private/module/vtkF3DRenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ class vtkF3DRenderer : public vtkOpenGLRenderer
*/
void SetColormap(const std::vector<double>& colormap);

void SetColorDiscretization(const bool discretization);
void SetColorDiscretization(const std::vector<double>& discretization);

enum class CycleType
{
Expand Down

0 comments on commit f8bbaac

Please sign in to comment.