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

Point2DEmbedderIn3D edit origin #1520

Merged
merged 6 commits into from
Oct 9, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
- Fix bug in BasicDomainSubSampler for negative coordinates of the
domain lower bound. (Bertrand Kerautret
[#1504](https://github.com/DGtal-team/DGtal/pull/1504))
- Point2DEmbedderIn3D edit to recover behavior of version 0.9.4 in
the origin point placement.
(Florian Delconte and Bertrand Kerautret
[#1520](https://github.com/DGtal-team/DGtal/pull/1520))

- *DEC*
- Add discrete calculus model of Ambrosio-Tortorelli functional in
Expand Down
4 changes: 2 additions & 2 deletions src/DGtal/kernel/BasicPointFunctors.h
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,8 @@ namespace functors
uDir2[2] = uDir1[0]*anNormalVector[1]-uDir1[1]*anNormalVector[0];

uDir2/=uDir2.norm();

myOriginPointEmbeddedIn3D = Point(anOriginPoint + uDir1*anWidth/2 + uDir2*anWidth/2, functors::Round<>());
myOriginPointEmbeddedIn3D = anOriginPoint + Point(uDir1*anWidth/2) + Point(uDir2*anWidth/2);
myFirstAxisEmbeddedDirection = -uDir1;
mySecondAxisEmbeddedDirection = -uDir2;
}
Expand Down
16 changes: 8 additions & 8 deletions tests/kernel/testBasicPointFunctors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,16 @@ bool testProjector()
4);
PointVector<2, int> pt2b(0, 0);
PointVector<2, int> pt2_2b(2, 2);
//trace.info() << "pt " << pt2b << " => " << embedder2(pt2b) << " == " << PointVector<3,int>(3,5,3) << std::endl;
//nbok += ( embedder2(pt2b) == PointVector<3,int>(3,5,3) ) ? 1 : 0;
trace.info() << "pt " << pt2b << " => " << embedder2(pt2b) << " == " << PointVector<3,int>(2,5,3) << std::endl;
nbok += ( embedder2(pt2b) == PointVector<3,int>(2,5,3) ) ? 1 : 0; // TODO: check expected result
trace.info() << "pt " << pt2b << " => " << embedder2(pt2b) << " == " << PointVector<3,int>(3,5,3) << std::endl;
nbok += ( embedder2(pt2b) == PointVector<3,int>(3,5,3) ) ? 1 : 0;
//trace.info() << "pt " << pt2b << " => " << embedder2(pt2b) << " == " << PointVector<3,int>(2,5,3) << std::endl;
Copy link
Member

Choose a reason for hiding this comment

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

cleanup if it's fine with the last version ?

Copy link
Member Author

Choose a reason for hiding this comment

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

you are right I forget to remove it during test

//nbok += ( embedder2(pt2b) == PointVector<3,int>(2,5,3) ) ? 1 : 0; // TODO: check expected result
nb++;

//trace.info() << "pt " << pt2_2b << " => " << embedder2(pt2_2b) << " == " << PointVector<3,int>(5,4,3) << std::endl;
//nbok += ( embedder2(pt2_2b) == PointVector<3,int>(5,4,3) ) ? 1 : 0;
trace.info() << "pt " << pt2_2b << " => " << embedder2(pt2_2b) << " == " << PointVector<3,int>(4,4,3) << std::endl;
nbok += ( embedder2(pt2_2b) == PointVector<3,int>(4,4,3) ) ? 1 : 0; // TODO: check expected result
trace.info() << "pt " << pt2_2b << " => " << embedder2(pt2_2b) << " == " << PointVector<3,int>(5,4,3) << std::endl;
nbok += ( embedder2(pt2_2b) == PointVector<3,int>(5,4,3) ) ? 1 : 0;
//trace.info() << "pt " << pt2_2b << " => " << embedder2(pt2_2b) << " == " << PointVector<3,int>(4,4,3) << std::endl;
Copy link
Member

Choose a reason for hiding this comment

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

same here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes thanks!

//nbok += ( embedder2(pt2_2b) == PointVector<3,int>(4,4,3) ) ? 1 : 0; // TODO: check expected result
nb++;


Expand Down