-
Notifications
You must be signed in to change notification settings - Fork 47
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
Conversation
"protein-atoms", | ||
"protein-chains", | ||
"protein-residues"}; | ||
const std::array<std::string, 12> COLOR_SCHEMES = {"none", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
constexpr
There was a problem hiding this comment.
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"}; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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]")( |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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); | ||
} |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
This is legacy and will/should be moved to a plugin eventually. Not sure if it's worth spending any more time on it. |
No description provided.