Blender V4.5
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)
 

Public Attributes

T min
 
T max
 

Detailed Description

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

Definition at line 25 of file usd_writer_abstract.hh.

Constructor & Destructor Documentation

◆ Bounds() [1/3]

template<typename T >
blender::Bounds< T >::Bounds ( )
default

◆ Bounds() [2/3]

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

Definition at line 17 of file BLI_bounds_types.hh.

◆ 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.

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 254 of file BLI_bounds.hh.

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

Referenced by blender::ed::greasepencil::fit_strokes_to_view(), blender::draw::overlay::Bounds::object_sync(), blender::ed::sculpt_paint::greasepencil::CloneOperation::on_stroke_begin(), blender::tests::TEST(), blender::tests::TEST(), and blender::tests::TEST().

◆ is_empty()

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

References max, and min.

Referenced by blender::ed::sculpt_paint::grease_pencil_erase_box_exec(), blender::tests::TEST(), and blender::tests::TEST().

◆ pad()

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

Adds some padding to the bounds. This matches the behavior of BLI_rcti_pad/BLI_rctf_pad.

Definition at line 292 of file BLI_bounds.hh.

References max, min, and padding().

Referenced by blender::bke::CurvesGeometry::bounds_min_max(), and blender::tests::TEST().

◆ 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 284 of file BLI_bounds.hh.

Referenced by 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 278 of file BLI_bounds.hh.

References max, min, and T.

Referenced by 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 270 of file BLI_bounds.hh.

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

Referenced by blender::tests::TEST().

◆ size()

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

◆ 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 264 of file BLI_bounds.hh.

References max, and min.

Referenced by blender::tests::TEST().

Member Data Documentation

◆ max

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

Definition at line 15 of file BLI_bounds_types.hh.

Referenced by animviz_motionpath_compute_range(), arrayModifier_doArray(), blender::ed::sculpt_paint::trim::calc_expand_factor(), blender::bke::pbvh::clip_ray_ortho(), convexhull_aabb_fit_hull_2d(), blender::ed::sculpt_paint::cursor_draw_tiling_preview(), blender::ed::sculpt_paint::do_tiled(), ED_keylist_all_keys_frame_range(), ED_keylist_find_any_between(), ED_keylist_selected_keys_frame_range(), blender::ed::sculpt_paint::ensure_valid_pivot(), blender::nodes::node_composite_crop_cc::CropOperation::execute_alpha_crop_gpu(), blender::nodes::node_composite_composite_cc::CompositeOperation::execute_copy_gpu(), blender::nodes::node_composite_viewer_cc::ViewerOperation::execute_copy_gpu(), fcurve_to_keylist(), blender::bke::pbvh::Tree::flush_bounds_to_parents(), blender::seq::freeze_key_pair_create(), blender::ed::transform::gizmo2d_calc_bounds(), blender::draw::gpencil::gpencil_object_cache_add(), blender::ed::sculpt_paint::grease_pencil_erase_lasso_exec(), blender::io::csv::import_csv_as_pointcloud(), blender::ed::sculpt_paint::paint::image::init_uv_primitives_brush_test(), blender::bounds::intersect(), blender::nodes::node_composite_crop_cc::CropOperation::is_identity(), blender::ed::sculpt_paint::is_point_inside_bounds(), blender::bounds::merge(), nla_action_draw_keyframes(), blender::ed::space_node::node_draw_zones_and_frames(), blender::ed::sculpt_paint::brushes::clay_strips::node_in_box(), blender::ed::sculpt_paint::node_in_cylinder(), blender::ed::sculpt_paint::node_in_sphere(), blender::draw::overlay::Bounds::object_sync(), blender::workbench::Instance::object_sync(), blender::bke::pbvh::pbvh_bmesh_node_limit_ensure_fast(), blender::bke::pbvh::pbvh_bmesh_node_split(), blender::draw::Manager::resource_handle_for_sculpt(), blender::seq::retiming_add_transition(), blender::geometry::ReverseUVSampler::ReverseUVSampler(), blender::ed::sculpt_paint::dyntopo::sculpt_detail_flood_fill_exec(), blender::ed::vse::seq_view_collection_rect_preview(), blender::seq::strip_retiming_clamp_bounds_get(), blender::eevee::Camera::sync(), blender::eevee::SyncModule::sync_sculpt(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::bke::pbvh::test_frustum_aabb(), blender::bke::pbvh::update_node_bounds_bmesh(), blender::bke::pbvh::update_node_bounds_grids(), blender::bke::pbvh::update_node_bounds_mesh(), view3d_calc_minmax_selected(), view3d_zoom_border_exec(), view_zoom_apply_step(), viewzoom_apply_3d(), blender::eevee::VolumeObjectBounds::VolumeObjectBounds(), and blender::ed::object::voxel_size_edit_invoke().

◆ min

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

Definition at line 14 of file BLI_bounds_types.hh.

Referenced by animviz_motionpath_compute_range(), arrayModifier_doArray(), blender::ed::sculpt_paint::trim::calc_expand_factor(), blender::bke::pbvh::clip_ray_ortho(), convexhull_aabb_fit_hull_2d(), blender::ed::sculpt_paint::cursor_draw_tiling_preview(), blender::ed::sculpt_paint::do_tiled(), ED_keylist_all_keys_frame_range(), ED_keylist_find_any_between(), ED_keylist_selected_keys_frame_range(), blender::ed::sculpt_paint::ensure_valid_pivot(), blender::nodes::node_composite_crop_cc::CropOperation::execute_alpha_crop_gpu(), blender::nodes::node_composite_composite_cc::CompositeOperation::execute_copy_cpu(), blender::nodes::node_composite_viewer_cc::ViewerOperation::execute_copy_cpu(), blender::nodes::node_composite_composite_cc::CompositeOperation::execute_copy_gpu(), blender::nodes::node_composite_viewer_cc::ViewerOperation::execute_copy_gpu(), blender::nodes::node_composite_crop_cc::CropOperation::execute_image_crop_cpu(), blender::nodes::node_composite_crop_cc::CropOperation::execute_image_crop_gpu(), 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::ed::transform::gizmo2d_calc_bounds(), blender::draw::gpencil::gpencil_object_cache_add(), blender::ed::sculpt_paint::grease_pencil_erase_lasso_exec(), blender::io::csv::import_csv_as_pointcloud(), blender::ed::sculpt_paint::paint::image::init_uv_primitives_brush_test(), blender::bounds::intersect(), blender::nodes::node_composite_crop_cc::CropOperation::is_identity(), blender::ed::sculpt_paint::is_point_inside_bounds(), blender::bounds::merge(), nla_action_draw_keyframes(), blender::ed::space_node::node_draw_zones_and_frames(), blender::ed::sculpt_paint::brushes::clay_strips::node_in_box(), blender::ed::sculpt_paint::node_in_cylinder(), blender::ed::sculpt_paint::node_in_sphere(), blender::draw::overlay::Bounds::object_sync(), blender::workbench::Instance::object_sync(), blender::bke::pbvh::pbvh_bmesh_node_limit_ensure_fast(), blender::bke::pbvh::pbvh_bmesh_node_split(), blender::draw::Manager::resource_handle_for_sculpt(), blender::seq::retiming_add_transition(), blender::geometry::ReverseUVSampler::ReverseUVSampler(), blender::ed::sculpt_paint::dyntopo::sculpt_detail_flood_fill_exec(), blender::ed::vse::seq_view_collection_rect_preview(), blender::seq::strip_retiming_clamp_bounds_get(), blender::eevee::Camera::sync(), blender::eevee::SyncModule::sync_sculpt(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::bke::pbvh::test_frustum_aabb(), blender::bke::pbvh::update_node_bounds_bmesh(), blender::bke::pbvh::update_node_bounds_grids(), blender::bke::pbvh::update_node_bounds_mesh(), view3d_calc_minmax_selected(), view3d_zoom_border_exec(), view_zoom_apply_step(), viewzoom_apply_3d(), blender::eevee::VolumeObjectBounds::VolumeObjectBounds(), and blender::ed::object::voxel_size_edit_invoke().


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