Blender V4.3
sculpt_boundary.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2024 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8#pragma once
9
10#include <memory>
11
12#include "BLI_array.hh"
13#include "BLI_bit_span.hh"
14#include "BLI_map.hh"
15#include "BLI_math_vector.hh"
16#include "BLI_offset_indices.hh"
17#include "BLI_span.hh"
18#include "BLI_vector.hh"
19
20struct Brush;
21struct BMVert;
22struct Depsgraph;
23struct Object;
25struct SculptSession;
26struct SubdivCCG;
27struct SubdivCCGCoord;
28namespace blender::bke::pbvh {
29class Node;
30}
31
33
35 /* Vertex indices of the active boundary. */
37
38 /* Distance from a vertex in the boundary to initial vertex indexed by vertex index, taking into
39 * account the length of all edges between them. Any vertex that is not in the boundary will have
40 * a distance of 0. */
42
43 /* Data for drawing the preview. */
45
46 /* Initial vertex index in the boundary which is closest to the current sculpt active vertex. */
48
49 /* Vertex that at max_propagation_steps from the boundary and closest to the original active
50 * vertex that was used to initialize the boundary. This is used as a reference to check how much
51 * the deformation will go into the mesh and to calculate the strength of the brushes. */
53
54 /* Stores the initial positions of the pivot and boundary initial vertex as they may be deformed
55 * during the brush action. This allows to use them as a reference positions and vectors for some
56 * brush effects. */
58
59 /* Maximum number of topology steps that were calculated from the boundary. */
61
62 /* Indexed by vertex index, contains the topology information needed for boundary deformations.
63 */
64 struct {
65 /* Vertex index from where the topology propagation reached this vertex. */
67
68 /* How many steps were needed to reach this vertex from the boundary. */
70
71 /* Strength that is used to deform this vertex. */
74
75 /* Bend Deform type. */
76 struct {
80
81 /* Slide Deform type. */
82 struct {
85
86 /* Twist Deform type. */
87 struct {
91};
92
98void ensure_boundary_info(Object &object);
99
105bool vert_is_boundary(GroupedSpan<int> vert_to_face_map,
106 Span<bool> hide_poly,
107 BitSpan boundary,
108 int vert);
110 Span<int> corner_verts,
111 BitSpan boundary,
112 const SubdivCCG &subdiv_ccg,
113 SubdivCCGCoord vert);
114bool vert_is_boundary(BMVert *vert);
115
120std::unique_ptr<SculptBoundary> data_init(const Depsgraph &depsgraph,
121 Object &object,
122 const Brush *brush,
123 int initial_vert,
124 float radius);
125std::unique_ptr<SculptBoundary> data_init_mesh(const Depsgraph &depsgraph,
126 Object &object,
127 const Brush *brush,
128 int initial_vert,
129 float radius);
130std::unique_ptr<SculptBoundary> data_init_grids(Object &object,
131 const Brush *brush,
132 SubdivCCGCoord initial_vert,
133 float radius);
134std::unique_ptr<SculptBoundary> data_init_bmesh(Object &object,
135 const Brush *brush,
136 BMVert *initial_vert,
137 float radius);
138std::unique_ptr<SculptBoundaryPreview> preview_data_init(const Depsgraph &depsgraph,
139 Object &object,
140 const Brush *brush,
141 float radius);
142
143void edges_preview_draw(uint gpuattr,
144 SculptSession &ss,
145 const float outline_col[3],
146 float outline_alpha);
148
149} // namespace blender::ed::sculpt_paint::boundary
unsigned int uint
const Depsgraph * depsgraph
void pivot_line_preview_draw(const uint gpuattr, SculptSession &ss)
std::unique_ptr< SculptBoundary > data_init_bmesh(Object &object, const Brush *brush, BMVert *initial_vert, const float radius)
std::unique_ptr< SculptBoundaryPreview > preview_data_init(const Depsgraph &depsgraph, Object &object, const Brush *brush, const float radius)
std::unique_ptr< SculptBoundary > data_init(const Depsgraph &depsgraph, Object &object, const Brush *brush, const int initial_vert, const float radius)
bool vert_is_boundary(const GroupedSpan< int > vert_to_face_map, const Span< bool > hide_poly, const BitSpan boundary, const int vert)
Definition sculpt.cc:454
void edges_preview_draw(const uint gpuattr, SculptSession &ss, const float outline_col[3], const float outline_alpha)
std::unique_ptr< SculptBoundary > data_init_mesh(const Depsgraph &depsgraph, Object &object, const Brush *brush, const int initial_vert, const float radius)
void ensure_boundary_info(Object &object)
Definition sculpt.cc:5770
std::unique_ptr< SculptBoundary > data_init_grids(Object &object, const Brush *brush, const SubdivCCGCoord initial_vert, const float radius)
Vector< std::pair< float3, float3 > > edges
struct blender::ed::sculpt_paint::boundary::SculptBoundary::@472 edit_info
struct blender::ed::sculpt_paint::boundary::SculptBoundary::@474 slide
struct blender::ed::sculpt_paint::boundary::SculptBoundary::@475 twist
struct blender::ed::sculpt_paint::boundary::SculptBoundary::@473 bend