-
Notifications
You must be signed in to change notification settings - Fork 19
Add MapRender for quads #316
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
Open
kvanhoey
wants to merge
32
commits into
cgogn:develop
Choose a base branch
from
kvanhoey:kvanhoey
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
631d4d9
comment typo
19580b4
Merge branch 'develop' of github.com:cgogn/CGoGN_2 into kvanhoey
c63c9f6
Merge branch 'develop' of github.com:cgogn/CGoGN_1 into kvanhoey
1504c97
Add map_quad_render
9f9efc6
Cleanup MapQuadRender
53c7b8e
add ParallelogramTiling Topo. Ongoing ...
100adff
paralellogram_grid
7dca195
cleanup for parallelogram grid
4bee075
code refactoring on parallelogram_grid
7e6a4e7
code refactoring on parallelogram_grid
4abd9c5
integrate MapQuadRender into MapRender with an enum QUAD
f5e2681
Merge branch 'develop' of github.com:cgogn/CGoGN_2 into kvanhoey
ff110a1
update CMakeList accordingly
ad23554
add missing break; instruction
a099b06
change spaces to tabs
e3d0cc5
sampling parallelograms
f50c66f
sample parallelograms
c12be0e
Sample parallelograms updated
c2dcb16
Sample parallelograms updated
b0726f5
bug fixing
4921587
double templates for parallelogram_grid
9717168
replace assert by warning
1eb98f4
compil fix
kvanhoey c24b111
Merge branch 'develop' of github.com:cgogn/CGoGN_2 into kvanhoey
kvanhoey 869cc70
tmp commit
kvanhoey cca187d
fix conflict
kvanhoey 71ffd9c
adding planarity and convexity tests for faces
cbd1ec9
add parallelogram::isApprox
082bba6
correct snake_case
kvanhoey 0cad941
correct snake_case
kvanhoey bce8843
uint -> uint32 for windows compatibility
af487e9
uint -> uint32 for windows compatibility
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,141 @@ | ||
| /******************************************************************************* | ||
| * CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps * | ||
| * Copyright (C) 2015, IGG Group, ICube, University of Strasbourg, France * | ||
| * * | ||
| * This library is free software; you can redistribute it and/or modify it * | ||
| * under the terms of the GNU Lesser General Public License as published by the * | ||
| * Free Software Foundation; either version 2.1 of the License, or (at your * | ||
| * option) any later version. * | ||
| * * | ||
| * This library is distributed in the hope that it will be useful, but WITHOUT * | ||
| * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * | ||
| * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * | ||
| * for more details. * | ||
| * * | ||
| * You should have received a copy of the GNU Lesser General Public License * | ||
| * along with this library; if not, write to the Free Software Foundation, * | ||
| * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * | ||
| * * | ||
| * Web site: http://cgogn.unistra.fr/ * | ||
| * Contact information: cgogn@unistra.fr * | ||
| * * | ||
| *******************************************************************************/ | ||
|
|
||
| #ifndef CGOGN_GEOMETRY_ALGOS_CONVEXITY_H | ||
| #define CGOGN_GEOMETRY_ALGOS_CONVEXITY_H | ||
|
|
||
| #include <cgogn/geometry/types/geometry_traits.h> | ||
| #include <cgogn/geometry/algos/length.h> | ||
|
|
||
| #include <cgogn/core/cmap/attribute.h> | ||
|
|
||
| namespace cgogn | ||
| { | ||
|
|
||
| namespace geometry | ||
| { | ||
|
|
||
| /** | ||
| * @brief is_planar verifies if a face is planar: defined by the fact that all coordinates other than the first two (x and y) are constant (up to epsilon) | ||
| * @param map the map | ||
| * @param f the face | ||
| * @param position container of vertex positions | ||
| * @param epsilon maximum deviation of each component | ||
| * @return true iff planar | ||
| */ | ||
| template <typename VEC, typename MAP> | ||
| inline bool is_planar( | ||
| const MAP& map, | ||
| const typename MAP::Face f, | ||
| const typename MAP::template VertexAttribute<VEC>& position, | ||
| typename vector_traits<VEC>::Scalar epsilon = Eigen::NumTraits<typename vector_traits<VEC>::Scalar>::dummy_precision() | ||
| ) | ||
| { | ||
| using Scalar = typename vector_traits<VEC>::Scalar; | ||
| using Vertex = typename MAP::Vertex; | ||
|
|
||
| if (vector_traits<VEC>::SIZE < 3) | ||
| return true ; | ||
|
|
||
| using VecN_2 = Eigen::Matrix<Scalar,vector_traits<VEC>::SIZE - 2,1> ; | ||
| // Init with first vertex | ||
| VecN_2 depth0 ; | ||
| for (uint i = 0 ; i < vector_traits<VEC>::SIZE - 2 ; ++i) | ||
| depth0[i] = position[Vertex(f.dart)][i+2] ; | ||
|
|
||
| // verify that other vertices do not deviate in coordinates 3 (z) and higher. | ||
| bool planar = true ; | ||
| map.foreach_incident_vertex(f, [&] (Vertex v) -> bool | ||
| { | ||
| VecN_2 depth ; | ||
| for (uint i = 0 ; i < vector_traits<VEC>::SIZE - 2 ; ++i) | ||
| { | ||
| depth[i] = position[v][i+2] ; | ||
| if (!depth.isApprox(depth0,epsilon)) | ||
| { | ||
| planar = false ; | ||
| } | ||
| } | ||
| return planar ; | ||
| }); | ||
|
|
||
| return planar ; | ||
| } | ||
|
|
||
| /** | ||
| * @brief is_convex verifies if a given face is convex (in the plane, not in 3D). | ||
| * @param map the map | ||
| * @param f the face | ||
| * @param position the geometric embedding of the vertices | ||
| * @note if the face is not planar (see #is_planar), false is returned. | ||
| * @return true iff the face is convex. | ||
| */ | ||
| template <typename VEC, typename MAP> | ||
| inline bool is_convex( | ||
| const MAP& map, | ||
| const typename MAP::Face f, | ||
| const typename MAP::template VertexAttribute<VEC>& position | ||
| ) | ||
| { | ||
| if (!is_planar<VEC,MAP>(map,f,position)) | ||
| { | ||
| cgogn_log_error("Trying to assess convexity of a face while it's not planar. This is ill-defined") ; | ||
| return false ; | ||
| } | ||
|
|
||
| using Scalar = typename vector_traits<VEC>::Scalar; | ||
| using Vertex = typename MAP::Vertex; | ||
| //using Dart = typename MAP::Dart; | ||
|
|
||
| bool convex = true ; | ||
| if (map.codegree(f) >= 3) // true otherwise | ||
| { | ||
| // Take all two consecutive darts and compute cross products. | ||
| // The face is convex iff the z components of all products have the same sign. | ||
| bool sign ; | ||
| bool first = true ; | ||
| map.foreach_dart_of_orbit(f, [&] (Dart d) | ||
| { | ||
| const VEC d1 = vector_from<VEC>(map,d,position) ; | ||
| const VEC d2 = vector_from<VEC>(map,map.phi1(d),position) ; | ||
| const Scalar zcross = d1[0]*d2[1] - d1[1]*d2[0] ; | ||
| if (first) | ||
| { | ||
| sign = (zcross > Scalar(0)) ; | ||
| first = false ; | ||
| } | ||
| else | ||
| { | ||
| if (sign != (zcross > Scalar(0))) | ||
| convex = false ; | ||
| } | ||
| }); | ||
| } | ||
| return convex ; | ||
| } | ||
|
|
||
| } // Geometry | ||
|
|
||
| } // CGoGN | ||
|
|
||
| #endif // CGOGN_GEOMETRY_ALGOS_CONVEXITY_H |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| /******************************************************************************* | ||
| * CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps * | ||
| * Copyright (C) 2015, IGG Group, ICube, University of Strasbourg, France * | ||
| * * | ||
| * This library is free software; you can redistribute it and/or modify it * | ||
| * under the terms of the GNU Lesser General Public License as published by the * | ||
| * Free Software Foundation; either version 2.1 of the License, or (at your * | ||
| * option) any later version. * | ||
| * * | ||
| * This library is distributed in the hope that it will be useful, but WITHOUT * | ||
| * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * | ||
| * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * | ||
| * for more details. * | ||
| * * | ||
| * You should have received a copy of the GNU Lesser General Public License * | ||
| * along with this library; if not, write to the Free Software Foundation, * | ||
| * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * | ||
| * * | ||
| * Web site: http://cgogn.unistra.fr/ * | ||
| * Contact information: cgogn@unistra.fr * | ||
| * * | ||
| *******************************************************************************/ | ||
|
|
||
| #define CGOGN_MODELING_TILING_PARALLELOGRAM_GRID_CPP_ | ||
|
|
||
| #include <cgogn/modeling/tiling/parallelogram_grid.h> | ||
|
|
||
| namespace cgogn | ||
| { | ||
|
|
||
| namespace modeling | ||
| { | ||
|
|
||
| //template class CGOGN_MODELING_API ParallelogramGrid<CMap2,Eigen::Vector2d>; | ||
|
|
||
| } // namespace modeling | ||
|
|
||
| } // namespace cgogn | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Est-ce qu'il y a une raison pour laquelle c'est commenté ?
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.
Non. Ou du moins, je ne m'en souviens pas. En fait, je devrais vraiment exclure cette classe du pull request car cette classe n'est absolument pas finalisée (c'était un effet de bord de mon pull request pour le MapRender).
C'est faisable facilement ?
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.
Je pense que le plus simple est de faire un commit dans lequel tu enlèves les parties non-finalisées. Sinon ça peut très bien rester en l'état le temps que tu travailles dessus, faut voir avec Pierre.
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.
Ouai mais j'aimerais quand même avoir le commit et le push sur mon github à des fins de backup ... mais pas dans le pull request pour ne pas polluer CGoGN.
@pierrekraemer, un avis ?
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.
Tu peux créer une nouvelle branche de backup à partir de celle que tu utilises pour la PR. Puis tu continues tes modifs dans l'ancienne branche.