mirror of https://github.com/CGAL/cgal
Add license headers
This commit is contained in:
parent
1f10fb93d7
commit
b4ef9e44b7
|
|
@ -1,12 +1,23 @@
|
|||
// Copyright (c) 2022 INRIA Sophia-Antipolis (France).
|
||||
// All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org).
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
|
||||
//
|
||||
// Author(s) : Julian Stahl
|
||||
|
||||
#ifndef CGAL_CARTESIAN_GRID_3_H
|
||||
#define CGAL_CARTESIAN_GRID_3_H
|
||||
|
||||
#include <CGAL/Bbox_3.h>
|
||||
#include <CGAL/Image_3.h>
|
||||
|
||||
#include <array>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
#include <array>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
@ -20,7 +31,7 @@ public:
|
|||
public:
|
||||
Cartesian_grid_3(const std::size_t xdim, const std::size_t ydim, const std::size_t zdim, const Bbox_3 &bbox)
|
||||
: sizes{xdim, ydim, zdim}, bbox(bbox) {
|
||||
|
||||
|
||||
values.resize(xdim * ydim * zdim);
|
||||
gradients.resize(xdim * ydim * zdim);
|
||||
|
||||
|
|
@ -60,11 +71,11 @@ public:
|
|||
return sizes[2];
|
||||
}
|
||||
|
||||
const Bbox_3& get_bbox() const {
|
||||
const Bbox_3 &get_bbox() const {
|
||||
return bbox;
|
||||
}
|
||||
|
||||
const Vector& get_spacing() const {
|
||||
const Vector &get_spacing() const {
|
||||
return spacing;
|
||||
}
|
||||
|
||||
|
|
@ -150,8 +161,8 @@ Image_3 Cartesian_grid_3<GeomTraits>::to_image() const {
|
|||
for (std::size_t x = 0; x < xdim(); x++) {
|
||||
for (std::size_t y = 0; y < ydim(); y++) {
|
||||
for (std::size_t z = 0; z < zdim(); z++) {
|
||||
|
||||
data[(z * ydim() + y) * xdim() + x] = value(x, y, z);
|
||||
|
||||
data[(z * ydim() + y) * xdim() + x] = value(x, y, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,14 @@
|
|||
// Copyright (c) 2022 INRIA Sophia-Antipolis (France).
|
||||
// All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org).
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
|
||||
//
|
||||
// Author(s) : Julian Stahl
|
||||
|
||||
#ifndef CGAL_CARTESIAN_TOPOLOGY_BASE_H
|
||||
#define CGAL_CARTESIAN_TOPOLOGY_BASE_H
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,14 @@
|
|||
// Copyright (c) 2022 INRIA Sophia-Antipolis (France).
|
||||
// All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org).
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
|
||||
//
|
||||
// Author(s) : Julian Stahl
|
||||
|
||||
#ifndef CGAL_DOMAIN_CELL_TYPE
|
||||
#define CGAL_DOMAIN_CELL_TYPE
|
||||
|
||||
|
|
@ -11,10 +22,10 @@ typedef std::size_t Cell_type;
|
|||
static constexpr Cell_type ANY_CELL = std::numeric_limits<Cell_type>::max();
|
||||
|
||||
static constexpr Cell_type POLYHERDAL_CELL = ((Cell_type)1) << 0;
|
||||
static constexpr Cell_type TETRAHEDRAL_CELL = ((Cell_type)1) << 1;
|
||||
static constexpr Cell_type TETRAHEDRAL_CELL = ((Cell_type)1) << 1;
|
||||
static constexpr Cell_type CUBICAL_CELL = ((Cell_type)1) << 2;
|
||||
|
||||
}
|
||||
}
|
||||
} // namespace Isosurfacing
|
||||
} // namespace CGAL
|
||||
|
||||
#endif // CGAL_DOMAIN_CELL_TYPE
|
||||
|
|
@ -1,3 +1,15 @@
|
|||
// Copyright (c) 2022 INRIA Sophia-Antipolis (France).
|
||||
// All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org).
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
|
||||
//
|
||||
// Author(s) : Julian Stahl
|
||||
// Daniel Zint
|
||||
|
||||
#ifndef CGAL_DUAL_CONTOURING_3_H
|
||||
#define CGAL_DUAL_CONTOURING_3_H
|
||||
|
||||
|
|
@ -11,7 +23,8 @@ namespace Isosurfacing {
|
|||
template <typename Concurrency_tag = Sequential_tag, class Domain_, class PointRange, class PolygonRange,
|
||||
class Positioning = internal::Positioning::QEM_SVD<true>>
|
||||
void make_quad_mesh_using_dual_contouring(const Domain_& domain, const typename Domain_::FT iso_value,
|
||||
PointRange& points, PolygonRange& polygons, const Positioning& positioning = Positioning()) {
|
||||
PointRange& points, PolygonRange& polygons,
|
||||
const Positioning& positioning = Positioning()) {
|
||||
|
||||
// static_assert(Domain_::CELL_TYPE & ANY_CELL);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,15 @@
|
|||
// Copyright (c) 2022 INRIA Sophia-Antipolis (France).
|
||||
// All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org).
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
|
||||
//
|
||||
// Author(s) : Daniel Zint
|
||||
// Julian Stahl
|
||||
|
||||
#ifndef CGAL_DUAL_CONTOURING_3_INTERNAL_DUAL_CONTOURING_3_H
|
||||
#define CGAL_DUAL_CONTOURING_3_INTERNAL_DUAL_CONTOURING_3_H
|
||||
|
||||
|
|
@ -62,9 +74,9 @@ public:
|
|||
|
||||
point = CGAL::ORIGIN + (pos[0] + 0.5 * (pos[7] - pos[0])); // set point to voxel center
|
||||
|
||||
std::array<Vector, Tables::N_VERTICES> normals;
|
||||
std::transform(vertices.begin(), vertices.end(), normals.begin(),
|
||||
[&](const auto& v) { return domain.gradient(v); });
|
||||
// std::array<Vector, Tables::N_VERTICES> normals;
|
||||
// std::transform(vertices.begin(), vertices.end(), normals.begin(),
|
||||
// [&](const auto& v) { return domain.gradient(domain.position(v)); });
|
||||
|
||||
// compute edge intersections
|
||||
std::vector<Point> edge_intersections;
|
||||
|
|
@ -78,8 +90,8 @@ public:
|
|||
const FT u = (s[v0] - iso_value) / (s[v0] - s[v1]);
|
||||
const Point p_lerp = CGAL::ORIGIN + ((1 - u) * pos[v0] + u * pos[v1]);
|
||||
edge_intersections.push_back(p_lerp);
|
||||
const Vector n_lerp = (1 - u) * normals[v0] + u * normals[v1];
|
||||
edge_intersection_normals.push_back(n_lerp);
|
||||
// const Vector n_lerp = (1 - u) * normals[v0] + u * normals[v1];
|
||||
edge_intersection_normals.push_back(domain.gradient(p_lerp));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -229,7 +241,10 @@ public:
|
|||
|
||||
point = CGAL::ORIGIN + (pos[0] + 0.5 * (pos[7] - pos[0])); // set point to voxel center
|
||||
|
||||
std::array<Vector, Tables::N_VERTICES> normals = domain.gradient(vh);
|
||||
std::array<Vector, Tables::N_VERTICES> normals;
|
||||
std::transform(vertices.begin(), vertices.end(), normals.begin(),
|
||||
[&](const auto& v) { return domain.gradient(domain.position(v)); });
|
||||
|
||||
|
||||
// compute edge intersections
|
||||
std::vector<Point> edge_intersections;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,43 @@
|
|||
// Copyright (c) 2020 INRIA Sophia-Antipolis (France).
|
||||
// All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org).
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: ( GPL-3.0-or-later OR LicenseRef-Commercial ) AND MIT
|
||||
//
|
||||
// Author(s) : Julian Stahl
|
||||
//
|
||||
// This file incorporates work covered by the following copyright and permission notice:
|
||||
//
|
||||
// MIT License
|
||||
//
|
||||
// Copyright (c) 2020 Roberto Grosso
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
//
|
||||
//
|
||||
// The code below uses the version of
|
||||
// https://github.com/rogrosso/tmc available on 15th of September 2022.
|
||||
//
|
||||
|
||||
#ifndef CGAL_MARCHING_CUBES_3_INTERNAL_TABLES_H
|
||||
#define CGAL_MARCHING_CUBES_3_INTERNAL_TABLES_H
|
||||
|
||||
|
|
@ -90,8 +130,8 @@ constexpr int local_vertex_position[N_VERTICES][3] = {
|
|||
// there are 12 edges, assign to each vertex three edges, the global edge numbering
|
||||
// consist of 3*global_vertex_id + edge_offset.
|
||||
constexpr int global_edge_id[][4] = {{0, 0, 0, 0}, {1, 0, 0, 1}, {0, 1, 0, 0}, {0, 0, 0, 1},
|
||||
{0, 0, 1, 0}, {1, 0, 1, 1},
|
||||
{0, 1, 1, 0}, {0, 0, 1, 1}, {0, 0, 0, 2}, {1, 0, 0, 2}, {1, 1, 0, 2}, {0, 1, 0, 2}};
|
||||
{0, 0, 1, 0}, {1, 0, 1, 1}, {0, 1, 1, 0}, {0, 0, 1, 1},
|
||||
{0, 0, 0, 2}, {1, 0, 0, 2}, {1, 1, 0, 2}, {0, 1, 0, 2}};
|
||||
|
||||
// probably a list without errors
|
||||
// indicates which edges has to be intersected
|
||||
|
|
|
|||
|
|
@ -1,3 +1,15 @@
|
|||
// Copyright (c) 2022 INRIA Sophia-Antipolis (France).
|
||||
// All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org).
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
|
||||
//
|
||||
// Author(s) : Daniel Zint
|
||||
// Julian Stahl
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <CGAL/Isosurfacing_3/internal/Tables.h>
|
||||
|
|
|
|||
Loading…
Reference in New Issue