31 #include "../version.h"
33 namespace OpenSubdiv {
34 namespace OPENSUBDIV_VERSION {
37 template <
class T>
class HbrFace;
47 : faceid(0), initialized(0) {
85 float*
GetData(
int item) {
return data + item; }
88 void Clear(
int startindex,
int width) {
89 memset(data + startindex, 0, width *
sizeof(
float));
95 memset(data, 0, width *
sizeof(
float));
101 float *dst = data + startindex;
102 const float *src = fvvi.data + startindex;
103 for (
int i = 0; i < width; ++i) {
104 *dst++ = weight * *src++;
111 float *dst = data + startindex;
112 const float *src = fvvi.data + startindex;
113 for (
int i = 0; i < width; ++i) {
114 *dst++ += weight * *src++;
122 const float *src = fvvi.data;
123 for (
int i = 0; i < width; ++i) {
124 *dst++ += weight * *src++;
130 bool CompareAll(
int width,
const float *values,
float tolerance=0.0f)
const {
131 if (!initialized)
return false;
132 for (
int i = 0; i < width; ++i) {
133 if (fabsf(values[i] - data[i]) > tolerance)
return false;
141 memcpy(data, values, width *
sizeof(
float));
147 for (
int i = 0; i < width; ++i) {
148 if (fabsf(data[startindex + i] - fvvi.data[startindex + i]) > tolerance)
return false;
159 unsigned int faceid:31;
160 unsigned int initialized:1;
165 using namespace OPENSUBDIV_VERSION;
169 #include "../hbr/fvarEdit.h"
171 namespace OpenSubdiv {
172 namespace OPENSUBDIV_VERSION {
178 const float *src = edit.
GetEdit();
179 for (
int i = 0; i < edit.
GetWidth(); ++i) {
196 using namespace OPENSUBDIV_VERSION;
void ApplyFVarEdit(const HbrFVarEdit< T > &edit)
void AddWithWeightAll(const HbrFVarData &fvvi, int width, float weight)
const float * GetEdit() const
float * GetData(int item)
void SetWithWeight(const HbrFVarData &fvvi, int startindex, int width, float weight)
HbrHierarchicalEdit< T >::Operation GetOperation() const
bool IsInitialized() const
void AddWithWeight(const HbrFVarData &fvvi, int startindex, int width, float weight)
bool Compare(const HbrFVarData &fvvi, int startindex, int width, float tolerance=0.0f) const
void SetAllData(int width, const float *values)
void Clear(int startindex, int width)
bool CompareAll(int width, const float *values, float tolerance=0.0f) const