Cleanup: Remove const for Span and by-value types in headers
This commit is contained in:
parent
30d95966d5
commit
6a1009c9f8
|
@ -193,7 +193,7 @@ int insert_key_action(Main *bmain,
|
||||||
PointerRNA *ptr,
|
PointerRNA *ptr,
|
||||||
const std::string &rna_path,
|
const std::string &rna_path,
|
||||||
float frame,
|
float frame,
|
||||||
const Span<float> values,
|
Span<float> values,
|
||||||
eInsertKeyFlags insert_key_flag,
|
eInsertKeyFlags insert_key_flag,
|
||||||
eBezTriple_KeyframeType key_type);
|
eBezTriple_KeyframeType key_type);
|
||||||
|
|
||||||
|
|
|
@ -874,7 +874,7 @@ void gather_attributes(AttributeAccessor src_attributes,
|
||||||
eAttrDomain domain,
|
eAttrDomain domain,
|
||||||
const AnonymousAttributePropagationInfo &propagation_info,
|
const AnonymousAttributePropagationInfo &propagation_info,
|
||||||
const Set<std::string> &skip,
|
const Set<std::string> &skip,
|
||||||
const Span<int> indices,
|
Span<int> indices,
|
||||||
MutableAttributeAccessor dst_attributes);
|
MutableAttributeAccessor dst_attributes);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -186,12 +186,12 @@ struct GeometrySet {
|
||||||
/**
|
/**
|
||||||
* Remove all geometry components with types that are not in the provided list.
|
* Remove all geometry components with types that are not in the provided list.
|
||||||
*/
|
*/
|
||||||
void keep_only(const Span<GeometryComponent::Type> component_types);
|
void keep_only(Span<GeometryComponent::Type> component_types);
|
||||||
/**
|
/**
|
||||||
* Keeps the provided geometry types, but also instances and edit data.
|
* Keeps the provided geometry types, but also instances and edit data.
|
||||||
* Instances must not be removed while using #modify_geometry_sets.
|
* Instances must not be removed while using #modify_geometry_sets.
|
||||||
*/
|
*/
|
||||||
void keep_only_during_modify(const Span<GeometryComponent::Type> component_types);
|
void keep_only_during_modify(Span<GeometryComponent::Type> component_types);
|
||||||
void remove_geometry_during_modify();
|
void remove_geometry_during_modify();
|
||||||
|
|
||||||
void add(const GeometryComponent &component);
|
void add(const GeometryComponent &component);
|
||||||
|
|
|
@ -58,9 +58,9 @@ struct OpenVDBMeshData volume_to_mesh_data(const openvdb::GridBase &grid,
|
||||||
* This can be used to add mesh data from a grid into an existing mesh rather than merging multiple
|
* This can be used to add mesh data from a grid into an existing mesh rather than merging multiple
|
||||||
* meshes later on.
|
* meshes later on.
|
||||||
*/
|
*/
|
||||||
void fill_mesh_from_openvdb_data(const Span<openvdb::Vec3s> vdb_verts,
|
void fill_mesh_from_openvdb_data(Span<openvdb::Vec3s> vdb_verts,
|
||||||
const Span<openvdb::Vec3I> vdb_tris,
|
Span<openvdb::Vec3I> vdb_tris,
|
||||||
const Span<openvdb::Vec4I> vdb_quads,
|
Span<openvdb::Vec4I> vdb_quads,
|
||||||
int vert_offset,
|
int vert_offset,
|
||||||
int face_offset,
|
int face_offset,
|
||||||
int loop_offset,
|
int loop_offset,
|
||||||
|
|
|
@ -118,10 +118,10 @@ class TriangleToEdgeMap {
|
||||||
*/
|
*/
|
||||||
struct MeshData {
|
struct MeshData {
|
||||||
public:
|
public:
|
||||||
const Span<MLoopTri> looptris;
|
Span<MLoopTri> looptris;
|
||||||
const Span<int> corner_verts;
|
Span<int> corner_verts;
|
||||||
const Span<float2> uv_map;
|
Span<float2> uv_map;
|
||||||
const Span<float3> vert_positions;
|
Span<float3> vert_positions;
|
||||||
|
|
||||||
VertToEdgeMap vert_to_edge_map;
|
VertToEdgeMap vert_to_edge_map;
|
||||||
|
|
||||||
|
@ -141,8 +141,8 @@ struct MeshData {
|
||||||
public:
|
public:
|
||||||
explicit MeshData(Span<MLoopTri> looptris,
|
explicit MeshData(Span<MLoopTri> looptris,
|
||||||
Span<int> corner_verts,
|
Span<int> corner_verts,
|
||||||
const Span<float2> uv_map,
|
Span<float2> uv_map,
|
||||||
const Span<float3> vert_positions);
|
Span<float3> vert_positions);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct UVVertex {
|
struct UVVertex {
|
||||||
|
|
|
@ -456,7 +456,7 @@ enum BrushStrokeMode {
|
||||||
|
|
||||||
namespace blender::ed::sculpt_paint::hide {
|
namespace blender::ed::sculpt_paint::hide {
|
||||||
void sync_all_from_faces(Object &object);
|
void sync_all_from_faces(Object &object);
|
||||||
void mesh_show_all(Object &object, const Span<PBVHNode *> nodes);
|
void mesh_show_all(Object &object, Span<PBVHNode *> nodes);
|
||||||
void grids_show_all(Depsgraph &depsgraph, Object &object, Span<PBVHNode *> nodes);
|
void grids_show_all(Depsgraph &depsgraph, Object &object, Span<PBVHNode *> nodes);
|
||||||
void tag_update_visibility(const bContext &C);
|
void tag_update_visibility(const bContext &C);
|
||||||
|
|
||||||
|
|
|
@ -126,14 +126,13 @@ void ED_text_format_register_pov_ini();
|
||||||
* If a string literal is found, the length of the string literal is returned.
|
* If a string literal is found, the length of the string literal is returned.
|
||||||
* Otherwise, 0.
|
* Otherwise, 0.
|
||||||
*/
|
*/
|
||||||
int text_format_string_literal_find(const Span<const char *> string_literals, const char *text);
|
int text_format_string_literal_find(Span<const char *> string_literals, const char *text);
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
/**
|
/**
|
||||||
* Check if #string_literals array is shorted. This validation is required since text formatters do
|
* Check if #string_literals array is shorted. This validation is required since text formatters do
|
||||||
* binary search on these string literals arrays. Used only for assertions.
|
* binary search on these string literals arrays. Used only for assertions.
|
||||||
*/
|
*/
|
||||||
const bool text_format_string_literals_check_sorted_array(
|
const bool text_format_string_literals_check_sorted_array(Span<const char *> &string_literals);
|
||||||
const Span<const char *> &string_literals);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -30,8 +30,8 @@ class BasicParams : public Params {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BasicParams(const LazyFunction &fn,
|
BasicParams(const LazyFunction &fn,
|
||||||
const Span<GMutablePointer> inputs,
|
Span<GMutablePointer> inputs,
|
||||||
const Span<GMutablePointer> outputs,
|
Span<GMutablePointer> outputs,
|
||||||
MutableSpan<std::optional<ValueUsage>> input_usages,
|
MutableSpan<std::optional<ValueUsage>> input_usages,
|
||||||
Span<ValueUsage> output_usages,
|
Span<ValueUsage> output_usages,
|
||||||
MutableSpan<bool> set_outputs);
|
MutableSpan<bool> set_outputs);
|
||||||
|
|
|
@ -62,6 +62,6 @@ AddCurvesOnMeshOutputs add_curves_on_mesh(bke::CurvesGeometry &curves,
|
||||||
|
|
||||||
float3 compute_surface_point_normal(const MLoopTri &looptri,
|
float3 compute_surface_point_normal(const MLoopTri &looptri,
|
||||||
const float3 &bary_coord,
|
const float3 &bary_coord,
|
||||||
const Span<float3> corner_normals);
|
Span<float3> corner_normals);
|
||||||
|
|
||||||
} // namespace blender::geometry
|
} // namespace blender::geometry
|
||||||
|
|
|
@ -21,13 +21,13 @@ namespace blender::geometry {
|
||||||
*/
|
*/
|
||||||
class ReverseUVSampler {
|
class ReverseUVSampler {
|
||||||
private:
|
private:
|
||||||
const Span<float2> uv_map_;
|
Span<float2> uv_map_;
|
||||||
const Span<MLoopTri> looptris_;
|
Span<MLoopTri> looptris_;
|
||||||
int resolution_;
|
int resolution_;
|
||||||
MultiValueMap<int2, int> looptris_by_cell_;
|
MultiValueMap<int2, int> looptris_by_cell_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ReverseUVSampler(const Span<float2> uv_map, const Span<MLoopTri> looptris);
|
ReverseUVSampler(Span<float2> uv_map, Span<MLoopTri> looptris);
|
||||||
|
|
||||||
enum class ResultType {
|
enum class ResultType {
|
||||||
None,
|
None,
|
||||||
|
|
|
@ -129,18 +129,14 @@ class PackIsland {
|
||||||
/** Unchanged by #pack_islands, used by caller. */
|
/** Unchanged by #pack_islands, used by caller. */
|
||||||
int caller_index;
|
int caller_index;
|
||||||
|
|
||||||
void add_triangle(const float2 uv0, const float2 uv1, const float2 uv2);
|
void add_triangle(float2 uv0, float2 uv1, float2 uv2);
|
||||||
void add_polygon(const Span<float2> uvs, MemArena *arena, Heap *heap);
|
void add_polygon(Span<float2> uvs, MemArena *arena, Heap *heap);
|
||||||
|
|
||||||
void build_transformation(const float scale, const double rotation, float r_matrix[2][2]) const;
|
void build_transformation(float scale, double rotation, float r_matrix[2][2]) const;
|
||||||
void build_inverse_transformation(const float scale,
|
void build_inverse_transformation(float scale, double rotation, float r_matrix[2][2]) const;
|
||||||
const double rotation,
|
|
||||||
float r_matrix[2][2]) const;
|
|
||||||
|
|
||||||
float2 get_diagonal_support(const float scale, const float rotation, const float margin) const;
|
float2 get_diagonal_support(float scale, float rotation, float margin) const;
|
||||||
float2 get_diagonal_support_d4(const float scale,
|
float2 get_diagonal_support_d4(float scale, float rotation, float margin) const;
|
||||||
const float rotation,
|
|
||||||
const float margin) const;
|
|
||||||
|
|
||||||
/** Center of AABB and inside-or-touching the convex hull. */
|
/** Center of AABB and inside-or-touching the convex hull. */
|
||||||
float2 pivot_;
|
float2 pivot_;
|
||||||
|
@ -148,7 +144,7 @@ class PackIsland {
|
||||||
float2 half_diagonal_;
|
float2 half_diagonal_;
|
||||||
float pre_rotate_;
|
float pre_rotate_;
|
||||||
|
|
||||||
void place_(const float scale, const UVPhi phi);
|
void place_(float scale, UVPhi phi);
|
||||||
void finalize_geometry_(const UVPackIsland_Params ¶ms, MemArena *arena, Heap *heap);
|
void finalize_geometry_(const UVPackIsland_Params ¶ms, MemArena *arena, Heap *heap);
|
||||||
|
|
||||||
bool can_rotate_(const UVPackIsland_Params ¶ms) const;
|
bool can_rotate_(const UVPackIsland_Params ¶ms) const;
|
||||||
|
@ -165,7 +161,7 @@ class PackIsland {
|
||||||
friend class OverlapMerger;
|
friend class OverlapMerger;
|
||||||
};
|
};
|
||||||
|
|
||||||
float pack_islands(const Span<PackIsland *> &islands, const UVPackIsland_Params ¶ms);
|
float pack_islands(Span<PackIsland *> islands, const UVPackIsland_Params ¶ms);
|
||||||
|
|
||||||
/** Compute `r = mat * (a + b)` with high precision. */
|
/** Compute `r = mat * (a + b)` with high precision. */
|
||||||
void mul_v2_m2_add_v2v2(float r[2], const float mat[2][2], const float a[2], const float b[2]);
|
void mul_v2_m2_add_v2v2(float r[2], const float mat[2][2], const float a[2], const float b[2]);
|
||||||
|
|
|
@ -2245,7 +2245,7 @@ static void finalize_geometry(const Span<PackIsland *> &islands, const UVPackIsl
|
||||||
BLI_memarena_free(arena);
|
BLI_memarena_free(arena);
|
||||||
}
|
}
|
||||||
|
|
||||||
float pack_islands(const Span<PackIsland *> &islands, const UVPackIsland_Params ¶ms)
|
float pack_islands(const Span<PackIsland *> islands, const UVPackIsland_Params ¶ms)
|
||||||
{
|
{
|
||||||
BLI_assert(0.0f <= params.margin);
|
BLI_assert(0.0f <= params.margin);
|
||||||
BLI_assert(0.0f <= params.target_aspect_y);
|
BLI_assert(0.0f <= params.target_aspect_y);
|
||||||
|
|
|
@ -303,7 +303,7 @@ class BaseSocketDeclarationBuilder {
|
||||||
|
|
||||||
/** The input is evaluated on a subset of the geometry inputs. */
|
/** The input is evaluated on a subset of the geometry inputs. */
|
||||||
BaseSocketDeclarationBuilder &implicit_field_on(ImplicitInputValueFn fn,
|
BaseSocketDeclarationBuilder &implicit_field_on(ImplicitInputValueFn fn,
|
||||||
const Span<int> input_indices);
|
Span<int> input_indices);
|
||||||
|
|
||||||
/** For inputs that are evaluated or available on a subset of the geometry sockets. */
|
/** For inputs that are evaluated or available on a subset of the geometry sockets. */
|
||||||
BaseSocketDeclarationBuilder &field_on(Span<int> indices);
|
BaseSocketDeclarationBuilder &field_on(Span<int> indices);
|
||||||
|
|
|
@ -37,10 +37,7 @@ namespace blender::nodes {
|
||||||
bool check_tool_context_and_error(GeoNodeExecParams ¶ms);
|
bool check_tool_context_and_error(GeoNodeExecParams ¶ms);
|
||||||
void search_link_ops_for_tool_node(GatherLinkSearchOpParams ¶ms);
|
void search_link_ops_for_tool_node(GatherLinkSearchOpParams ¶ms);
|
||||||
|
|
||||||
void transform_mesh(Mesh &mesh,
|
void transform_mesh(Mesh &mesh, float3 translation, math::Quaternion rotation, float3 scale);
|
||||||
const float3 translation,
|
|
||||||
const math::Quaternion rotation,
|
|
||||||
const float3 scale);
|
|
||||||
|
|
||||||
void transform_geometry_set(GeoNodeExecParams ¶ms,
|
void transform_geometry_set(GeoNodeExecParams ¶ms,
|
||||||
GeometrySet &geometry,
|
GeometrySet &geometry,
|
||||||
|
@ -62,9 +59,9 @@ void separate_geometry(GeometrySet &geometry_set,
|
||||||
void get_closest_in_bvhtree(BVHTreeFromMesh &tree_data,
|
void get_closest_in_bvhtree(BVHTreeFromMesh &tree_data,
|
||||||
const VArray<float3> &positions,
|
const VArray<float3> &positions,
|
||||||
const IndexMask &mask,
|
const IndexMask &mask,
|
||||||
const MutableSpan<int> r_indices,
|
MutableSpan<int> r_indices,
|
||||||
const MutableSpan<float> r_distances_sq,
|
MutableSpan<float> r_distances_sq,
|
||||||
const MutableSpan<float3> r_positions);
|
MutableSpan<float3> r_positions);
|
||||||
|
|
||||||
int apply_offset_in_cyclic_range(IndexRange range, int start_index, int offset);
|
int apply_offset_in_cyclic_range(IndexRange range, int start_index, int offset);
|
||||||
|
|
||||||
|
@ -101,14 +98,14 @@ const CPPType &get_simulation_item_cpp_type(eNodeSocketDatatype socket_type);
|
||||||
const CPPType &get_simulation_item_cpp_type(const NodeSimulationItem &item);
|
const CPPType &get_simulation_item_cpp_type(const NodeSimulationItem &item);
|
||||||
|
|
||||||
bke::bake::BakeState move_values_to_simulation_state(
|
bke::bake::BakeState move_values_to_simulation_state(
|
||||||
const Span<NodeSimulationItem> node_simulation_items, const Span<void *> input_values);
|
Span<NodeSimulationItem> node_simulation_items, Span<void *> input_values);
|
||||||
void move_simulation_state_to_values(const Span<NodeSimulationItem> node_simulation_items,
|
void move_simulation_state_to_values(Span<NodeSimulationItem> node_simulation_items,
|
||||||
bke::bake::BakeState zone_state,
|
bke::bake::BakeState zone_state,
|
||||||
const Object &self_object,
|
const Object &self_object,
|
||||||
const ComputeContext &compute_context,
|
const ComputeContext &compute_context,
|
||||||
const bNode &sim_output_node,
|
const bNode &sim_output_node,
|
||||||
Span<void *> r_output_values);
|
Span<void *> r_output_values);
|
||||||
void copy_simulation_state_to_values(const Span<NodeSimulationItem> node_simulation_items,
|
void copy_simulation_state_to_values(Span<NodeSimulationItem> node_simulation_items,
|
||||||
const bke::bake::BakeStateRef &zone_state,
|
const bke::bake::BakeStateRef &zone_state,
|
||||||
const Object &self_object,
|
const Object &self_object,
|
||||||
const ComputeContext &compute_context,
|
const ComputeContext &compute_context,
|
||||||
|
@ -120,7 +117,7 @@ void copy_with_checked_indices(const GVArray &src,
|
||||||
const IndexMask &mask,
|
const IndexMask &mask,
|
||||||
GMutableSpan dst);
|
GMutableSpan dst);
|
||||||
|
|
||||||
void mix_baked_data_item(const eNodeSocketDatatype socket_type,
|
void mix_baked_data_item(eNodeSocketDatatype socket_type,
|
||||||
void *prev,
|
void *prev,
|
||||||
const void *next,
|
const void *next,
|
||||||
const float factor);
|
const float factor);
|
||||||
|
|
Loading…
Reference in New Issue