|
Blender V5.0
|
Functions | |
| template<typename T> | |
| Bounds< T > | merge (const Bounds< T > &a, const Bounds< T > &b) |
| template<typename T> | |
| std::optional< Bounds< T > > | merge (const std::optional< Bounds< T > > &a, const std::optional< Bounds< T > > &b) |
| template<typename T> | |
| std::optional< Bounds< T > > | merge (const std::optional< Bounds< T > > &a, const Bounds< T > &b) |
| template<typename T> | |
| std::optional< Bounds< T > > | min_max (const std::optional< Bounds< T > > &a, const T &b) |
| template<typename T> | |
| std::optional< Bounds< T > > | min_max (const Span< T > values) |
| template<typename T> | |
| std::optional< Bounds< T > > | min_max (const IndexMask &mask, const Span< T > values) |
| template<typename T, typename RadiusT> | |
| std::optional< Bounds< T > > | min_max_with_radii (const Span< T > values, const Span< RadiusT > radii) |
| template<typename T> | |
| std::optional< Bounds< T > > | intersect (const Bounds< T > &a, const Bounds< T > &b) |
| template<typename T> | |
| std::optional< Bounds< T > > | intersect (const std::optional< Bounds< T > > &a, const std::optional< Bounds< T > > &b) |
| template<typename T> | |
| std::optional< T > | max (const VArray< T > &values) |
| template<typename T> | |
| std::array< VecBase< T, 3 >, 8 > | corners (const Bounds< VecBase< T, 3 > > &bounds) |
| template<typename T, int D> | |
| Bounds< VecBase< T, 3 > > | transform_bounds (const MatBase< T, D, D > &matrix, const Bounds< VecBase< T, 3 > > &bounds) |
|
inline |
Return the eight corners of a 3D bounding box.
Z Y
| /
|/
.-----X
2----------6
/| /|
/ | / |
1----------5 |
| | | |
| 3-------|--7
| / | /
|/ |/
0----------4
Definition at line 207 of file BLI_bounds.hh.
References corners().
Referenced by corners(), blender::draw::drw_debug_matrix_as_bbox(), blender::draw::View::frustum_boundbox_calc(), blender::ed::transform::gizmo_3d_foreach_selected(), blender::ed::object::lattice_add_to_selected_collect_targets_and_calc_bounds(), lineart_geometry_check_visible(), blender::ed::transform::snap_source_closest_fn(), ObjectBounds::sync(), transform_bounds(), blender::io::alembic::ABCAbstractWriter::update_bounding_box(), blender::eevee::VolumeObjectBounds::VolumeObjectBounds(), and blender::ed::object::voxel_size_edit_invoke().
|
inlinenodiscard |
Returns a new bound that contains the intersection of the two given bound. Returns no box if there are no overlap.
Definition at line 144 of file BLI_bounds.hh.
References b, blender::Bounds< T >::max, blender::math::max(), blender::Bounds< T >::min, blender::math::min(), and result.
Referenced by blender::eevee::VolumeLayer::bounds_overlaps(), blender::nodes::node_composite_crop_cc::CropOperation::compute_cropping_bounds(), and blender::draw::compositor_engine::Context::get_compositing_region().
|
inlinenodiscard |
Definition at line 153 of file BLI_bounds.hh.
References b, and intersect().
Finds the maximum value for elements in the array.
Definition at line 165 of file BLI_bounds.hh.
References blender::VArrayCommon< T >::get_if_single(), blender::Span< T >::index_range(), blender::VArrayCommon< T >::is_empty(), and blender::threading::parallel_reduce().
Referenced by blender::bke::CurvesGeometry::material_index_max().
|
inlinenodiscard |
Definition at line 26 of file BLI_bounds.hh.
References b, blender::Bounds< T >::max, blender::math::max(), blender::Bounds< T >::min, and blender::math::min().
Referenced by blender::eevee::VolumeLayer::add_object_bound(), BKE_volume_min_max(), blender::bke::GeometrySet::compute_boundbox_without_instances(), blender::bke::compute_local_mesh_groups(), ED_view3d_minmax_verts(), blender::ed::greasepencil::fit_strokes_to_view(), blender::bke::pbvh::Tree::flush_bounds_to_parents(), blender::bke::pbvh::Tree::from_grids(), blender::bke::pbvh::Tree::from_mesh(), blender::io::obj::geometry_to_blender_objects(), blender::ed::greasepencil::get_boundary_bounds(), blender::seq::image_transform_bounding_box_from_collection(), merge(), blender::bke::merge_bounds(), blender::bke::pbvh::merge_bounds(), blender::bke::pbvh::pbvh_bmesh_node_split(), blender::Bounds< blender::VecBase< float, 2 > >::recenter(), blender::eevee::VolumePipeline::register_and_get_layer(), blender::io::grease_pencil::shift_to_bounds_center(), and blender::Bounds< blender::VecBase< float, 2 > >::size().
|
inlinenodiscard |
Definition at line 48 of file BLI_bounds.hh.
|
inlinenodiscard |
Definition at line 32 of file BLI_bounds.hh.
References b.
|
inlinenodiscard |
Definition at line 88 of file BLI_bounds.hh.
References blender::Span< T >::first(), init(), blender::Span< T >::is_empty(), mask(), min_max(), blender::threading::parallel_reduce(), result, and blender::Span< T >::size().
|
inlinenodiscard |
Find the smallest and largest values element-wise in the span.
Definition at line 67 of file BLI_bounds.hh.
References blender::Span< T >::first(), blender::Span< T >::index_range(), init(), blender::Span< T >::is_empty(), blender::threading::parallel_reduce(), and result.
|
inlinenodiscard |
Definition at line 55 of file BLI_bounds.hh.
Referenced by BKE_editmesh_cache_calc_minmax(), blender::bke::CurvesGeometry::bounds_min_max(), blender::ed::sculpt_paint::AddOperationExecutor::execute(), blender::nodes::node_geo_string_to_curves_cc::get_pivot_point(), blender::ed::greasepencil::get_selected_frame_number_bounds(), blender::ed::sculpt_paint::grease_pencil_erase_lasso_exec(), blender::seq::image_transform_bounding_box_from_collection(), min_max(), blender::ed::space_node::node_draw_zones_and_frames(), blender::ed::sculpt_paint::greasepencil::CloneOperation::on_stroke_begin(), blender::geometry::ReverseUVSampler::ReverseUVSampler(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::ed::sculpt_paint::greasepencil::trim_stroke_ends(), and blender::eevee::VolumeObjectBounds::VolumeObjectBounds().
|
inlinenodiscard |
Find the smallest and largest values element-wise in the span, adding the radius to each element first. The template type T is expected to have an addition operator implemented with RadiusT.
Definition at line 116 of file BLI_bounds.hh.
References BLI_assert, blender::Span< T >::first(), blender::Span< T >::index_range(), init(), blender::Span< T >::is_empty(), min_max_with_radii(), blender::threading::parallel_reduce(), result, and blender::Span< T >::size().
Referenced by blender::bke::CurvesGeometry::bounds_min_max(), min_max_with_radii(), and blender::tests::TEST().
|
inline |
Transform a 3D bounding box.
Note: this necessarily grows the bounding box, to ensure that the transformed bounding box fully contains the original. Therefore, calling this iteratively to transform from space A to space B, and then from space B to space C, etc., will also iteratively grow the bounding box on each call. Try to avoid doing that, and instead first compose the transform matrices and then use that to transform the bounding box.
Definition at line 232 of file BLI_bounds.hh.
References corners(), blender::math::max(), blender::math::min(), transform_bounds(), and blender::math::transform_point().
Referenced by BKE_object_minmax_dupli(), BKE_pchan_minmax(), transform_bounds(), and view3d_calc_minmax_selected().