Cleanup: Combine crazyspace C header with C++ header

The distinction would start to become meaningless when we use C++
features in the older C header. The naming and lack of a proper
namespace should be enough to clarify the separation for now.
This commit is contained in:
Hans Goudey
2023-11-13 19:35:36 +01:00
parent 5371f5516c
commit 8f362a175d
10 changed files with 69 additions and 94 deletions

View File

@@ -1,86 +0,0 @@
/* SPDX-FileCopyrightText: 2008 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup bke
*/
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
struct BMEditMesh;
struct Depsgraph;
struct Mesh;
struct Object;
struct ReportList;
struct Scene;
/* `crazyspace.cc` */
/**
* Disable subdivision-surface temporal, get mapped coordinates, and enable it.
*/
float (*BKE_crazyspace_get_mapped_editverts(struct Depsgraph *depsgraph,
struct Object *obedit))[3];
void BKE_crazyspace_set_quats_editmesh(struct BMEditMesh *em,
float (*origcos)[3],
float (*mappedcos)[3],
float (*quats)[4],
bool use_select);
void BKE_crazyspace_set_quats_mesh(struct Mesh *me,
float (*origcos)[3],
float (*mappedcos)[3],
float (*quats)[4]);
/**
* Returns an array of deform matrices for crazy-space correction,
* and the number of modifiers left.
*/
int BKE_crazyspace_get_first_deform_matrices_editbmesh(struct Depsgraph *depsgraph,
struct Scene *,
struct Object *,
struct BMEditMesh *em,
float (**deformmats)[3][3],
float (**deformcos)[3]);
int BKE_sculpt_get_first_deform_matrices(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob,
float (**deformmats)[3][3],
float (**deformcos)[3]);
void BKE_crazyspace_build_sculpt(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob,
float (**deformmats)[3][3],
float (**deformcos)[3]);
/* -------------------------------------------------------------------- */
/** \name Crazy-Space API
* \{ */
void BKE_crazyspace_api_eval(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *object,
struct ReportList *reports);
void BKE_crazyspace_api_displacement_to_deformed(struct Object *object,
struct ReportList *reports,
int vertex_index,
const float displacement[3],
float r_displacement_deformed[3]);
void BKE_crazyspace_api_displacement_to_original(struct Object *object,
struct ReportList *reports,
int vertex_index,
const float displacement_deformed[3],
float r_displacement[3]);
void BKE_crazyspace_api_eval_clear(struct Object *object);
/** \} */
#ifdef __cplusplus
}
#endif

View File

@@ -11,8 +11,12 @@
#include "BLI_math_matrix.hh"
#include "BLI_span.hh"
struct BMEditMesh;
struct Depsgraph;
struct Mesh;
struct Object;
struct ReportList;
struct Scene;
namespace blender::bke::crazyspace {
@@ -61,3 +65,62 @@ GeometryDeformation get_evaluated_grease_pencil_drawing_deformation(const Depsgr
int frame);
} // namespace blender::bke::crazyspace
/**
* Disable subdivision-surface temporal, get mapped coordinates, and enable it.
*/
float (*BKE_crazyspace_get_mapped_editverts(Depsgraph *depsgraph, Object *obedit))[3];
void BKE_crazyspace_set_quats_editmesh(BMEditMesh *em,
float (*origcos)[3],
float (*mappedcos)[3],
float (*quats)[4],
bool use_select);
void BKE_crazyspace_set_quats_mesh(Mesh *me,
float (*origcos)[3],
float (*mappedcos)[3],
float (*quats)[4]);
/**
* Returns an array of deform matrices for crazy-space correction,
* and the number of modifiers left.
*/
int BKE_crazyspace_get_first_deform_matrices_editbmesh(Depsgraph *depsgraph,
Scene *,
Object *,
BMEditMesh *em,
float (**deformmats)[3][3],
float (**deformcos)[3]);
int BKE_sculpt_get_first_deform_matrices(Depsgraph *depsgraph,
Scene *scene,
Object *ob,
float (**deformmats)[3][3],
float (**deformcos)[3]);
void BKE_crazyspace_build_sculpt(Depsgraph *depsgraph,
Scene *scene,
Object *ob,
float (**deformmats)[3][3],
float (**deformcos)[3]);
/* -------------------------------------------------------------------- */
/** \name Crazy-Space API
* \{ */
void BKE_crazyspace_api_eval(Depsgraph *depsgraph,
Scene *scene,
Object *object,
ReportList *reports);
void BKE_crazyspace_api_displacement_to_deformed(Object *object,
ReportList *reports,
int vertex_index,
const float displacement[3],
float r_displacement_deformed[3]);
void BKE_crazyspace_api_displacement_to_original(Object *object,
ReportList *reports,
int vertex_index,
const float displacement_deformed[3],
float r_displacement[3]);
void BKE_crazyspace_api_eval_clear(Object *object);
/** \} */

View File

@@ -363,7 +363,6 @@ set(SRC
BKE_constraint.h
BKE_context.h
BKE_cpp_types.h
BKE_crazyspace.h
BKE_crazyspace.hh
BKE_cryptomatte.h
BKE_cryptomatte.hh

View File

@@ -21,7 +21,6 @@
#include "BLI_utildefines.h"
#include "BKE_DerivedMesh.h"
#include "BKE_crazyspace.h"
#include "BKE_crazyspace.hh"
#include "BKE_curves.hh"
#include "BKE_editmesh.h"

View File

@@ -76,7 +76,7 @@
#include "BKE_camera.h"
#include "BKE_collection.h"
#include "BKE_constraint.h"
#include "BKE_crazyspace.h"
#include "BKE_crazyspace.hh"
#include "BKE_curve.h"
#include "BKE_curves.hh"
#include "BKE_deform.h"

View File

@@ -41,7 +41,7 @@
#include "BKE_ccg.h"
#include "BKE_colortools.h"
#include "BKE_context.h"
#include "BKE_crazyspace.h"
#include "BKE_crazyspace.hh"
#include "BKE_deform.h"
#include "BKE_gpencil_legacy.h"
#include "BKE_idtype.h"

View File

@@ -30,7 +30,7 @@
#include "DNA_object_types.h"
#include "BKE_context.h"
#include "BKE_crazyspace.h"
#include "BKE_crazyspace.hh"
#include "BKE_key.h"
#include "BKE_lattice.h"
#include "BKE_main.h"

View File

@@ -21,7 +21,7 @@
#include "BLI_memarena.h"
#include "BKE_context.h"
#include "BKE_crazyspace.h"
#include "BKE_crazyspace.hh"
#include "BKE_editmesh.h"
#include "BKE_mesh.hh"
#include "BKE_modifier.h"

View File

@@ -15,7 +15,7 @@
#include "BLI_math_vector.h"
#include "BKE_context.h"
#include "BKE_crazyspace.h"
#include "BKE_crazyspace.hh"
#include "BKE_editmesh.h"
#include "BKE_modifier.h"
#include "BKE_scene.h"

View File

@@ -54,7 +54,7 @@ static const EnumPropertyItem space_items[] = {
# include "BKE_bvhutils.h"
# include "BKE_constraint.h"
# include "BKE_context.h"
# include "BKE_crazyspace.h"
# include "BKE_crazyspace.hh"
# include "BKE_customdata.h"
# include "BKE_global.h"
# include "BKE_layer.h"