|
Blender V4.3
|
#include <BLI_bounds_types.hh>
Public Member Functions | |
| Bounds ()=default | |
| Bounds (const T &value) | |
| Bounds (const T &min, const T &max) | |
| bool | is_empty () const |
| T | center () const |
| T | size () const |
| void | translate (const T &offset) |
| void | scale_from_center (const T &scale) |
| void | resize (const T &new_size) |
| void | recenter (const T &new_center) |
| template<typename PaddingT> | |
| void | pad (const PaddingT &padding) |
Public Attributes | |
| T | min |
| T | max |
Definition at line 13 of file BLI_bounds_types.hh.
|
default |
|
inline |
Definition at line 17 of file BLI_bounds_types.hh.
Definition at line 18 of file BLI_bounds_types.hh.
|
inline |
Return the center (i.e. the midpoint) of the bounds. This matches the behavior of #BLI_rctf_cent/#BLI_rcti_cent.
Definition at line 177 of file BLI_bounds.hh.
References max, blender::math::midpoint(), min, and T.
Referenced by blender::draw::overlay::Bounds::object_sync(), recenter(), resize(), scale_from_center(), blender::tests::TEST(), blender::tests::TEST(), and blender::tests::TEST().
|
inline |
Returns true when the size of the bounds is zero (or negative). This matches the behavior of BLI_rcti_is_empty/BLI_rctf_is_empty.
Definition at line 167 of file BLI_bounds.hh.
References blender::detail::any_less_or_equal_than(), max, and min.
Referenced by blender::tests::TEST(), and blender::tests::TEST().
|
inline |
Adds some padding to the bounds. This matches the behavior of BLI_rcti_pad/BLI_rctf_pad.
Definition at line 215 of file BLI_bounds.hh.
References max, min, and padding().
Referenced by blender::tests::TEST().
|
inline |
Translate the bounds such that their center is #new_center. This matches the behavior of BLI_rctf_recenter/BLI_rcti_recenter.
Definition at line 207 of file BLI_bounds.hh.
References center(), T, and translate().
Referenced by blender::tests::TEST().
|
inline |
Resize the bounds in-place to ensure their size is #new_size. The center of the bounds doesn't change. This matches the behavior of BLI_rctf_resize/BLI_rcti_resize.
Definition at line 201 of file BLI_bounds.hh.
References center(), max, min, and T.
Referenced by blender::tests::TEST().
|
inline |
Scale the bounds from the center. This matches the behavior of BLI_rctf_scale/BLI_rcti_scale.
Definition at line 193 of file BLI_bounds.hh.
References center(), max, min, size(), and T.
Referenced by blender::tests::TEST().
|
inline |
Return the size of the bounds. E.g. for a Bounds<float3> this would return the dimensions of bounding box as a float3. This matches the behavior of #BLI_rctf_size/#BLI_rcti_size.
Definition at line 182 of file BLI_bounds.hh.
References blender::math::abs(), max, min, and T.
Referenced by blender::eevee::Camera::sync(), blender::tests::TEST(), blender::tests::TEST(), and blender::tests::TEST().
|
inline |
Translate the bounds by #offset. This matches the behavior of BLI_rctf_translate/BLI_rcti_translate.
Definition at line 187 of file BLI_bounds.hh.
Referenced by recenter(), and blender::tests::TEST().
| T blender::Bounds< T >::max |
Definition at line 15 of file BLI_bounds_types.hh.
Referenced by Bounds(), Bounds(), blender::bke::pbvh::build_nodes_recursive_grids(), blender::bke::pbvh::build_nodes_recursive_mesh(), center(), blender::bke::pbvh::clip_ray_ortho(), convexhull_aabb_fit_hull_2d(), blender::ed::sculpt_paint::do_tiled(), fcurve_to_keylist(), blender::ed::sculpt_paint::paint::image::init_uv_primitives_brush_test(), is_empty(), blender::Bounds< blender::VecBase< float, 3 > >::is_empty(), blender::ed::space_node::node_draw_zones_and_frames(), pad(), blender::bke::pbvh::pbvh_bmesh_node_limit_ensure_fast(), blender::bke::pbvh::pbvh_bmesh_node_split(), resize(), blender::geometry::ReverseUVSampler::ReverseUVSampler(), scale_from_center(), size(), blender::eevee::Camera::sync(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), and translate().
| T blender::Bounds< T >::min |
Definition at line 14 of file BLI_bounds_types.hh.
Referenced by Bounds(), Bounds(), blender::bke::pbvh::build_nodes_recursive_grids(), blender::bke::pbvh::build_nodes_recursive_mesh(), center(), blender::bke::pbvh::clip_ray_ortho(), convexhull_aabb_fit_hull_2d(), blender::ed::sculpt_paint::do_tiled(), fcurve_to_keylist(), blender::ed::sculpt_paint::paint::image::init_uv_primitives_brush_test(), is_empty(), blender::Bounds< blender::VecBase< float, 3 > >::is_empty(), blender::ed::space_node::node_draw_zones_and_frames(), pad(), blender::bke::pbvh::pbvh_bmesh_node_limit_ensure_fast(), blender::bke::pbvh::pbvh_bmesh_node_split(), resize(), blender::geometry::ReverseUVSampler::ReverseUVSampler(), scale_from_center(), size(), blender::eevee::Camera::sync(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), and translate().