Blender V4.3
BKE_mesh_legacy_derived_mesh.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
42/*
43 * NOTE: This structure is read-only, for all practical purposes.
44 * At some point in the future, we may want to consider
45 * creating a replacement structure that implements a proper
46 * abstract mesh kernel interface. Or, we can leave this
47 * as it is and stick with using BMesh and CDDM.
48 */
49
50#include "BLI_compiler_attrs.h"
52#include "BLI_span.hh"
53
55
56struct CCGElem;
57struct CCGKey;
59struct Mesh;
60
65
71 /* Always owned by this object. */
73
74 short tangent_mask; /* which tangent layers are calculated */
75
76 /* Misc. Queries */
77
78 /* Also called in Editmode */
83
92 float *(*getVertArray)(DerivedMesh *dm);
93 blender::int2 *(*getEdgeArray)(DerivedMesh *dm);
94 int *(*getCornerVertArray)(DerivedMesh *dm);
95 int *(*getCornerEdgeArray)(DerivedMesh *dm);
96 int *(*getPolyArray)(DerivedMesh *dm);
97
101 void (*copyVertArray)(DerivedMesh *dm, float (*r_positions)[3]);
103 void (*copyCornerVertArray)(DerivedMesh *dm, int *r_corner_verts);
104 void (*copyCornerEdgeArray)(DerivedMesh *dm, int *r_corner_edges);
105 void (*copyPolyArray)(DerivedMesh *dm, int *r_face_offsets);
106
111 void *(*getVertDataArray)(DerivedMesh *dm, eCustomDataType type);
112 void *(*getEdgeDataArray)(DerivedMesh *dm, eCustomDataType type);
113 void *(*getLoopDataArray)(DerivedMesh *dm, eCustomDataType type);
114 void *(*getPolyDataArray)(DerivedMesh *dm, eCustomDataType type);
115
119 CCGElem **(*getGridData)(DerivedMesh *dm);
120 int *(*getGridOffset)(DerivedMesh *dm);
121 void (*getGridKey)(DerivedMesh *dm, CCGKey *key);
122
123 /* Direct Access Operations
124 * - Can be undefined
125 * - Must be defined for modifiers that only deform however. */
126
129 void (*release)(DerivedMesh *dm);
130};
131
136void DM_init_funcs(DerivedMesh *dm);
137
143void DM_init(DerivedMesh *dm,
144 DerivedMeshType type,
145 int numVerts,
146 int numEdges,
147 int numTessFaces,
148 int numLoops,
149 int numPolys);
150
156 DerivedMesh *source,
157 DerivedMeshType type,
158 int numVerts,
159 int numEdges,
160 int numTessFaces,
161 int numLoops,
162 int numPolys);
163
164void DM_release(DerivedMesh *dm);
165
172
173/* creates a CDDerivedMesh from the given Mesh, this will reference the
174 * original data in Mesh, but it is safe to apply vertex coordinates or
175 * calculate normals as those functions will automatically create new
176 * data to not overwrite the original. */
178
179/* -------------------------------------------------------------------- */
191
200 const DerivedMesh *source, DerivedMesh *dest, int source_index, int dest_index, int count);
201
207void DM_interp_vert_data(const DerivedMesh *source,
208 DerivedMesh *dest,
209 int *src_indices,
210 float *weights,
211 int count,
212 int dest_index);
void * DM_get_edge_data_layer(DerivedMesh *dm, eCustomDataType type)
void DM_release(DerivedMesh *dm)
void DM_interp_vert_data(const DerivedMesh *source, DerivedMesh *dest, int *src_indices, float *weights, int count, int dest_index)
void DM_init(DerivedMesh *dm, DerivedMeshType type, int numVerts, int numEdges, int numTessFaces, int numLoops, int numPolys)
void * DM_get_loop_data_layer(DerivedMesh *dm, eCustomDataType type)
void DM_from_template(DerivedMesh *dm, DerivedMesh *source, DerivedMeshType type, int numVerts, int numEdges, int numTessFaces, int numLoops, int numPolys)
void DM_copy_vert_data(const DerivedMesh *source, DerivedMesh *dest, int source_index, int dest_index, int count)
void * DM_get_vert_data_layer(DerivedMesh *dm, eCustomDataType type)
void DM_init_funcs(DerivedMesh *dm)
DerivedMesh * CDDM_from_mesh(Mesh *mesh)
void * DM_get_poly_data_layer(DerivedMesh *dm, eCustomDataType type)
void DM_set_only_copy(DerivedMesh *dm, const CustomData_MeshMasks *mask)
draw_view in_light_buf[] float
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
int count
int(* getGridSize)(DerivedMesh *dm)
int(* getNumVerts)(DerivedMesh *dm)
int(* getNumPolys)(DerivedMesh *dm)
void(* copyVertArray)(DerivedMesh *dm, float(*r_positions)[3])
void(* copyCornerEdgeArray)(DerivedMesh *dm, int *r_corner_edges)
int(* getNumEdges)(DerivedMesh *dm)
void(* copyEdgeArray)(DerivedMesh *dm, blender::int2 *r_edge)
int(* getNumGrids)(DerivedMesh *dm)
void(* copyPolyArray)(DerivedMesh *dm, int *r_face_offsets)
void(* copyCornerVertArray)(DerivedMesh *dm, int *r_corner_verts)
void(* release)(DerivedMesh *dm)
void(* getGridKey)(DerivedMesh *dm, CCGKey *key)
int(* getNumLoops)(DerivedMesh *dm)