Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/render/geometry.h
| Show All 17 Lines | |||||
| #define __GEOMETRY_H__ | #define __GEOMETRY_H__ | ||||
| #include "graph/node.h" | #include "graph/node.h" | ||||
| #include "bvh/bvh_params.h" | #include "bvh/bvh_params.h" | ||||
| #include "render/attribute.h" | #include "render/attribute.h" | ||||
| #include "util/util_api.h" | |||||
| #include "util/util_boundbox.h" | #include "util/util_boundbox.h" | ||||
| #include "util/util_set.h" | #include "util/util_set.h" | ||||
| #include "util/util_transform.h" | #include "util/util_transform.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 | ||||
| Show All 12 Lines | |||||
| /* Geometry | /* Geometry | ||||
| * | * | ||||
| * Base class for geometric types like Mesh and Hair. */ | * Base class for geometric types like Mesh and Hair. */ | ||||
| class Geometry : public Node { | class Geometry : public Node { | ||||
| public: | public: | ||||
| NODE_ABSTRACT_DECLARE | NODE_ABSTRACT_DECLARE | ||||
| /* Shaders */ | |||||
| NODE_SOCKET_API_ARRAY(array<Node *>, used_shaders) | |||||
| /* Motion Blur */ | |||||
| NODE_SOCKET_API(uint, motion_steps) | |||||
| NODE_SOCKET_API(bool, use_motion_blur) | |||||
| enum Type { | enum Type { | ||||
| MESH, | MESH, | ||||
| HAIR, | HAIR, | ||||
| VOLUME, | VOLUME, | ||||
| }; | }; | ||||
| Type geometry_type; | GET_READ_ONLY(Type, geometry_type) | ||||
| /* Attributes */ | /* Attributes */ | ||||
| AttributeSet attributes; | GET(AttributeSet, attributes) | ||||
| /* Shaders */ | |||||
| NODE_SOCKET_API_ARRAY(array<Node *>, used_shaders) | |||||
| /* Transform */ | /* Transform */ | ||||
| BoundBox bounds; | GET_SET(BoundBox, bounds) | ||||
| bool transform_applied; | GET_SET(bool, transform_applied) | ||||
| bool transform_negative_scaled; | GET_SET(bool, transform_negative_scaled) | ||||
| Transform transform_normal; | GET_SET(Transform, transform_normal) | ||||
| /* Motion Blur */ | |||||
| NODE_SOCKET_API(uint, motion_steps) | |||||
| NODE_SOCKET_API(bool, use_motion_blur) | |||||
| /* Maximum number of motion steps supported (due to Embree). */ | /* Maximum number of motion steps supported (due to Embree). */ | ||||
| static const uint MAX_MOTION_STEPS = 129; | static const uint MAX_MOTION_STEPS = 129; | ||||
| /* BVH */ | /* BVH */ | ||||
| BVH *bvh; | GET_SET(BVH *, bvh) | ||||
| size_t attr_map_offset; | GET_SET(size_t, attr_map_offset) | ||||
| size_t prim_offset; | GET_SET(size_t, prim_offset) | ||||
| size_t optix_prim_offset; | GET_SET(size_t, optix_prim_offset) | ||||
| /* Shader Properties */ | /* Shader Properties */ | ||||
| bool has_volume; /* Set in the device_update_flags(). */ | GET_SET(bool, has_volume) /* Set in the device_update_flags(). */ | ||||
| bool has_surface_bssrdf; /* Set in the device_update_flags(). */ | GET_SET(bool, has_surface_bssrdf) /* Set in the device_update_flags(). */ | ||||
| /* Update Flags */ | /* Update Flags */ | ||||
| bool need_update_rebuild; | GET_SET(bool, need_update_rebuild) | ||||
| /* Index into scene->geometry (only valid during update) */ | /* Index into scene->geometry (only valid during update) */ | ||||
| size_t index; | GET_SET(size_t, index) | ||||
| public: | |||||
| /* Constructor/Destructor */ | /* Constructor/Destructor */ | ||||
| explicit Geometry(const NodeType *node_type, const Type type); | explicit Geometry(const NodeType *node_type, const Type type); | ||||
| virtual ~Geometry(); | virtual ~Geometry(); | ||||
| /* Geometry */ | /* Geometry */ | ||||
| virtual void clear(bool preserve_shaders = false); | virtual void clear(bool preserve_shaders = false); | ||||
| virtual void compute_bounds() = 0; | virtual void compute_bounds() = 0; | ||||
| virtual void apply_transform(const Transform &tfm, const bool apply_to_motion) = 0; | virtual void apply_transform(const Transform &tfm, const bool apply_to_motion) = 0; | ||||
| ▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | bool is_mesh() const | ||||
| return geometry_type == MESH; | return geometry_type == MESH; | ||||
| } | } | ||||
| bool is_hair() const | bool is_hair() const | ||||
| { | { | ||||
| return geometry_type == HAIR; | return geometry_type == HAIR; | ||||
| } | } | ||||
| bool is_volume() const | |||||
| { | |||||
| return geometry_type == VOLUME; | |||||
| } | |||||
| /* Updates */ | /* Updates */ | ||||
| void tag_update(Scene *scene, bool rebuild); | void tag_update(Scene *scene, bool rebuild); | ||||
| void tag_bvh_update(bool rebuild); | void tag_bvh_update(bool rebuild); | ||||
| }; | }; | ||||
| /* Geometry Manager */ | /* Geometry Manager */ | ||||
| ▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines | |||||