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 9 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 93.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 95.65%. Comparing base (91310bd) to head (6ce7254).

Files with missing lines Patch % Lines
library/src/camera_impl.cxx 92.85% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1663      +/-   ##
==========================================
- Coverage   95.69%   95.65%   -0.04%     
==========================================
  Files         125      125              
  Lines        9926     9951      +25     
==========================================
+ Hits         9499     9519      +20     
- Misses        427      432       +5     

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

@@ -103,4 +112,4 @@ class F3D_EXPORT camera
};
}

#endif
#endif
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
Contributor Author

Choose a reason for hiding this comment

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

I added it.

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

double viewDirProj[2] = { viewDir[0], viewDir[1] };
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

@@ -179,8 +179,30 @@ int TestSDKCamera(int argc, char* argv[])
return EXIT_FAILURE;
}

// Test getAzimuth
f3d::angle_deg_t addAzimuth = cam.getAzimuth();
Copy link
Contributor

Choose a reason for hiding this comment

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

strange name, why not call the var "azimuth" ?

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's the name we decided with @Meakk and @snoyer. If not appropriate I can change it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean the name of the variable. not the name of the method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh that's there just to clarify it. I can remove it.

@@ -179,8 +179,30 @@ int TestSDKCamera(int argc, char* argv[])
return EXIT_FAILURE;
}

// Test getAzimuth
f3d::angle_deg_t addAzimuth = cam.getAzimuth();
if (!compareDouble(addAzimuth, 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.

I would expect this to be 90, not 0 ?

Copy link
Contributor

Choose a reason for hiding this comment

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

also please put this test right after the addAzimuth test

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 changed it to 90 and added it after addAzimuth.


// Test getElevation
double addElevation = cam.getElevation();
checkDouble(addElevation, 0.0, "getElevation");
Copy link
Contributor

Choose a reason for hiding this comment

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

please put this test after the test of addElevation

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 added it after addElevation.

if (dotProduct < epsilon)
{
std::cerr << "Dot product is lesser than epsilon, returning 0.0 as expected." << std::endl;
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.

return 0.0 ? this is a bug.

@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
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