Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw exception on invalid color scheme name. #534

Merged
merged 3 commits into from
Aug 28, 2018

Conversation

karjonas
Copy link
Contributor

No description provided.

"protein-atoms",
"protein-chains",
"protein-residues"};
const std::array<std::string, 12> COLOR_SCHEMES = {"none",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

constexpr

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was not possible.

"protein-by-id",
"protein-atoms",
"protein-chains",
"protein-residues"};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this design is not very nice to allow plugin specific extensions. It looks to me that in the end, the color scheme should be a dynamic property.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will leave it like this until it is removed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I was just commenting that we will need to change it eventually.

"target|protein-by-id|protein-atoms|protein-chains|protein-"
"residues]")(PARAM_GEOMETRY_QUALITY.c_str(),
po::value<std::string>(),
"Geometry rendering quality [low|medium|high]")(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole code block for adding options is unreadable. Can you do some hand formatting to all the options and add // clang-format off // clang-format surrounding it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


if (!matchedScheme)
throw po::error("No match for color scheme '" + colorScheme);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it look shorter with std::find? (in fact, that would be a reason for using std::array)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@rolandjitsu
Copy link
Contributor

This is legacy and will/should be moved to a plugin eventually. Not sure if it's worth spending any more time on it.

@karjonas karjonas merged commit cbb1548 into BlueBrain:master Aug 28, 2018
@karjonas karjonas deleted the colorscheme branch August 28, 2018 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants