Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/BKE_geometry_set.hh
| Show First 20 Lines • Show All 351 Lines • ▼ Show 20 Lines | public: | ||||
| /* Utility methods for replacement. */ | /* Utility methods for replacement. */ | ||||
| void replace_mesh(Mesh *mesh, GeometryOwnershipType ownership = GeometryOwnershipType::Owned); | void replace_mesh(Mesh *mesh, GeometryOwnershipType ownership = GeometryOwnershipType::Owned); | ||||
| void replace_pointcloud(PointCloud *pointcloud, | void replace_pointcloud(PointCloud *pointcloud, | ||||
| GeometryOwnershipType ownership = GeometryOwnershipType::Owned); | GeometryOwnershipType ownership = GeometryOwnershipType::Owned); | ||||
| void replace_volume(Volume *volume, | void replace_volume(Volume *volume, | ||||
| GeometryOwnershipType ownership = GeometryOwnershipType::Owned); | GeometryOwnershipType ownership = GeometryOwnershipType::Owned); | ||||
| void replace_curve(CurveEval *curve, | void replace_curve(CurveEval *curve, | ||||
| GeometryOwnershipType ownership = GeometryOwnershipType::Owned); | GeometryOwnershipType ownership = GeometryOwnershipType::Owned); | ||||
| private: | |||||
| /* Utility to retrieve a mutable component without creating it. */ | |||||
| GeometryComponent *get_component_ptr(GeometryComponentType type); | |||||
| template<typename Component> Component *get_component_ptr() | |||||
| { | |||||
| BLI_STATIC_ASSERT(is_geometry_component_v<Component>, ""); | |||||
| return static_cast<Component *>(get_component_ptr(Component::static_type)); | |||||
| } | |||||
| }; | }; | ||||
| /** A geometry component that can store a mesh. */ | /** A geometry component that can store a mesh. */ | ||||
| class MeshComponent : public GeometryComponent { | class MeshComponent : public GeometryComponent { | ||||
| private: | private: | ||||
| Mesh *mesh_ = nullptr; | Mesh *mesh_ = nullptr; | ||||
| GeometryOwnershipType ownership_ = GeometryOwnershipType::Owned; | GeometryOwnershipType ownership_ = GeometryOwnershipType::Owned; | ||||
| ▲ Show 20 Lines • Show All 419 Lines • Show Last 20 Lines | |||||