diff options
author | Jacques Lucke <jacques@blender.org> | 2021-03-10 13:53:17 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-03-10 13:53:31 +0300 |
commit | 368647bd25d6bb0b32f5e439838c06e0e46ac8da (patch) | |
tree | c7c427ef51416358d34413b67f74836db3f96e47 /source/blender/blenkernel/intern | |
parent | 122fefcc8589a09d4e89ed3045f29f07ec6564e9 (diff) |
Geometry Nodes: move geometry component type enum to C
This allows us to use it in rna for the spreadsheet editor.
Diffstat (limited to 'source/blender/blenkernel/intern')
6 files changed, 18 insertions, 18 deletions
diff --git a/source/blender/blenkernel/intern/geometry_component_instances.cc b/source/blender/blenkernel/intern/geometry_component_instances.cc index a6ee7a1b918..68c551645d2 100644 --- a/source/blender/blenkernel/intern/geometry_component_instances.cc +++ b/source/blender/blenkernel/intern/geometry_component_instances.cc @@ -35,7 +35,7 @@ using blender::Span; /** \name Geometry Component Implementation * \{ */ -InstancesComponent::InstancesComponent() : GeometryComponent(GeometryComponentType::Instances) +InstancesComponent::InstancesComponent() : GeometryComponent(GEO_COMPONENT_TYPE_INSTANCES) { } diff --git a/source/blender/blenkernel/intern/geometry_component_mesh.cc b/source/blender/blenkernel/intern/geometry_component_mesh.cc index 53defc89b7e..4019ceb123f 100644 --- a/source/blender/blenkernel/intern/geometry_component_mesh.cc +++ b/source/blender/blenkernel/intern/geometry_component_mesh.cc @@ -39,7 +39,7 @@ using blender::bke::ReadAttributePtr; /** \name Geometry Component Implementation * \{ */ -MeshComponent::MeshComponent() : GeometryComponent(GeometryComponentType::Mesh) +MeshComponent::MeshComponent() : GeometryComponent(GEO_COMPONENT_TYPE_MESH) { } @@ -466,14 +466,14 @@ ReadAttributePtr MeshComponent::attribute_try_adapt_domain(ReadAttributePtr attr static Mesh *get_mesh_from_component_for_write(GeometryComponent &component) { - BLI_assert(component.type() == GeometryComponentType::Mesh); + BLI_assert(component.type() == GEO_COMPONENT_TYPE_MESH); MeshComponent &mesh_component = static_cast<MeshComponent &>(component); return mesh_component.get_for_write(); } static const Mesh *get_mesh_from_component_for_read(const GeometryComponent &component) { - BLI_assert(component.type() == GeometryComponentType::Mesh); + BLI_assert(component.type() == GEO_COMPONENT_TYPE_MESH); const MeshComponent &mesh_component = static_cast<const MeshComponent &>(component); return mesh_component.get_for_read(); } @@ -713,7 +713,7 @@ class VertexGroupsAttributeProvider final : public DynamicAttributesProvider { ReadAttributePtr try_get_for_read(const GeometryComponent &component, const StringRef attribute_name) const final { - BLI_assert(component.type() == GeometryComponentType::Mesh); + BLI_assert(component.type() == GEO_COMPONENT_TYPE_MESH); const MeshComponent &mesh_component = static_cast<const MeshComponent &>(component); const Mesh *mesh = mesh_component.get_for_read(); const int vertex_group_index = mesh_component.vertex_group_names().lookup_default_as( @@ -733,7 +733,7 @@ class VertexGroupsAttributeProvider final : public DynamicAttributesProvider { WriteAttributePtr try_get_for_write(GeometryComponent &component, const StringRef attribute_name) const final { - BLI_assert(component.type() == GeometryComponentType::Mesh); + BLI_assert(component.type() == GEO_COMPONENT_TYPE_MESH); MeshComponent &mesh_component = static_cast<MeshComponent &>(component); Mesh *mesh = mesh_component.get_for_write(); if (mesh == nullptr) { @@ -758,7 +758,7 @@ class VertexGroupsAttributeProvider final : public DynamicAttributesProvider { bool try_delete(GeometryComponent &component, const StringRef attribute_name) const final { - BLI_assert(component.type() == GeometryComponentType::Mesh); + BLI_assert(component.type() == GEO_COMPONENT_TYPE_MESH); MeshComponent &mesh_component = static_cast<MeshComponent &>(component); const int vertex_group_index = mesh_component.vertex_group_names().pop_default_as( @@ -783,7 +783,7 @@ class VertexGroupsAttributeProvider final : public DynamicAttributesProvider { bool foreach_attribute(const GeometryComponent &component, const AttributeForeachCallback callback) const final { - BLI_assert(component.type() == GeometryComponentType::Mesh); + BLI_assert(component.type() == GEO_COMPONENT_TYPE_MESH); const MeshComponent &mesh_component = static_cast<const MeshComponent &>(component); for (const auto item : mesh_component.vertex_group_names().items()) { const StringRefNull name = item.key; diff --git a/source/blender/blenkernel/intern/geometry_component_pointcloud.cc b/source/blender/blenkernel/intern/geometry_component_pointcloud.cc index d7f0bf55bc9..c428e93cfa9 100644 --- a/source/blender/blenkernel/intern/geometry_component_pointcloud.cc +++ b/source/blender/blenkernel/intern/geometry_component_pointcloud.cc @@ -27,7 +27,7 @@ /** \name Geometry Component Implementation * \{ */ -PointCloudComponent::PointCloudComponent() : GeometryComponent(GeometryComponentType::PointCloud) +PointCloudComponent::PointCloudComponent() : GeometryComponent(GEO_COMPONENT_TYPE_POINT_CLOUD) { } diff --git a/source/blender/blenkernel/intern/geometry_component_volume.cc b/source/blender/blenkernel/intern/geometry_component_volume.cc index 5e35a10fe3d..fd2327e0bf5 100644 --- a/source/blender/blenkernel/intern/geometry_component_volume.cc +++ b/source/blender/blenkernel/intern/geometry_component_volume.cc @@ -24,7 +24,7 @@ /** \name Geometry Component Implementation * \{ */ -VolumeComponent::VolumeComponent() : GeometryComponent(GeometryComponentType::Volume) +VolumeComponent::VolumeComponent() : GeometryComponent(GEO_COMPONENT_TYPE_VOLUME) { } diff --git a/source/blender/blenkernel/intern/geometry_set.cc b/source/blender/blenkernel/intern/geometry_set.cc index e7fb184023d..f47d88cbeed 100644 --- a/source/blender/blenkernel/intern/geometry_set.cc +++ b/source/blender/blenkernel/intern/geometry_set.cc @@ -56,13 +56,13 @@ GeometryComponent ::~GeometryComponent() GeometryComponent *GeometryComponent::create(GeometryComponentType component_type) { switch (component_type) { - case GeometryComponentType::Mesh: + case GEO_COMPONENT_TYPE_MESH: return new MeshComponent(); - case GeometryComponentType::PointCloud: + case GEO_COMPONENT_TYPE_POINT_CLOUD: return new PointCloudComponent(); - case GeometryComponentType::Instances: + case GEO_COMPONENT_TYPE_INSTANCES: return new InstancesComponent(); - case GeometryComponentType::Volume: + case GEO_COMPONENT_TYPE_VOLUME: return new VolumeComponent(); } BLI_assert(false); diff --git a/source/blender/blenkernel/intern/geometry_set_instances.cc b/source/blender/blenkernel/intern/geometry_set_instances.cc index f3006385da3..70b48a253ed 100644 --- a/source/blender/blenkernel/intern/geometry_set_instances.cc +++ b/source/blender/blenkernel/intern/geometry_set_instances.cc @@ -371,9 +371,9 @@ static void join_instance_groups_mesh(Span<GeometryInstanceGroup> set_groups, dst_component.replace(new_mesh); Vector<GeometryComponentType> component_types; - component_types.append(GeometryComponentType::Mesh); + component_types.append(GEO_COMPONENT_TYPE_MESH); if (convert_points_to_vertices) { - component_types.append(GeometryComponentType::PointCloud); + component_types.append(GEO_COMPONENT_TYPE_POINT_CLOUD); } /* Don't copy attributes that are stored directly in the mesh data structs. */ @@ -402,9 +402,9 @@ static void join_instance_groups_pointcloud(Span<GeometryInstanceGroup> set_grou PointCloud *pointcloud = BKE_pointcloud_new_nomain(totpoint); dst_component.replace(pointcloud); Map<std::string, AttributeKind> attributes; - gather_attribute_info(attributes, {GeometryComponentType::PointCloud}, set_groups, {}); + gather_attribute_info(attributes, {GEO_COMPONENT_TYPE_POINT_CLOUD}, set_groups, {}); join_attributes(set_groups, - {GeometryComponentType::PointCloud}, + {GEO_COMPONENT_TYPE_POINT_CLOUD}, attributes, static_cast<GeometryComponent &>(dst_component)); } |