Add license headers

This commit is contained in:
Julian Stahl 2022-09-15 11:36:30 +02:00
parent 1f10fb93d7
commit b4ef9e44b7
7 changed files with 131 additions and 18 deletions

View File

@ -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 {
@ -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;
}
@ -151,7 +162,7 @@ Image_3 Cartesian_grid_3<GeomTraits>::to_image() const {
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);
}
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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