-
-
Notifications
You must be signed in to change notification settings - Fork 205
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
Refactor vector3_t #1645 #1648
base: master
Are you sure you want to change the base?
Refactor vector3_t #1645 #1648
Conversation
You are modifying libf3d public API! |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1648 +/- ##
==========================================
- Coverage 96.85% 96.80% -0.05%
==========================================
Files 108 104 -4
Lines 7691 7861 +170
==========================================
+ Hits 7449 7610 +161
- Misses 242 251 +9 ☔ View full report in Codecov by Sentry. |
@@ -4,6 +4,10 @@ | |||
"type": "string", | |||
"default_value": "+Y" | |||
}, | |||
"up_direction2": { |
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.
please add a test in TestSDKOption.cxx
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.
what am I supposed to here exactly. there doesn't seems to be test for other options in TestSDKOption.cxx
{ | ||
throw options::parsing_exception("cannot parse " + str + " to a vector3_t"); | ||
} | ||
int sign = +1; |
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.
We do have a logic based on regex working there:
f3d/vtkext/private/module/vtkF3DRenderer.cxx
Line 236 in 33771c5
if (std::regex_match(upString, match, re)) |
Feel free to copy it.
The advantage is it supports lowercase, omitting the
+
prefix, and errors out if invalid.
{ | ||
if (!py::isinstance<py::sequence>(src)) | ||
{ | ||
return false; | ||
} | ||
const py::sequence l = py::reinterpret_borrow<py::sequence>(src); | ||
if (l.size() != S) | ||
if (l.size() != 3) |
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.
load array should support any number of values
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 think it's fine here. If the array has more than 3 elements, it should fail.
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.
ok, maybe I misunderstodd what this code is used for
{ | ||
if (!py::isinstance<py::sequence>(src)) | ||
{ | ||
return false; | ||
} | ||
const py::sequence l = py::reinterpret_borrow<py::sequence>(src); | ||
if (l.size() != S) | ||
if (l.size() != 3) |
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 think it's fine here. If the array has more than 3 elements, it should fail.
Co-authored-by: snoyer <[email protected]>
refactored vector3_t and added a naive parse function