Blender V5.3
blender::Bounds< T > Struct Template Reference

#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)
bool contains (const T &point) const
bool intersects (const Bounds< T > &other) const
bool intersects_segment (const T &start, const T &end) const

Public Attributes

T min
T max

Detailed Description

template<typename T>
struct blender::Bounds< T >

Definition at line 13 of file BLI_bounds_types.hh.

Constructor & Destructor Documentation

◆ Bounds() [1/3]

◆ Bounds() [2/3]

template<typename T>
blender::Bounds< T >::Bounds ( const T & value)
inlineexplicit

Definition at line 17 of file BLI_bounds_types.hh.

References max, min, and T.

◆ Bounds() [3/3]

template<typename T>
blender::Bounds< T >::Bounds ( const T & min,
const T & max )
inline

Definition at line 18 of file BLI_bounds_types.hh.

References max, min, and T.

Member Function Documentation

◆ center()

template<typename T>
T blender::Bounds< T >::center ( ) const
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 538 of file BLI_bounds.hh.

References center(), max, blender::math::midpoint(), min, and T.

Referenced by center(), blender::ed::greasepencil::fit_strokes_to_view(), recenter(), resize(), scale_from_center(), blender::tests::TEST(), blender::tests::TEST(), and blender::tests::TEST().

◆ contains()

template<typename T>
bool blender::Bounds< T >::contains ( const T & point) const
inline

Returns true if point is inside the bounds. This matches the behavior of BLI_rctf_isect_pt/BLI_rcti_isect_pt.

Definition at line 582 of file BLI_bounds.hh.

References blender::bounds::detail::any_greater_than(), blender::bounds::detail::any_less_than(), contains(), max, min, and T.

Referenced by contains(), intersects_segment(), and blender::tests::TEST().

◆ intersects()

template<typename T>
bool blender::Bounds< T >::intersects ( const Bounds< T > & other) const
inline

Returns true if the other bounds is inside or intersect this one.

Definition at line 593 of file BLI_bounds.hh.

References Bounds(), blender::bounds::intersect(), and intersects().

Referenced by intersects(), and intersects_segment().

◆ intersects_segment()

template<typename T>
bool blender::Bounds< T >::intersects_segment ( const T & start,
const T & end ) const
inline

◆ is_empty()

template<typename T>
bool blender::Bounds< T >::is_empty ( ) const
inline

◆ pad()

template<typename T>
template<typename PaddingT>
void blender::Bounds< T >::pad ( const PaddingT & padding)
inline

◆ recenter()

template<typename T>
void blender::Bounds< T >::recenter ( const T & new_center)
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 568 of file BLI_bounds.hh.

References center(), recenter(), T, and translate().

Referenced by recenter(), and blender::tests::TEST().

◆ resize()

template<typename T>
void blender::Bounds< T >::resize ( const T & new_size)
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 562 of file BLI_bounds.hh.

References center(), max, min, resize(), and T.

Referenced by resize(), and blender::tests::TEST().

◆ scale_from_center()

template<typename T>
void blender::Bounds< T >::scale_from_center ( const T & scale)
inline

Scale the bounds from the center. This matches the behavior of BLI_rctf_scale/BLI_rcti_scale.

Definition at line 554 of file BLI_bounds.hh.

References center(), max, min, scale(), scale_from_center(), and T.

Referenced by scale_from_center(), and blender::tests::TEST().

◆ size()

◆ translate()

template<typename T>
void blender::Bounds< T >::translate ( const T & offset)
inline

Translate the bounds by #offset. This matches the behavior of BLI_rctf_translate/BLI_rcti_translate.

Definition at line 548 of file BLI_bounds.hh.

References max, min, T, and translate().

Referenced by recenter(), blender::tests::TEST(), and translate().

Member Data Documentation

◆ max

template<typename T>
T blender::Bounds< T >::max

Definition at line 15 of file BLI_bounds_types.hh.

Referenced by blender::animviz_calc_motionpaths(), blender::animviz_motionpath_compute_range(), blender::BKE_object_minmax_dupli(), blender::BKE_pchan_minmax(), Bounds(), Bounds(), blender::ed::animrig::build_fcurves_for_paste(), blender::bke::pbvh::build_nodes_recursive_grids(), blender::bke::pbvh::build_nodes_recursive_mesh(), center(), blender::Bounds< blender::VecBase< float, 3 > >::center(), blender::ed::greasepencil::trim::check_segments_in_lasso(), blender::bke::pbvh::clip_ray_ortho(), contains(), blender::convert_rotation_mode_channelbag(), blender::convexhull_aabb_fit_hull_2d(), blender::ed::animrig::copy_world_space(), blender::array_utils::count_indices_with_table(), blender::ui::curvemap_zoom(), blender::ed::sculpt_paint::do_tiled(), blender::ED_keylist_all_keys_frame_range(), blender::ED_keylist_find_any_between(), blender::ED_keylist_selected_keys_frame_range(), blender::fcurve_to_keylist(), blender::bke::pbvh::Tree::flush_bounds_to_parents(), blender::seq::freeze_key_pair_create(), blender::ed::transform::gizmo2d_calc_bounds(), blender::ed::sculpt_paint::grease_pencil_erase_lasso_exec(), blender::io::csv::import_csv_as_pointcloud(), blender::ed::sculpt_paint::image::init_uv_primitives_brush_test(), blender::bounds::intersect(), is_empty(), blender::ed::object::lattice_add_to_selected_collect_targets_and_calc_bounds(), blender::nla_action_draw_keyframes(), blender::ed::space_node::node_draw_zones_and_frames(), pad(), blender::bke::partition_faces_recursively(), blender::ed::animrig::paste_world_space(), blender::bke::pbvh::pbvh_bmesh_node_limit_ensure_fast(), blender::bke::pbvh::pbvh_bmesh_node_split(), blender::compositor::Domain::realize_transformation(), resize(), blender::seq::retiming_add_transition(), blender::geometry::ReverseUVSampler::ReverseUVSampler(), scale_from_center(), blender::ed::vse::seq_view_collection_rect_preview(), size(), blender::seq::strip_retiming_clamp_bounds_get(), blender::ed::greasepencil::tests::SVGMapping::SVGMapping(), blender::eevee::Camera::sync(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), translate(), blender::bke::pbvh::TriRasterizer::TriRasterizer(), blender::view3d_calc_minmax_selected(), blender::view3d_zoom_border_exec(), blender::view_zoom_apply_step(), and blender::viewzoom_apply_3d().

◆ min

template<typename T>
T blender::Bounds< T >::min

Definition at line 14 of file BLI_bounds_types.hh.

Referenced by blender::animviz_calc_motionpaths(), blender::animviz_motionpath_compute_range(), blender::BKE_object_minmax_dupli(), blender::BKE_pchan_minmax(), Bounds(), Bounds(), blender::ed::animrig::build_fcurves_for_paste(), blender::bke::pbvh::build_nodes_recursive_grids(), blender::bke::pbvh::build_nodes_recursive_mesh(), center(), blender::Bounds< blender::VecBase< float, 3 > >::center(), blender::ed::greasepencil::trim::check_segments_in_lasso(), blender::bke::pbvh::clip_ray_ortho(), contains(), blender::convert_rotation_mode_range(), blender::convexhull_aabb_fit_hull_2d(), blender::ed::animrig::copy_world_space(), blender::array_utils::count_indices_with_table(), blender::ui::curvemap_zoom(), blender::ed::sculpt_paint::do_tiled(), blender::ED_keylist_all_keys_frame_range(), blender::ED_keylist_find_any_between(), blender::ED_keylist_selected_keys_frame_range(), blender::ed::animrig::ensure_baked_fcurves(), blender::fcurve_to_keylist(), blender::ed::greasepencil::fit_strokes_to_view(), blender::bke::pbvh::Tree::flush_bounds_to_parents(), blender::seq::freeze_key_pair_create(), blender::draw::compositor_engine::Context::get_compositing_domain(), blender::ed::transform::gizmo2d_calc_bounds(), blender::ed::sculpt_paint::grease_pencil_erase_lasso_exec(), blender::io::csv::import_csv_as_pointcloud(), blender::ed::sculpt_paint::image::init_uv_primitives_brush_test(), blender::bounds::intersect(), is_empty(), blender::ed::object::lattice_add_to_selected_collect_targets_and_calc_bounds(), blender::nla_action_draw_keyframes(), blender::ed::space_node::node_draw_zones_and_frames(), pad(), blender::bke::partition_faces_recursively(), blender::ed::animrig::paste_world_space(), blender::bke::pbvh::pbvh_bmesh_node_limit_ensure_fast(), blender::bke::pbvh::pbvh_bmesh_node_split(), blender::compositor::Domain::realize_transformation(), resize(), blender::seq::retiming_add_transition(), blender::geometry::ReverseUVSampler::ReverseUVSampler(), blender::ed::vse::ripple_gaps_get(), scale_from_center(), blender::ed::vse::seq_view_collection_rect_preview(), size(), blender::seq::strip_retiming_clamp_bounds_get(), blender::ed::greasepencil::tests::SVGMapping::SVGMapping(), blender::eevee::Camera::sync(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), translate(), blender::bke::pbvh::TriRasterizer::TriRasterizer(), blender::view3d_calc_minmax_selected(), blender::view3d_zoom_border_exec(), blender::view_zoom_apply_step(), and blender::viewzoom_apply_3d().


The documentation for this struct was generated from the following files: