Blender V5.3
interpolation.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011-2024 Blender Foundation
2 *
3 * SPDX-License-Identifier: Apache-2.0 */
4
5#pragma once
6
7#include "subd/osd.h"
8
9#include "util/types.h"
10#include "util/vector.h"
11
12#include <cstddef>
13#include <functional>
14
16
17class Mesh;
18class Attribute;
19
20/* Attribute Interpolation. */
21
23 std::function<void(const int, const int, const int, const int *, const float2 *, const int)>
26};
27
29 protected:
31
32#ifdef WITH_OPENSUBDIV
33 OsdMesh &osd_mesh;
34 OsdData &osd_data;
35#endif
36
37 public:
40
41#ifdef WITH_OPENSUBDIV
42 SubdAttributeInterpolation(Mesh &mesh, OsdMesh &osd_mesh, OsdData &osd_data);
43#else
45#endif
46
47 void setup();
48
49 protected:
50 bool support_interp_attribute(const Attribute &attr) const;
51 void setup_attribute(const Attribute &subd_attr, Attribute &mesh_attr);
52
53 template<typename T>
54 void setup_attribute_vertex_linear(const Attribute &subd_attr,
55 Attribute &mesh_attr,
56 const int motion_step = -1);
57
58 template<typename T>
59 void setup_attribute_corner_linear(const Attribute &subd_attr,
60 Attribute &mesh_attr,
61 const int motion_step = -1);
62
63#ifdef WITH_OPENSUBDIV
64 template<typename T>
65 void setup_attribute_vertex_smooth(const Attribute &subd_attr,
66 Attribute &mesh_attr,
67 const int motion_step = -1);
68
69 template<typename T>
70 void setup_attribute_corner_smooth(Attribute &mesh_attr,
71 const int channel,
72 const vector<char> &merged_values);
73#endif
74
75 template<typename T> void setup_attribute_face(const Attribute &subd_attr, Attribute &mesh_attr);
76
77 template<typename T> void setup_attribute_type(const Attribute &subd_attr, Attribute &mesh_attr);
78};
79
void setup_attribute_face(const Attribute &subd_attr, Attribute &mesh_attr)
void setup_attribute_type(const Attribute &subd_attr, Attribute &mesh_attr)
void setup_attribute_corner_linear(const Attribute &subd_attr, Attribute &mesh_attr, const int motion_step=-1)
void setup_attribute(const Attribute &subd_attr, Attribute &mesh_attr)
vector< SubdAttribute > triangle_attributes
bool support_interp_attribute(const Attribute &attr) const
vector< SubdAttribute > vertex_attributes
void setup_attribute_vertex_linear(const Attribute &subd_attr, Attribute &mesh_attr, const int motion_step=-1)
#define CCL_NAMESPACE_END
std::function< void(const int, const int, const int, const int *, const float2 *, const int)> interp
vector< char > refined_data