Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/geometry_set.cc
| Show First 20 Lines • Show All 177 Lines • ▼ Show 20 Lines | Vector<const GeometryComponent *> GeometrySet::get_components_for_read() const | ||||
| for (const GeometryComponentPtr &component_ptr : components_) { | for (const GeometryComponentPtr &component_ptr : components_) { | ||||
| if (component_ptr) { | if (component_ptr) { | ||||
| components.append(component_ptr.get()); | components.append(component_ptr.get()); | ||||
| } | } | ||||
| } | } | ||||
| return components; | return components; | ||||
| } | } | ||||
| void GeometrySet::compute_boundbox_without_instances(float3 *r_min, float3 *r_max) const | bool GeometrySet::compute_boundbox_without_instances(float3 *r_min, float3 *r_max) const | ||||
| { | { | ||||
| bool have_minmax = false; | |||||
| const PointCloud *pointcloud = this->get_pointcloud_for_read(); | const PointCloud *pointcloud = this->get_pointcloud_for_read(); | ||||
| if (pointcloud != nullptr) { | if (pointcloud != nullptr) { | ||||
| BKE_pointcloud_minmax(pointcloud, *r_min, *r_max); | have_minmax |= BKE_pointcloud_minmax(pointcloud, *r_min, *r_max); | ||||
| } | } | ||||
| const Mesh *mesh = this->get_mesh_for_read(); | const Mesh *mesh = this->get_mesh_for_read(); | ||||
| if (mesh != nullptr) { | if (mesh != nullptr) { | ||||
| BKE_mesh_wrapper_minmax(mesh, *r_min, *r_max); | have_minmax |= BKE_mesh_wrapper_minmax(mesh, *r_min, *r_max); | ||||
| } | } | ||||
| const Volume *volume = this->get_volume_for_read(); | const Volume *volume = this->get_volume_for_read(); | ||||
| if (volume != nullptr) { | if (volume != nullptr) { | ||||
| BKE_volume_min_max(volume, *r_min, *r_max); | have_minmax |= BKE_volume_min_max(volume, *r_min, *r_max); | ||||
| } | } | ||||
| const CurveEval *curve = this->get_curve_for_read(); | const CurveEval *curve = this->get_curve_for_read(); | ||||
| if (curve != nullptr) { | if (curve != nullptr) { | ||||
| /* Using the evaluated positions is somewhat arbitrary, but it is probably expected. */ | /* Using the evaluated positions is somewhat arbitrary, but it is probably expected. */ | ||||
| curve->bounds_min_max(*r_min, *r_max, true); | have_minmax |= curve->bounds_min_max(*r_min, *r_max, true); | ||||
| } | } | ||||
| return have_minmax; | |||||
| } | } | ||||
| std::ostream &operator<<(std::ostream &stream, const GeometrySet &geometry_set) | std::ostream &operator<<(std::ostream &stream, const GeometrySet &geometry_set) | ||||
| { | { | ||||
| stream << "<GeometrySet at " << &geometry_set << ", " << geometry_set.components_.size() | stream << "<GeometrySet at " << &geometry_set << ", " << geometry_set.components_.size() | ||||
| << " components>"; | << " components>"; | ||||
| return stream; | return stream; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 401 Lines • Show Last 20 Lines | |||||