Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/render/attribute.h
| Show All 15 Lines | |||||
| #ifndef __ATTRIBUTE_H__ | #ifndef __ATTRIBUTE_H__ | ||||
| #define __ATTRIBUTE_H__ | #define __ATTRIBUTE_H__ | ||||
| #include "render/image.h" | #include "render/image.h" | ||||
| #include "kernel/kernel_types.h" | #include "kernel/kernel_types.h" | ||||
| #include "util/util_api.h" | |||||
| #include "util/util_list.h" | #include "util/util_list.h" | ||||
| #include "util/util_param.h" | #include "util/util_param.h" | ||||
| #include "util/util_set.h" | #include "util/util_set.h" | ||||
| #include "util/util_types.h" | #include "util/util_types.h" | ||||
| #include "util/util_vector.h" | #include "util/util_vector.h" | ||||
| CCL_NAMESPACE_BEGIN | CCL_NAMESPACE_BEGIN | ||||
| class Attribute; | class Attribute; | ||||
| class AttributeRequest; | class AttributeRequest; | ||||
| class AttributeRequestSet; | class AttributeRequestSet; | ||||
| class AttributeSet; | class AttributeSet; | ||||
| class ImageHandle; | class ImageHandle; | ||||
| class Geometry; | class Geometry; | ||||
| class Hair; | class Hair; | ||||
| class Mesh; | class Mesh; | ||||
| struct Transform; | struct Transform; | ||||
| /* Attribute | /* Attribute | ||||
| * | * | ||||
| * Arbitrary data layers on meshes. | * Arbitrary data layers on meshes. | ||||
| * Supported types: Float, Color, Vector, Normal, Point */ | * Supported types: Float, Color, Vector, Normal, Point */ | ||||
| class Attribute { | class Attribute { | ||||
| public: | GET_READ_ONLY(ustring, name) | ||||
| ustring name; | |||||
| AttributeStandard std; | GET_SET(AttributeStandard, std) | ||||
| GET_READ_ONLY(TypeDesc, type) | |||||
| GET(vector<char>, buffer) | |||||
| TypeDesc type; | GET_READ_ONLY(AttributeElement, element) | ||||
| vector<char> buffer; | GET_SET(uint, flags) /* enum AttributeFlag */ | ||||
| AttributeElement element; | |||||
| uint flags; /* enum AttributeFlag */ | |||||
| public: | |||||
| Attribute(ustring name, | Attribute(ustring name, | ||||
| TypeDesc type, | TypeDesc type, | ||||
| AttributeElement element, | AttributeElement element, | ||||
| Geometry *geom, | Geometry *geom, | ||||
| AttributePrimitive prim); | AttributePrimitive prim); | ||||
| Attribute(Attribute &&other) = default; | Attribute(Attribute &&other) = default; | ||||
| Attribute(const Attribute &other) = delete; | Attribute(const Attribute &other) = delete; | ||||
| Attribute &operator=(const Attribute &other) = delete; | Attribute &operator=(const Attribute &other) = delete; | ||||
| ▲ Show 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | public: | ||||
| void get_uv_tiles(Geometry *geom, AttributePrimitive prim, unordered_set<int> &tiles) const; | void get_uv_tiles(Geometry *geom, AttributePrimitive prim, unordered_set<int> &tiles) const; | ||||
| }; | }; | ||||
| /* Attribute Set | /* Attribute Set | ||||
| * | * | ||||
| * Set of attributes on a mesh. */ | * Set of attributes on a mesh. */ | ||||
| class AttributeSet { | class AttributeSet { | ||||
| public: | |||||
| Geometry *geometry; | Geometry *geometry; | ||||
| AttributePrimitive prim; | |||||
| list<Attribute> attributes; | |||||
| GET(AttributePrimitive, prim) | |||||
| GET(list<Attribute>, attributes) | |||||
| public: | |||||
| AttributeSet(Geometry *geometry, AttributePrimitive prim); | AttributeSet(Geometry *geometry, AttributePrimitive prim); | ||||
| AttributeSet(AttributeSet &&) = default; | AttributeSet(AttributeSet &&) = default; | ||||
| ~AttributeSet(); | ~AttributeSet(); | ||||
| Attribute *add(ustring name, TypeDesc type, AttributeElement element); | Attribute *add(ustring name, TypeDesc type, AttributeElement element); | ||||
| Attribute *find(ustring name) const; | Attribute *find(ustring name) const; | ||||
| void remove(ustring name); | void remove(ustring name); | ||||
| Attribute *add(AttributeStandard std, ustring name = ustring()); | Attribute *add(AttributeStandard std, ustring name = ustring()); | ||||
| Attribute *find(AttributeStandard std) const; | Attribute *find(AttributeStandard std) const; | ||||
| void remove(AttributeStandard std); | void remove(AttributeStandard std); | ||||
| Attribute *find(AttributeRequest &req); | Attribute *find(const AttributeRequest &req); | ||||
| void remove(Attribute *attribute); | void remove(Attribute *attribute); | ||||
| void resize(bool reserve_only = false); | void resize(bool reserve_only = false); | ||||
| void clear(bool preserve_voxel_data = false); | void clear(bool preserve_voxel_data = false); | ||||
| }; | }; | ||||
| /* AttributeRequest | /* AttributeRequest | ||||
| * | * | ||||
| * Request from a shader to use a certain attribute, so we can figure out | * Request from a shader to use a certain attribute, so we can figure out | ||||
| * which ones we need to export from the host app end store for the kernel. | * which ones we need to export from the host app end store for the kernel. | ||||
| * The attribute is found either by name or by standard attribute type. */ | * The attribute is found either by name or by standard attribute type. */ | ||||
| class AttributeRequest { | class AttributeRequest { | ||||
| public: | GET_READ_ONLY(ustring, name) | ||||
| ustring name; | GET_READ_ONLY(AttributeStandard, std) | ||||
| AttributeStandard std; | |||||
| /* temporary variables used by GeometryManager */ | /* temporary variables used by GeometryManager */ | ||||
| TypeDesc type, subd_type; | GET_SET(TypeDesc, type) | ||||
| AttributeDescriptor desc, subd_desc; | GET_SET(TypeDesc, subd_type) | ||||
| GET_SET(AttributeDescriptor, desc) | |||||
| GET_SET(AttributeDescriptor, subd_desc) | |||||
| public: | |||||
| explicit AttributeRequest(ustring name_); | explicit AttributeRequest(ustring name_); | ||||
| explicit AttributeRequest(AttributeStandard std); | explicit AttributeRequest(AttributeStandard std); | ||||
| }; | }; | ||||
| /* AttributeRequestSet | /* AttributeRequestSet | ||||
| * | * | ||||
| * Set of attributes requested by a shader. */ | * Set of attributes requested by a shader. */ | ||||
| class AttributeRequestSet { | class AttributeRequestSet { | ||||
| public: | GET(vector<AttributeRequest>, requests) | ||||
| vector<AttributeRequest> requests; | |||||
| public: | |||||
| AttributeRequestSet(); | AttributeRequestSet(); | ||||
| ~AttributeRequestSet(); | ~AttributeRequestSet(); | ||||
| void add(ustring name); | void add(ustring name); | ||||
| void add(AttributeStandard std); | void add(AttributeStandard std); | ||||
| void add(AttributeRequestSet &reqs); | void add(AttributeRequestSet &reqs); | ||||
| void add_standard(ustring name); | void add_standard(ustring name); | ||||
| Show All 12 Lines | |||||