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

Feature: Add getters for camera parameters #1419 #1663

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

Schwarzemann
Copy link
Contributor

Opening a new PR.

Copy link

github-actions bot commented Oct 9, 2024

You are modifying libf3d public API! ⚠️Please update bindings accordingly⚠️!
You can find them in their respective directories: python, java, webassembly.

Copy link

codecov bot commented Oct 9, 2024

Codecov Report

Attention: Patch coverage is 92.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 95.80%. Comparing base (f59acec) to head (8cd2ea3).

Files with missing lines Patch % Lines
library/src/camera_impl.cxx 92.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1663      +/-   ##
==========================================
- Coverage   95.81%   95.80%   -0.01%     
==========================================
  Files         125      125              
  Lines       10530    10555      +25     
==========================================
+ Hits        10089    10112      +23     
- Misses        441      443       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

double viewDirProj[2] = { viewDir[0], viewDir[2] };
if (vtkMath::Dot2D(viewDirProj, viewDirProj) < VTK_DBL_EPSILON)
{
return 0.0;
Copy link
Contributor

Choose a reason for hiding this comment

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

please add a test for this

Copy link
Contributor

Choose a reason for hiding this comment

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

in short you need to add a test where this conditionj is true and you enter this line

@mwestphal
Copy link
Contributor

@Schwarzemann any news on this ?

@Schwarzemann
Copy link
Contributor Author

@Schwarzemann any news on this ?

Ah yes. Sorry work has been very busy lately. I will take care of it this week for sure.

@Schwarzemann Schwarzemann reopened this Nov 8, 2024
@mwestphal
Copy link
Contributor

Hi @Schwarzemann

Do you need any help moving forward ?

@Schwarzemann
Copy link
Contributor Author

Hi @Schwarzemann

Do you need any help moving forward ?

Actually yes kind of. I would really appreciate it. I just can't wrap my head around the tests also can't seem to include vtkmath.h under TestSDKCamera.cxx so I can't use vtkMath::Dot2D.

@mwestphal
Copy link
Contributor

Hi @Schwarzemann

Do you need any help moving forward ?

@Schwarzemann
Copy link
Contributor Author

Hi @Schwarzemann

Do you need any help moving forward ?

Not right now thanks. I just have problems with time management nowadays.

@Schwarzemann Schwarzemann changed the title FIX: Add getters for camera parameters #1419 Feature: Add getters for camera parameters #1419 Jan 5, 2025
@mwestphal
Copy link
Contributor

Do you need any help moving forward @Schwarzemann ?

@mwestphal
Copy link
Contributor

Hi @Schwarzemann

Do you need any help moving forward ?

@Schwarzemann
Copy link
Contributor Author

Hi @Schwarzemann

Do you need any help moving forward ?

Sorry. I was supposed to push my latest changes but I haven't yet I will push as soon as possible and let you know.

@mwestphal
Copy link
Contributor

Need any help @Schwarzemann ?

@mwestphal
Copy link
Contributor

Hi @Schwarzemann

Are you around ? I can help and guide if needed :)

@Schwarzemann
Copy link
Contributor Author

Hi @Schwarzemann

Are you around ? I can help and guide if needed :)

Hello. Sorry I've been very busy lately. Yes I would greatly appreciate the help. I am still having problems with the test. Everything else seems fine.

/** Rotate the camera about its horizontal axis, centered at the focal point. */
virtual camera& elevation(angle_deg_t angle) = 0;
virtual camera& addElevation(angle_deg_t angle) = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

While I agree that it makes more sense to change the name of these methods, if you do that you need to ensure retro compatibility of the API and deprecate the previous methods.

I'd suggest not to do that for now, I can take care of 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.

Should I rename them? If yes I can take care of that.

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, you should change the name compared to master

"files.associations": {
"cmath": "cpp"
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

please remove this file

std::cerr << std::setprecision(12) << "azimuth: " << azimuth << " != 90.0" << std::endl;
return EXIT_FAILURE;
}
double viewDirProj[2] = { 1.0, 1.0 };
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
double viewDirProj[2] = { 1.0, 1.0 };
const double viewDirProj[2] = { 1.0, 1.0 };

@mwestphal
Copy link
Contributor

Hi @Schwarzemann
Are you around ? I can help and guide if needed :)

Hello. Sorry I've been very busy lately. Yes I would greatly appreciate the help. I am still having problems with the test. Everything else seems fine.

I've left some comments. The main point is that we should not change the API. I can take care of that if we want to but for now lets just add the getters.

@Schwarzemann
Copy link
Contributor Author

Hi @Schwarzemann
Are you around ? I can help and guide if needed :)

Hello. Sorry I've been very busy lately. Yes I would greatly appreciate the help. I am still having problems with the test. Everything else seems fine.

I've left some comments. The main point is that we should not change the API. I can take care of that if we want to but for now lets just add the getters.

Okay yes most certainly I will take care of it tonight.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Some suggestions could not be made:

  • java/F3DJavaBindings.cxx
    • lines 153-153

@@ -106,4 +106,4 @@ def test_resets():
camera = engine.window.camera
camera.set_current_as_default()
camera.reset_to_bounds()
camera.reset_to_default()
camera.reset_to_default()

Choose a reason for hiding this comment

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

Suggested change
camera.reset_to_default()
camera.reset_to_default()

Copy link
Contributor

Choose a reason for hiding this comment

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

missing end of line

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Some suggestions could not be made:

  • python/testing/test_camera.py
    • lines 110-110

camera.reset_to_default()

Copy link
Contributor

Choose a reason for hiding this comment

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

still incorrect ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I delete the line?

Copy link
Contributor

Choose a reason for hiding this comment

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

not exactly, you should fix the "missing end of line" issue. See this:
https://stackoverflow.com/questions/5813311/whats-the-significance-of-the-no-newline-at-end-of-file-log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants