Create the base for the Geometry abstraction.
Details
- Reviewers
jcmcdonald • gacmix - Maniphest Tasks
- T1302: Geometry Classes
- Commits
- rAc41ad8c89f2d: Geometry.hpp
manual, tests in making
Diff Detail
- Repository
- rA Anari
- Branch
- geometry
- Lint
Lint Passed
Event Timeline
Build has FAILED
Link to build: https://jenkins.mousepawmedia.net:8449/job/anari_build/102/
See console output for more information: https://jenkins.mousepawmedia.net:8449/job/anari_build/102/console
Build is green
Building Anari on mpm-bionic-0000wtx9ht5g1 as build 103.
See https://jenkins.mousepawmedia.net:8449/job/anari_build/103/ for more details.
- Create first draft of Curve class
- Improve and fix issues with Curve class
- Remove copy assignment operator & copy constructor for now
Build has FAILED
Building Anari on mpm-bionic-0000zf0izo3g2 as build 104.
Link to build: https://jenkins.mousepawmedia.net:8449/job/anari_build/104/
See console output for more information: https://jenkins.mousepawmedia.net:8449/job/anari_build/104/console
Build is green
Building Anari on mpm-bionic-0000zgv05rfnu as build 105.
See https://jenkins.mousepawmedia.net:8449/job/anari_build/105/ for more details.
anari-source/include/anari/geometry.hpp | ||
---|---|---|
24 | You need two other constructors for Curve as well:
As a rule, *always* either explicitly declare or delete your copy constructor, as well as (possibly) your move constructor. Also consider adding a constructor which can accept an initial segment. | |
69 | You also need your assignment operators for copying and (possibly) moving from another Curve(): operator=(const Curve& cpy) and operator=(Curve&& mov). Like the corresponding constructors, these are two functions you should almost always define on data-oriented objects like this. It may also be worthwhile adding operator+(Segment) and operator+(Curve) (as well as the += counterparts). |
Build has FAILED
Building Anari on mpm-bionic-0000xk8xtped4 as build 112.
Link to build: https://jenkins.mousepawmedia.net:8449/job/anari_build/112/
See console output for more information: https://jenkins.mousepawmedia.net:8449/job/anari_build/112/console
Build is green
Building Anari on mpm-bionic-00064kaw9rukx as build 113.
See https://jenkins.mousepawmedia.net:8449/job/anari_build/113/ for more details.
- Add resolution copying tests
- Add curve tests
- Add constructor for instantiating from a segment
Build is green
Building Anari on mpm-bionic-0006sisw9n73i as build 114.
See https://jenkins.mousepawmedia.net:8449/job/anari_build/114/ for more details.
Build is green
Building Anari on mpm-bionic-0004ahdvjj5y8 as build 115.
See https://jenkins.mousepawmedia.net:8449/job/anari_build/115/ for more details.
Getting there! A few more comments for you...
anari-source/include/anari/geometry.hpp | ||
---|---|---|
57–60 | Wouldn't we want to allow reassignment? | |
97 | The convention is indeed to just use if (segmentClosed), not spell out == true`. | |
anari-source/include/anari/geometry_tests.hpp | ||
68 ↗ | (On Diff #1291) | This is something you want to avoid. Either test each of these behaviors separately before this test, or else directly access the attributes in question. You want a test to have a specific place to break, and a specific reason to break. Otherwise, debugging the test when it fails gets hard. |
anari-source/src/geometry_tests.cpp | ||
11–12 ↗ | (On Diff #1291) | A full test suite should separately test each constructor, operator, and function of the class being tested. (This is what is meant by "code coverage") |
@imirzali This needs to be wrapped up and landed ASAP, so as to unblock T1301: Refactoring Geometry Using Eigen (which MUST be a separate task!)
anari-source/include/anari/geometry.hpp | ||
---|---|---|
57–60 | Don't quite get what you mean here. |
Build is green
Building Anari on mpm-bionic-0004bgikbfseh as build 124.
See https://jenkins.mousepawmedia.net:8449/job/anari_build/124/ for more details.
anari-source/include/anari/geometry.hpp | ||
---|---|---|
12 | How does a segment work exactly. Where do the x1/x2, y1/y2, cx1/cx2, cy1/cy2 factor into? What do they represent exactly? I have an idea but I want to confirm before moving forward. |
Build is green
Building Anari on mpm-bionic-000adx851c7l7 as build 126.
See https://jenkins.mousepawmedia.net:8449/job/anari_build/126/ for more details.
Small detail only.
I think this is about ready to land, pending my one detail and an answer to @gacmix's question inline. I'll let you tackle the rest of the tests as you go in the next Differential. Just be sure not to put them off towards the end! Write them as you go. You may even consider writing a test before you write the functionality being tested (Test-Driven Development), if that workflow will help you get these done.
anari-source/include/anari/geometry.hpp | ||
---|---|---|
57–60 | Uhm...no, I think I read it wrong. This time around, it makes even less sense. FlexArray::clear() always returns true (I should change it to not return anything), and it never throws an exception, so this clause really would never happen. |
anari-source/include/anari/geometry.hpp | ||
---|---|---|
12 | Essentially there are control points, beginning points of the curve and the endpoint. The ones starting with c imply a control point. |
Build is green
Building Anari on mpm-bionic-000ayhd0fy4qx as build 127.
See https://jenkins.mousepawmedia.net:8449/job/anari_build/127/ for more details.