34 assert(
type == TypeDesc::TypeFloat ||
type == TypeDesc::TypeColor ||
35 type == TypeDesc::TypePoint ||
type == TypeDesc::TypeVector ||
80 char *
data = (
char *)&f;
81 size_t size =
sizeof(f);
83 for (
size_t i = 0; i <
size; i++)
93 char *
data = (
char *)&f;
94 size_t size =
sizeof(f);
96 for (
size_t i = 0; i <
size; i++)
106 char *
data = (
char *)&f;
107 size_t size =
sizeof(f);
109 for (
size_t i = 0; i <
size; i++)
119 char *
data = (
char *)&f;
120 size_t size =
sizeof(f);
122 for (
size_t i = 0; i <
size; i++)
132 char *
data = (
char *)&f;
133 size_t size =
sizeof(f);
135 for (
size_t i = 0; i <
size; i++)
145 for (
size_t i = 0; i <
size; i++)
153 assert(other.std ==
std);
154 assert(other.type ==
type);
155 assert(other.element ==
element);
157 this->
flags = other.flags;
159 if (this->
buffer.size() != other.buffer.size()) {
160 this->
buffer = std::move(other.buffer);
163 else if (memcmp(this->
data(), other.data(), other.buffer.size()) != 0) {
164 this->
buffer = std::move(other.buffer);
175 else if (
type == TypeDesc::TypeFloat)
176 return sizeof(
float);
179 else if (
type == TypeDesc::TypeMatrix)
242 Hair *hair =
static_cast<Hair *
>(geom);
248 Hair *hair =
static_cast<Hair *
>(geom);
249 size = hair->get_curve_keys().size();
254 Hair *hair =
static_cast<Hair *
>(geom);
255 size = hair->get_curve_keys().size() * (hair->get_motion_steps() - 1);
275 if (
a == TypeDesc::TypeColor ||
a == TypeDesc::TypePoint ||
a == TypeDesc::TypeVector ||
276 a == TypeDesc::TypeNormal) {
277 if (b == TypeDesc::TypeColor || b == TypeDesc::TypePoint || b == TypeDesc::TypeVector ||
278 b == TypeDesc::TypeNormal) {
293 for (
int i = 0; i < 4; i++) {
298 *((
float *)dst) += *((
float *)src) * weight;
304 *((float4 *)dst) += *((float4 *)src) * weight;
307 assert(!
"not implemented for this type");
323 return "generated_transform";
327 return "tangent_sign";
329 return "vertex_color";
333 return "undisplaced";
341 return "curve_intercept";
343 return "curve_random";
345 return "ptex_face_id";
357 return "temperature";
363 return "random_per_island";
388 unordered_set<int> &tiles)
const
396 for (
int i = 0; i < num; i++, uv++) {
397 float u = uv->
x,
v = uv->
y;
398 int x = (int)u,
y = (
int)
v;
400 if (
x < 0 || y < 0 || x >= 10) {
406 if (
x > 0 && (u <
x + 1e-6f)) {
409 if (
y > 0 && (
v <
y + 1e-6f)) {
413 tiles.insert(1001 + 10 *
y +
x);
420 : geometry(geometry), prim(prim)
450 if (attr.
name == name)
461 list<Attribute>::iterator it;
477 if (name == ustring())
607 list<Attribute>::iterator it;
646 if (preserve_voxel_data) {
647 list<Attribute>::iterator it;
666 foreach (
Attribute &attr, new_attributes.attributes) {
673 list<Attribute>::iterator it;
676 if (new_attributes.find(it->std) ==
nullptr) {
682 else if (it->name !=
"") {
683 if (new_attributes.find(it->name) ==
nullptr) {
712 type = TypeDesc::TypeFloat;
728 type = TypeDesc::TypeFloat;
754 for (
size_t i = 0; i <
requests.size(); i++) {
757 for (
size_t j = 0; j <
requests.size() && !found; j++)
773 if (req.
name == name) {
819 if (req.
name == name)
typedef float(TangentPoint)[2]
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
ATTR_WARN_UNUSED_RESULT const void * element
ATTR_WARN_UNUSED_RESULT const BMVert * v
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
vector< AttributeRequest > requests
bool modified(const AttributeRequestSet &other)
void add_standard(ustring name)
AttributeRequest(ustring name_)
AttributeDescriptor subd_desc
Attribute * add(ustring name, TypeDesc type, AttributeElement element)
void update(AttributeSet &&new_attributes)
list< Attribute > attributes
Attribute * find(ustring name) const
void remove(ustring name)
AttributeSet(Geometry *geometry, AttributePrimitive prim)
void resize(bool reserve_only=false)
void clear(bool preserve_voxel_data=false)
ImageHandle & data_voxel()
static bool same_storage(TypeDesc a, TypeDesc b)
void add_with_weight(void *dst, void *src, float weight)
static AttributeStandard name_standard(const char *name)
void resize(Geometry *geom, AttributePrimitive prim, bool reserve_only)
size_t element_size(Geometry *geom, AttributePrimitive prim) const
void get_uv_tiles(Geometry *geom, AttributePrimitive prim, unordered_set< int > &tiles) const
void set_data_from(Attribute &&other)
void zero_data(void *dst)
Attribute(ustring name, TypeDesc type, AttributeElement element, Geometry *geom, AttributePrimitive prim)
static const char * standard_name(AttributeStandard std)
size_t buffer_size(Geometry *geom, AttributePrimitive prim) const
size_t data_sizeof() const
#define CCL_NAMESPACE_END
@ ATTR_STD_CURVE_INTERCEPT
@ ATTR_STD_GENERATED_TRANSFORM
@ ATTR_STD_MOTION_VERTEX_NORMAL
@ ATTR_STD_VOLUME_TEMPERATURE
@ ATTR_STD_VOLUME_DENSITY
@ ATTR_STD_POSITION_UNDISPLACED
@ ATTR_STD_VOLUME_VELOCITY
@ ATTR_STD_POSITION_UNDEFORMED
@ ATTR_STD_MOTION_VERTEX_POSITION
@ ATTR_STD_UV_TANGENT_SIGN
@ ATTR_STD_RANDOM_PER_ISLAND
@ ATTR_ELEMENT_CORNER_BYTE
@ ATTR_ELEMENT_CURVE_KEY_MOTION
@ ATTR_ELEMENT_VERTEX_MOTION
size_t num_curves() const
size_t get_num_subd_faces() const
size_t num_triangles() const
size_t get_num_subd_verts()
static constexpr TypeDesc TypeRGBA(TypeDesc::FLOAT, TypeDesc::VEC4, TypeDesc::COLOR)
CCL_NAMESPACE_BEGIN static constexpr OIIO_NAMESPACE_USING TypeDesc TypeFloat2(TypeDesc::FLOAT, TypeDesc::VEC2)