A lot of files were missing copyright field in the header and
the Blender Foundation contributed to them in a sense of bug
fixing and general maintenance.
This change makes it explicit that those files are at least
partially copyrighted by the Blender Foundation.
Note that this does not make it so the Blender Foundation is
the only holder of the copyright in those files, and developers
who do not have a signed contract with the foundation still
hold the copyright as well.
Another aspect of this change is using SPDX format for the
header. We already used it for the license specification,
and now we state it for the copyright as well, following the
FAQ:
https://reuse.software/faq/
75 lines
2.0 KiB
C++
75 lines
2.0 KiB
C++
/* SPDX-FileCopyrightText: 2020 Blender Foundation
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/** \file
|
|
* \ingroup bke
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "BLI_sys_types.h"
|
|
|
|
struct BMesh;
|
|
struct Mesh;
|
|
struct MultiresModifierData;
|
|
|
|
typedef struct MultiresUnsubdivideGrid {
|
|
/* For sanity checks. */
|
|
int grid_index;
|
|
int grid_size;
|
|
|
|
/** Grid coordinates in object space. */
|
|
float (*grid_co)[3];
|
|
|
|
} MultiresUnsubdivideGrid;
|
|
|
|
typedef struct MultiresUnsubdivideContext {
|
|
/* Input Mesh to un-subdivide. */
|
|
struct Mesh *original_mesh;
|
|
struct MDisps *original_mdisp;
|
|
|
|
/** Number of subdivision in the grids of the input mesh. */
|
|
int num_original_levels;
|
|
|
|
/** Level 0 base mesh after applying the maximum amount of unsubdivisions. */
|
|
struct Mesh *base_mesh;
|
|
|
|
/** Limit on how many levels down the unsubdivide operation should create, if possible. */
|
|
int max_new_levels;
|
|
|
|
/** New levels that were created after unsubdividing. */
|
|
int num_new_levels;
|
|
|
|
/**
|
|
* Number of subdivisions that should be applied to the base mesh.
|
|
* (num_new_levels + num_original_levels).
|
|
*/
|
|
int num_total_levels;
|
|
|
|
/** Data for the new grids, indexed by base mesh loop index. */
|
|
int num_grids;
|
|
struct MultiresUnsubdivideGrid *base_mesh_grids;
|
|
|
|
/* Private data. */
|
|
struct BMesh *bm_original_mesh;
|
|
blender::Array<int> loop_to_face_map;
|
|
const int *base_to_orig_vmap;
|
|
} MultiresUnsubdivideContext;
|
|
|
|
/* --------------------------------------------------------------------
|
|
* Construct/destruct reshape context.
|
|
*/
|
|
|
|
void multires_unsubdivide_context_init(MultiresUnsubdivideContext *context,
|
|
struct Mesh *original_mesh,
|
|
struct MultiresModifierData *mmd);
|
|
void multires_unsubdivide_context_free(MultiresUnsubdivideContext *context);
|
|
|
|
/* --------------------------------------------------------------------
|
|
* Rebuild Lower Subdivisions.
|
|
*/
|
|
|
|
/* Rebuilds all subdivision to the level 0 base mesh. */
|
|
bool multires_unsubdivide_to_basemesh(MultiresUnsubdivideContext *context);
|