This repository has been archived on 2023-10-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-archive/source/blender/blenkernel/BKE_curves.h
Hans Goudey c324cf1539 Curves: Further implementation of new curves data structure
The general idea here is to wrap the `CurvesGeometry` DNA struct
with a C++ class that can do most of the heavy lifting for the curve
geometry. Using a C++ class allows easier ways to group methods, easier
const correctness, and code that's more readable and faster to write.
This way, it works much more like a version of `CurveEval` that uses
more efficient attribute storage.

This commit adds the structure of some yet-to-be-implemented code,
the largest thing being mutexes and vectors meant to hold lazily
calculated evaluated positions, tangents, and normals. That part might
change slightly, but it's helpful to be able to see the direction this
commit is aiming in. In particular, the inherently single-threaded
accumulated lengths and Bezier evaluated point offsets might be cached.

Ref T95355

Differential Revision: https://developer.blender.org/D14054
2022-02-16 11:32:37 -06:00

53 lines
1.2 KiB
C++

/* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
#include "DNA_curves_types.h"
/** \file
* \ingroup bke
* \brief Low-level operations for curves that cannot be defined in the C++ header yet.
*/
#ifdef __cplusplus
extern "C" {
#endif
struct BoundBox;
struct Curves;
struct CustomDataLayer;
struct Depsgraph;
struct Main;
struct Object;
struct Scene;
void *BKE_curves_add(struct Main *bmain, const char *name);
struct BoundBox *BKE_curves_boundbox_get(struct Object *ob);
bool BKE_curves_customdata_required(struct Curves *curves, struct CustomDataLayer *layer);
/* Depsgraph */
struct Curves *BKE_curves_copy_for_eval(struct Curves *curves_src, bool reference);
void BKE_curves_data_update(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *object);
/* Draw Cache */
enum {
BKE_CURVES_BATCH_DIRTY_ALL = 0,
};
void BKE_curves_batch_cache_dirty_tag(struct Curves *curves, int mode);
void BKE_curves_batch_cache_free(struct Curves *curves);
extern void (*BKE_curves_batch_cache_dirty_tag_cb)(struct Curves *curves, int mode);
extern void (*BKE_curves_batch_cache_free_cb)(struct Curves *curves);
#ifdef __cplusplus
}
#endif