Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
2cf9156
Do not duplicate C3T3 in write_MEDIT
MaelRL Feb 17, 2026
2e53b28
Introduce a map that stores surface facet info
MaelRL Feb 17, 2026
c6c22fe
Add C3T3 member function to access all surface facet info
MaelRL Feb 17, 2026
8a062ad
TEMP: Fix Refine_cells_3 not unmarking facets about to be destroyed
MaelRL Feb 17, 2026
0484803
Optimize Mesh_vertex_base_3's memory footprint:
MaelRL Feb 17, 2026
a88a4d9
Use the generic C3T3 member functions to access facet surface info
MaelRL Feb 17, 2026
a1f9533
Template mesh criteria by the C3T3 and not the triangulation
MaelRL Feb 17, 2026
4e6dd17
WIP: Optimize Compact_mesh_cell_base_3:
MaelRL Feb 17, 2026
a35a048
TMP: disable some code
MaelRL Feb 17, 2026
e0f60f6
TMP: Surface checks for both API
MaelRL Feb 17, 2026
c77a5b8
TMP: dump map size
MaelRL Feb 17, 2026
0f831f7
Fix index type
MaelRL Feb 18, 2026
259bde3
Fix missing typedef
MaelRL Feb 18, 2026
6f4a1b1
Erase no-longer-surface facets from the C3T3 surface info map
MaelRL Feb 18, 2026
8c6dd57
Avoid copies of shared data parameters
MaelRL Feb 18, 2026
b5357bf
Add move constructions to Polyhedral_mesh_domain_with_features
MaelRL Feb 18, 2026
565fde0
Deal with warnings
MaelRL Feb 18, 2026
d3b9bfa
Back to using compact_base_bases, but with good padding
MaelRL Feb 19, 2026
898a78f
Fix macro choice
MaelRL Feb 19, 2026
16c34b9
Parallel Facet->Surface info map + factorize/fix Edge Facet counter
MaelRL Feb 20, 2026
6237d67
Avoid some map look ups
MaelRL Feb 20, 2026
6e9beb2
Avoid some cell -> facet -> cell conversions
MaelRL Feb 20, 2026
6e90c4e
Fix documentation of internal function
MaelRL Feb 23, 2026
df32131
Misc tiny fixes
MaelRL Feb 24, 2026
84868dc
Avoid some copies
MaelRL Feb 24, 2026
aaad872
Template criteria by the C3t3
MaelRL Feb 25, 2026
a941c55
EqualityComparable gives only operator==
MaelRL Feb 25, 2026
dd96342
Misc tiny changes
MaelRL Feb 25, 2026
866cb29
Rename macro
MaelRL Feb 25, 2026
8d3d92c
Remove old get_facets code
MaelRL Feb 25, 2026
361795e
Harmonize the definition of canonical facet
MaelRL Feb 25, 2026
b540350
Make new_incident_slivers() baseline
MaelRL Feb 25, 2026
3469780
Remove obsolete min dihedral computation code
MaelRL Feb 25, 2026
99f0342
Use function objects, not global functions
MaelRL Feb 25, 2026
f4153b0
Make the faster perturbation queue filling algorithm baseline
MaelRL Feb 25, 2026
0fda0f2
Get rid of 'CGAL_MESH_3_NO_PROTECTION_NON_LINEAR'
MaelRL Feb 25, 2026
a5382fd
Misc cleaning
MaelRL Feb 26, 2026
e21e209
Get rid Mesh_regular_triangulation_3_wrapper
MaelRL Feb 26, 2026
cd1a1a9
Dot not assume Tr::FT exists, FT is in GT
MaelRL Feb 26, 2026
b573478
Add commas
MaelRL Feb 26, 2026
a8bdce7
Avoid a copy
MaelRL Feb 27, 2026
82c3b04
Remove unused function object
MaelRL Feb 27, 2026
b4cf282
Make the C3T3 surface info maps baseline
MaelRL Feb 27, 2026
92445a7
Reduce to 'int' some 'std::size_t' vertex base members
MaelRL Feb 27, 2026
668d013
Add move&copy for the facet surface info maps
MaelRL Feb 27, 2026
d03d86c
Remove extra semicolon
MaelRL Feb 27, 2026
90caef2
Fix some std::size_t that should be int's
MaelRL Feb 28, 2026
d8aeca5
Revert (at no mem cost) some mesh vertex base optimizations
MaelRL Feb 28, 2026
fe49620
Simplify code to compute a canonical facet
MaelRL Feb 28, 2026
fefae5b
Fix not removing facets from the complex during perturbation
MaelRL Feb 28, 2026
e732287
Misc enhancements and fixes in Mesh_3/tests
MaelRL Feb 28, 2026
e754ecf
Do not assume the triangulation has a bare point
MaelRL Feb 28, 2026
ab65fe3
Misc cleaning
MaelRL Feb 28, 2026
81d3e6e
Fix leaving uninitialized prop table entries during perturb backup
MaelRL Feb 28, 2026
0024a6f
Merge remote-tracking branch 'cgal/main' into Mesh_3-memory-culling-GF
MaelRL Feb 28, 2026
0268dfe
Merge branch 'pr/janetournois/9274' into pr/MaelRL/9331
lrineau Mar 2, 2026
f077420
P3T3/Tr_helpers: missing #include
lrineau Mar 2, 2026
2c882e5
Mesh_3: missing #include
lrineau Mar 2, 2026
a33383a
fix doc warnings
sloriot Mar 5, 2026
99873b1
minor change to display on std::cerr
lrineau Mar 4, 2026
9e77408
Fix compilation of Mesh_3/benchmark
MaelRL Mar 5, 2026
18f1259
C3T3 I/O: Squat meshing_info() if available + avoid stringstream
MaelRL Mar 5, 2026
6634da0
Avoid copying weighted circumcenters
MaelRL Mar 5, 2026
4c12853
Misc fixes
MaelRL Mar 9, 2026
ba47641
Move sliver value caching out of the compact mesh cell base
MaelRL Mar 12, 2026
af08c3f
Misc cleaning
MaelRL Mar 12, 2026
7af6530
Disable intrusive lists (wip)
MaelRL Mar 12, 2026
7037982
Add missing license header include
MaelRL Mar 12, 2026
245a9e4
Add some code to disable circumcenter caching in compact mesh cell base
MaelRL Mar 16, 2026
2c4f46b
Do not pollute the surface info map with non-surface facets
MaelRL Mar 16, 2026
3f6894c
Halve the memory map footprint by storing only once per facet pair
MaelRL Mar 17, 2026
2bc46e0
Purge obsolete code
MaelRL Mar 17, 2026
82457f5
Prefer C3T3 member functions to cell base member functions
MaelRL Mar 26, 2026
c8c9ed4
Use an unordered flat map
MaelRL Mar 27, 2026
038e392
Remove assertion
MaelRL Mar 27, 2026
1d3f94f
Revert "Halve the memory map footprint by storing only once per facet…
MaelRL Mar 27, 2026
8957c36
If the cell provides surface patch storage, use it
MaelRL Mar 27, 2026
1c7556c
Simplify is_in_complex(Facet)
MaelRL Mar 27, 2026
c13fbea
Use actual c3t3 in soup_to_c3t3 I/O functions
MaelRL Apr 1, 2026
48e6664
Split the new lightweight compact cell base into its own class
MaelRL Apr 1, 2026
ccc7a79
Sliver caching fixes
MaelRL Apr 1, 2026
e621c7c
Use C3T3's functions
MaelRL Apr 1, 2026
ab12973
Add a test using the lightweight compact mesh cell base
MaelRL Apr 1, 2026
e37b6dc
Clean up
MaelRL Apr 1, 2026
4ae91e1
Fix template parameter
MaelRL Apr 8, 2026
a09d3d9
Fix indentation
MaelRL Apr 8, 2026
d085b32
Fix maybe-uninitialized warning (?)
MaelRL Apr 8, 2026
cb08810
Fix compilation
MaelRL Apr 9, 2026
48ef793
Align concept with similar concepts
MaelRL Apr 9, 2026
45c7a06
Fix warning
MaelRL Apr 9, 2026
32671e7
Try to please MSVC2017
MaelRL Apr 9, 2026
1873138
try to please msvc2017 with tags instead of enum template parameter
janetournois Apr 21, 2026
486532a
remove std::array of 4 in cells and move to a map in ccdt to reduce m…
janetournois Apr 30, 2026
92d8520
remove facets from the map before deleted them by vertex insertion
janetournois May 4, 2026
50e64fc
add missing include (try to please CI)
janetournois May 11, 2026
d08f4df
Merge remote-tracking branch 'cgal/main' into pr/MaelRL/9331-1
lrineau Sep 24, 2026
7be28cd
fix I/O of CDT_3
lrineau Sep 25, 2026
f433274
more debug
lrineau Sep 25, 2026
ad061cf
fix Mesh_3 I/O
lrineau Sep 30, 2026
d1f6a2d
fix test_mesh_cell_base_3
lrineau Sep 30, 2026
74ccf6f
initialize `dual(ch)` for all cells
lrineau Sep 30, 2026
df6d6a1
Merge remote-tracking branch 'cgal/main' into Mesh_3-memory-culling-GF
lrineau Sep 30, 2026
b5d35a9
enable `-x` when the action is run with debug logging
lrineau Oct 1, 2026
42bc9c3
add missing includes
lrineau Oct 1, 2026
6fc7b76
Merge remote-tracking branch 'cgal/main' into Mesh_3-memory-culling-GF
lrineau Oct 1, 2026
d4123f2
fix the CI
lrineau Oct 1, 2026
cabd3b3
try to fix the broken pipe `grep | head -n1`
lrineau Oct 1, 2026
0151fc4
fix headers
lrineau Oct 1, 2026
35b6195
group the results
lrineau Oct 1, 2026
7266c3e
output errors to the job summary
lrineau Oct 1, 2026
d0dfd2b
fix headers
lrineau Oct 1, 2026
c5853cf
add backward compatibiloty
lrineau Oct 1, 2026
8bce8eb
fix CI
lrineau Oct 1, 2026
2a366ea
display "Compare dependencies" to job summary
lrineau Oct 1, 2026
dfa804e
fix errors from testsuite
lrineau Oct 2, 2026
812de1f
Merge remote-tracking branch 'cgal/main' into pr/MaelRL/9331-2
lrineau Oct 2, 2026
69e4804
Merge branch 'Scripts-improve_CI-lrineau' into pr/MaelRL/9331-2
lrineau Oct 2, 2026
90ee1c6
Merge remote-tracking branch 'cgal/main' into Mesh_3-memory-culling-GF
lrineau Oct 2, 2026
730f8c4
fix unused type warning
sloriot Oct 5, 2026
693122d
remove erroneous include
lrineau Oct 6, 2026
29d9624
workaround for MSVC
lrineau Oct 6, 2026
eb80c60
fix tet remeshing when patch info is not in cells
lrineau Oct 5, 2026
bfa06f6
improve the internal named parameters API
lrineau Oct 6, 2026
9935e29
WIP for tet remeshing with a C3t3 that stores facet info in hash map
lrineau Oct 6, 2026
385e84b
fix NP::has_parameter
lrineau Oct 7, 2026
d36b47c
test the backward compatibility
lrineau Oct 7, 2026
570c2a4
revert the WIP about tet remeshing and named parameters
lrineau Oct 7, 2026
761cfc4
announcement the breaking change for mesh criteria and fix the docume…
lrineau Oct 9, 2026
44a80fb
fix links
lrineau Oct 9, 2026
7363940
Merge remote-tracking branch 'cgal/main' into Mesh_3-memory-culling-GF
janetournois Oct 15, 2026
67596b8
Merge remote-tracking branch 'cgal/main' into Mesh_3-memory-culling-GF
lrineau Oct 21, 2026
35c6a69
Use std::filesystem::path
afabri Oct 22, 2026
ed87616
Repeat constexpr inside the lambda for VC++
afabri Oct 22, 2026
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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ class Conforming_constrained_Delaunay_triangulation_cell_base_3
}

static std::string io_signature() {
static_assert(
std::is_same_v<
decltype(std::declval<Conforming_constrained_Delaunay_triangulation_cell_data_3>().face_constraint_index(0)), int>);
// static_assert(
// std::is_same_v<
// decltype(std::declval<Conforming_constrained_Delaunay_triangulation_cell_data_3>().face_constraint_index(0)), int>);

return Get_io_signature<Base>()() + "+(" + Get_io_signature<int>()() + ")[4]";
}
Expand All @@ -82,13 +82,13 @@ class Conforming_constrained_Delaunay_triangulation_cell_base_3
const Conforming_constrained_Delaunay_triangulation_cell_base_3& c)
{
os << static_cast<const Base&>(c);
for( unsigned li = 0; li < 4; ++li ) {
if(IO::is_ascii(os)) {
os << " " << c.ccdt_3_data().face_constraint_index(li);
} else {
CGAL::write(os, c.ccdt_3_data().face_constraint_index(li));
}
}
//for( unsigned li = 0; li < 4; ++li ) {
// if(IO::is_ascii(os)) {
// os << " " << face_constraint_index(c, li);
// } else {
// CGAL::write(os, face_constraint_index(c, li));
// }
//}
return os;
}
friend std::istream&
Expand All @@ -97,16 +97,16 @@ class Conforming_constrained_Delaunay_triangulation_cell_base_3
{
is >> static_cast<Base&>(c);
if(!is) return is;
for( int li = 0; li < 4; ++li ) {
int i;
if(IO::is_ascii(is)) {
is >> i;
} else {
CGAL::read(is, i);
}
if(!is) return is;
c->ccdt_3_data().set_face_constraint_index(li, i);
}
// for( int li = 0; li < 4; ++li ) {
// int i;
// if(IO::is_ascii(is)) {
// is >> i;
// } else {
// CGAL::read(is, i);
// }
// if(!is) return is;
// set_face_constraint_index(c, li, i);
// }
return is;
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ class Conforming_constrained_Delaunay_triangulation_cell_data_3 {
template <typename Tr> friend class Conforming_constrained_Delaunay_triangulation_3_impl;
/// @endcond

std::array<CDT_3_signed_index, 4> face_id = { -1, -1, -1, -1 };
std::array<void*, 4> facet_2d = {nullptr, nullptr, nullptr, nullptr};
std::bitset<static_cast<unsigned>(CDT_3_cell_marker::nb_of_markers)> markers;

bool is_marked() const { return markers.any(); }
Expand All @@ -52,35 +50,6 @@ class Conforming_constrained_Delaunay_triangulation_cell_data_3 {
void clear_mark(CDT_3_cell_marker m) { markers.reset(static_cast<unsigned>(m)); }
void clear_marks() { markers.reset(); }

static unsigned int uint(int i) { return static_cast<unsigned int>(i); }

template <typename Facet_handle>
void set_facet_constraint(int i, CDT_3_signed_index face_id,
Facet_handle facet_2d)
{
this->face_id[uint(i)] = face_id;
this->facet_2d[uint(i)] = static_cast<void*>(facet_2d == Facet_handle{} ? nullptr : std::addressof(*facet_2d));
}

template <typename CDT_2>
auto face_2 (const CDT_2& cdt, int i) const {
using Face = typename CDT_2::Face;
auto ptr = static_cast<Face*>(facet_2d[uint(i)]);
return cdt.tds().faces().iterator_to(*ptr);
}
public:
/// @{
// @cond SKIP_IN_MANUAL
bool is_facet_constrained(int i) const { return face_id[uint(i)] >= 0; }

CDT_3_signed_index face_constraint_index(int i) const {
return face_id[uint(i)];
}

void set_face_constraint_index(int i, CDT_3_signed_index index) {
face_id[uint(i)] = index;
}
/// @endcond
};

} // namespace CGAL
Expand Down
6 changes: 4 additions & 2 deletions Constrained_triangulation_3/include/CGAL/IO/write_MEDIT.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@ void write_MEDIT(std::ostream& os,
const bool has_plc_face_id
= choose_parameter(get_parameter(np, internal_np::with_plc_face_id), false);

auto plc_patch_map = boost::make_function_property_map<Facet>([&](const Facet& f)
{ return has_plc_face_id ? f.first->ccdt_3_data().face_constraint_index(f.second) + 1 : 1; });
auto plc_patch_map = boost::make_function_property_map<Facet>([&](const Facet& f) {
return has_plc_face_id
? ccdt.face_constraint_index(f.first, f.second) + 1
: 1; });

std::vector<typename Tr_::Edge> edges;
return SMDS_3::output_to_medit(os,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <CGAL/license/Constrained_triangulation_3.h>
#include <CGAL/draw_triangulation_3.h>
#include <CGAL/Conforming_constrained_Delaunay_triangulation_3_fwd.h>
#include <CGAL/Constrained_triangulation_3_types.h>
#include <CGAL/type_traits.h>
#include <algorithm>

Expand All @@ -34,35 +35,33 @@ void draw(const Conforming_constrained_Delaunay_triangulation_3<Traits, Tr>& ccd
{
using Tr_ = CGAL::cpp20::remove_cvref_t<decltype(ccdt.triangulation())>;
using Vertex_handle = typename Tr_::Vertex_handle;
using Cell_handle = typename Tr_::Cell_handle;
using Edge_descriptor = typename Tr_::Finite_edges_iterator;
using Facet_descriptor = typename Tr_::Finite_facets_iterator;

using Face_index = CGAL::cpp20::remove_cvref_t<
decltype(std::declval<Cell_handle>()->ccdt_3_data().face_constraint_index(0))>;
using Face_index = CDT_3_signed_index;

Face_index nb_colors = 0;
std::for_each(
ccdt.constrained_facets_begin(), ccdt.constrained_facets_end(),
[&](const auto& f) {
auto [c, index] = f;
nb_colors = (std::max)(nb_colors, c->ccdt_3_data().face_constraint_index(index) + 1);
nb_colors = (std::max)(nb_colors, ccdt.face_constraint_index(c, index) + 1);
});
std::vector<CGAL::IO::Color> colors(nb_colors);
std::generate(colors.begin(), colors.end(), []() {
return CGAL::get_random_color(CGAL::get_default_random());
});
CGAL::Graphics_scene_options<Tr_, Vertex_handle, Edge_descriptor, Facet_descriptor> options;
options.draw_face = [](const Tr_&, Facet_descriptor f) {
options.draw_face = [&](const Tr_&, Facet_descriptor f) {
auto [c, index] = *f;
return c->ccdt_3_data().is_facet_constrained(index);
return ccdt.is_facet_constrained(c, index);
};
options.colored_face = [](const Tr_&, Facet_descriptor) {
return true;
};
options.face_color = [&](const Tr_&, Facet_descriptor f) {
auto [c, index] = *f;
return colors[c->ccdt_3_data().face_constraint_index(index)];
return colors[ccdt.face_constraint_index(c, index)];
};
draw(ccdt.triangulation(), options, title);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ std::function<void()> create_output_finalizer(const CDT& cdt, const CDT_options&
cells_map[ch] = 0;
for (int i = 0; i < 4; ++i)
{
if(ch->ccdt_3_data().is_facet_constrained(i))
if(cdt.is_facet_constrained(ch, i))
continue;
auto n = ch->neighbor(i);
if (cells_map[n] == 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ typedef CGAL::Mesh_triangulation_3<
typedef CGAL::Mesh_complex_3_in_triangulation_3<Tr> C3t3;

// Criteria
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;
typedef CGAL::Mesh_criteria_3<C3t3> Mesh_criteria;

// (Unweighted) point type
typedef Tr::Bare_point Point;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ typedef CGAL::Mesh_triangulation_3<
typedef CGAL::Mesh_complex_3_in_triangulation_3<Tr> C3t3;

// Criteria
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;
typedef CGAL::Mesh_criteria_3<C3t3> Mesh_criteria;

// (Unweighted) point type
typedef Tr::Bare_point Point;
Expand Down
2 changes: 1 addition & 1 deletion Generator/test/Generator/generic_random_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ typedef Mesh_domain::Curve_index Curve_index;
typedef CGAL::Mesh_triangulation_3<Mesh_domain>::type Tr;
typedef CGAL::Mesh_complex_3_in_triangulation_3<
Tr, Corner_index, Curve_index> C3t3;
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;
typedef CGAL::Mesh_criteria_3<C3t3> Mesh_criteria;
typedef C3t3::Point Point;

int test_triangles_2(const FT eps)
Expand Down
9 changes: 9 additions & 0 deletions Installation/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ Release date: December 2026
- Deprecated the existing overload of `snap_rounding_2()`.
- Added a new overload of `snap_rounding_2()` that automatically dispatch to either `vertical_slab_snap_rounding_2()` or `hot_pixel_snap_rounding_2()`, depending on the provided traits class.

### [3D Mesh Generation](https://doc.cgal.org/6.3/Manual/packages.html#PkgMesh3)

- **Breaking change**: The template parameter of `CGAL::Mesh_cell_criteria_3`,
`CGAL::Mesh_edge_criteria_3`, and `CGAL::Mesh_facet_criteria_3` is now the
mesh complex type `C3T3`, rather than its triangulation type. Code that
explicitly instantiates these criteria classes must be updated accordingly.
`CGAL::Mesh_criteria_3` also uses `C3T3` as its template parameter, but
continues to accept the triangulation type for backward compatibility.

### [3D Triangulations](https://doc.cgal.org/6.3/Manual/packages.html#PkgTriangulation3)
- **Breaking change** Removed the class template `Regular_triangulation_euclidean_traits_3` which was deprecated since CGAL-4.10
- **Breaking change** Removed the member function `vertices_in_conflict()` of the Delaunay and the regular triangulation which were deprecated since CGAL-3.8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ template <typename Tr,
typename CurveIndex = int>
class Mesh_complex_3_in_triangulation_3;

template<class Tr, bool c3t3_loader_failed>
bool build_triangulation_from_file(std::istream& is,
Tr& tr,
bool replace_domain_0);

template<class Tr, bool c3t3_loader_failed>
bool build_triangulation_from_file(std::istream& is,
Tr& tr);
template <class C3T3, bool c3t3_loader_failed>
bool build_mesh_complex_from_file(std::istream& is,
C3T3& c3t3,
bool replace_domain_0);

template <class C3T3, bool c3t3_loader_failed>
bool build_mesh_complex_from_file(std::istream& is,
C3T3& c3t3);
} // CGAL
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ bool build_triangulation_from_file(std::istream& is,
const bool allow_negative_orientation = false,
CxEdgesOutputIterator cx_edges_oit = CxEdgesOutputIterator());

template <class C3T3,
class CxEdgesOutputIterator = CGAL::Emptyset_iterator>
bool build_mesh_complex_from_file(std::istream& is,
C3T3& c3t3,
const bool verbose = false,
const bool replace_domain_0 = false,
const bool allow_non_manifold = false,
const bool allow_negative_orientation = false,
CxEdgesOutputIterator cx_edges_oit = CxEdgesOutputIterator());

} // namespace SMDS_3
} // namespace CGAL
#endif
Expand Down
21 changes: 12 additions & 9 deletions Lab/demo/Lab/Plugins/IO/VTK_io_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <CGAL/IO/output_to_vtu.h>
#include <CGAL/boost/graph/IO/VTK.h>
#include <CGAL/IO/VTK.h>
#include <CGAL/iterator.h>

#include <vtkSmartPointer.h>
#include <vtkDataSetReader.h>
Expand Down Expand Up @@ -428,7 +429,7 @@ class CGAL_Lab_vtk_plugin :
subdomains.push_back(si);
}
std::map<Facet, int> border_facets;
//Preprocessing for build_triangulation
//Preprocessing for build_mesh_complex
//check for orientation and swap in cells if not good.
for(std::size_t i=0; i<finite_cells.size(); ++i)
{
Expand All @@ -447,12 +448,14 @@ class CGAL_Lab_vtk_plugin :

std::vector<std::array<int, 3>> feature_edges;
std::vector<std::array<int, 2>> corners;
std::vector<Tr::Vertex_handle> vertex_handle_vector;

CGAL::SMDS_3::build_triangulation_with_subdomains_range(
c3t3_item->c3t3().triangulation(),
CGAL::SMDS_3::build_mesh_complex_with_subdomains_range(
c3t3_item->c3t3(),
points, finite_cells, subdomains, border_facets,
feature_edges, corners,
CGAL::Emptyset_iterator(),
vertex_handle_vector,
CGAL::Emptyset_iterator{},
false, false, true, true);

for( C3t3::Triangulation::Finite_cells_iterator
Expand All @@ -464,9 +467,9 @@ class CGAL_Lab_vtk_plugin :
c3t3_item->c3t3().add_to_complex(cit, cit->info());
for(int i=0; i < 4; ++i)
{
if(cit->surface_patch_index(i)>0)
if(c3t3_item->c3t3().surface_patch_index(cit, i) > 0)
{
c3t3_item->c3t3().add_to_complex(cit, i, cit->surface_patch_index(i));
c3t3_item->c3t3().add_to_complex(cit, i, c3t3_item->c3t3().surface_patch_index(cit, i));
}
}
}
Expand All @@ -485,11 +488,11 @@ class CGAL_Lab_vtk_plugin :
Cell_handle nc = c->neighbor(fit->second);

// By definition, Subdomain_index() is supposed to be the id of the exterior
if(c->subdomain_index() != C3t3::Triangulation::Cell::Subdomain_index() &&
nc->subdomain_index() == C3t3::Triangulation::Cell::Subdomain_index())
if(c3t3_item->c3t3().subdomain_index(c) != C3t3::Subdomain_index() &&
c3t3_item->c3t3().subdomain_index(nc) == C3t3::Subdomain_index())
{
// Color the border facet with the index of its cell
c3t3_item->c3t3().add_to_complex(c, fit->second, c->subdomain_index());
c3t3_item->c3t3().add_to_complex(c, fit->second, c3t3_item->c3t3().subdomain_index(c));
}
}
}
Expand Down
18 changes: 9 additions & 9 deletions Lab/demo/Lab/Plugins/Mesh_3/C3t3_io_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ CGAL_Lab_c3t3_binary_io_plugin::load(

item->setName(fileinfo.completeBaseName());

if (CGAL::IO::read_AVIZO_TETRA(in, item->c3t3().triangulation()))
if (CGAL::IO::read_AVIZO_TETRA(in, item->c3t3()))
{
update_c3t3(item->c3t3());

Expand Down Expand Up @@ -449,14 +449,14 @@ update_c3t3(C3t3& c3t3)
c3t3.rescan_after_load_of_triangulation(); //fix counters for facets and cells
for (Cell_handle cit : c3t3.triangulation().finite_cell_handles())
{
CGAL_assertion(cit->subdomain_index() >= 0);
if (cit->subdomain_index() != C3t3::Triangulation::Cell::Subdomain_index())
c3t3.add_to_complex(cit, cit->subdomain_index());
CGAL_assertion(c3t3.subdomain_index(cit) >= 0);
if (c3t3.subdomain_index(cit) != C3t3::Subdomain_index())
c3t3.add_to_complex(cit, c3t3.subdomain_index(cit));

for (int i = 0; i < 4; ++i)
{
if (cit->surface_patch_index(i) > 0)
c3t3.add_to_complex(cit, i, cit->surface_patch_index(i));
if (c3t3.surface_patch_index(cit, i) > 0)
c3t3.add_to_complex(cit, i, c3t3.surface_patch_index(cit, i));
}
}

Expand All @@ -469,11 +469,11 @@ update_c3t3(C3t3& c3t3)
Cell_handle nc = c->neighbor(fit.second);

// By definition, Subdomain_index() is supposed to be the id of the exterior
if (c->subdomain_index() != C3t3::Triangulation::Cell::Subdomain_index() &&
nc->subdomain_index() == C3t3::Triangulation::Cell::Subdomain_index())
if (c3t3.subdomain_index(c) != C3t3::Subdomain_index() &&
c3t3.subdomain_index(nc) == C3t3::Subdomain_index())
{
// Color the border facet with the index of its cell
c3t3.add_to_complex(c, fit.second, c->subdomain_index());
c3t3.add_to_complex(c, fit.second, c3t3.subdomain_index(c));
}
}
}
Expand Down
Loading
Loading