Blender V4.3
editface.cc File Reference
#include "MEM_guardedalloc.h"
#include "BLI_atomic_disjoint_set.hh"
#include "BLI_bitmap.h"
#include "BLI_blenlib.h"
#include "BLI_math_matrix.h"
#include "BLI_math_vector.h"
#include "BLI_math_vector.hh"
#include "BLI_task.hh"
#include "BLI_vector_set.hh"
#include "IMB_imbuf.hh"
#include "IMB_imbuf_types.hh"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "BKE_attribute.hh"
#include "BKE_context.hh"
#include "BKE_customdata.hh"
#include "BKE_global.hh"
#include "BKE_mesh.hh"
#include "BKE_mesh_mapping.hh"
#include "BKE_object.hh"
#include "BKE_object_types.hh"
#include "ED_mesh.hh"
#include "ED_screen.hh"
#include "ED_select_utils.hh"
#include "ED_view3d.hh"
#include "WM_api.hh"
#include "WM_types.hh"
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_query.hh"

Go to the source code of this file.

Functions

void paintface_flush_flags (bContext *C, Object *ob, const bool flush_selection, const bool flush_hidden)
 
void paintface_hide (bContext *C, Object *ob, const bool unselected)
 
void paintface_reveal (bContext *C, Object *ob, const bool select)
 
static void build_poly_connections (blender::AtomicDisjointSet &islands, Mesh &mesh, const bool skip_seams=true)
 
static void paintface_select_linked_faces (Mesh &mesh, const blender::Span< int > face_indices, const bool select)
 
void paintface_select_linked (bContext *C, Object *ob, const int mval[2], const bool select)
 
static int find_closest_edge_in_poly (ARegion *region, blender::Span< blender::int2 > edges, blender::Span< int > face_edges, blender::Span< blender::float3 > vert_positions, const int mval[2])
 
static int get_opposing_edge_index (const blender::IndexRange face, const blender::Span< int > corner_edges, const int current_edge_index)
 
static bool follow_face_loop (const int face_start_index, const int edge_start_index, const blender::OffsetIndices< int > faces, const blender::VArray< bool > &hide_poly, const blender::Span< int > corner_edges, const blender::GroupedSpan< int > edge_to_face_map, blender::VectorSet< int > &r_loop_faces)
 
void paintface_select_loop (bContext *C, Object *ob, const int mval[2], const bool select)
 
static bool poly_has_selected_neighbor (blender::Span< int > face_edges, blender::Span< blender::int2 > edges, blender::Span< bool > select_vert, const bool face_step)
 
void paintface_select_more (Mesh *mesh, const bool face_step)
 
static bool poly_has_unselected_neighbor (blender::Span< int > face_edges, blender::Span< blender::int2 > edges, blender::BitSpan verts_of_unselected_faces, const bool face_step)
 
void paintface_select_less (Mesh *mesh, const bool face_step)
 
bool paintface_deselect_all_visible (bContext *C, Object *ob, int action, bool flush_flags)
 
bool paintface_minmax (Object *ob, float r_min[3], float r_max[3])
 
bool paintface_mouse_select (bContext *C, const int mval[2], const SelectPick_Params *params, Object *ob)
 
void paintvert_flush_flags (Object *ob)
 
static void paintvert_select_linked_vertices (bContext *C, Object *ob, const blender::Span< int > vertex_indices, const bool select)
 
void paintvert_select_linked_pick (bContext *C, Object *ob, const int region_coordinates[2], const bool select)
 
void paintvert_select_linked (bContext *C, Object *ob)
 
void paintvert_select_more (Mesh *mesh, const bool face_step)
 
void paintvert_select_less (Mesh *mesh, const bool face_step)
 
void paintvert_tag_select_update (bContext *C, Object *ob)
 
bool paintvert_deselect_all_visible (Object *ob, int action, bool flush_flags)
 
void paintvert_select_ungrouped (Object *ob, bool extend, bool flush_flags)
 
void paintvert_hide (bContext *C, Object *ob, const bool unselected)
 
void paintvert_reveal (bContext *C, Object *ob, const bool select)
 

Function Documentation

◆ build_poly_connections()

static void build_poly_connections ( blender::AtomicDisjointSet & islands,
Mesh & mesh,
const bool skip_seams = true )
static

Join all edges of each face in the #AtomicDisjointSet. This can be used to find out which faces are connected to each other.

Parameters
islandsIs expected to be of length mesh->edges_num.
skip_seamsFaces separated by a seam will be treated as not connected.

Definition at line 229 of file editface.cc.

Referenced by paintface_select_linked_faces().

◆ find_closest_edge_in_poly()

static int find_closest_edge_in_poly ( ARegion * region,
blender::Span< blender::int2 > edges,
blender::Span< int > face_edges,
blender::Span< blender::float3 > vert_positions,
const int mval[2] )
static

◆ follow_face_loop()

static bool follow_face_loop ( const int face_start_index,
const int edge_start_index,
const blender::OffsetIndices< int > faces,
const blender::VArray< bool > & hide_poly,
const blender::Span< int > corner_edges,
const blender::GroupedSpan< int > edge_to_face_map,
blender::VectorSet< int > & r_loop_faces )
static

Follow quads around the mesh by finding opposing edges.

Returns
True if the search has looped back on itself, finding the same index twice.

Definition at line 406 of file editface.cc.

References blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), get_opposing_edge_index(), and size().

Referenced by paintface_select_loop().

◆ get_opposing_edge_index()

static int get_opposing_edge_index ( const blender::IndexRange face,
const blender::Span< int > corner_edges,
const int current_edge_index )
static

Definition at line 389 of file editface.cc.

References blender::Span< T >::first_index(), and blender::Span< T >::slice().

Referenced by follow_face_loop().

◆ paintface_deselect_all_visible()

◆ paintface_flush_flags()

◆ paintface_hide()

void paintface_hide ( bContext * C,
Object * ob,
const bool unselected )

◆ paintface_minmax()

bool paintface_minmax ( Object * ob,
float r_min[3],
float r_max[3] )

◆ paintface_mouse_select()

bool paintface_mouse_select ( bContext * C,
const int mval[2],
const SelectPick_Params * params,
Object * ob )

◆ paintface_reveal()

void paintface_reveal ( bContext * C,
Object * ob,
const bool select )

◆ paintface_select_less()

void paintface_select_less ( Mesh * mesh,
const bool face_step )

◆ paintface_select_linked()

◆ paintface_select_linked_faces()

static void paintface_select_linked_faces ( Mesh & mesh,
const blender::Span< int > face_indices,
const bool select )
static

Definition at line 275 of file editface.cc.

References build_poly_connections(), and blender::Span< T >::slice().

Referenced by paintface_select_linked().

◆ paintface_select_loop()

◆ paintface_select_more()

void paintface_select_more ( Mesh * mesh,
bool face_step )

Grow the selection of faces.

Parameters
face_stepIf true will also select faces that only touch on the corner.

Definition at line 559 of file editface.cc.

References blender::bke::SpanAttributeWriter< T >::span.

Referenced by paint_select_more_exec().

◆ paintvert_deselect_all_visible()

bool paintvert_deselect_all_visible ( Object * ob,
int action,
bool flush_flags )

◆ paintvert_flush_flags()

◆ paintvert_hide()

◆ paintvert_reveal()

void paintvert_reveal ( bContext * C,
Object * ob,
const bool select )

◆ paintvert_select_less()

◆ paintvert_select_linked()

◆ paintvert_select_linked_pick()

void paintvert_select_linked_pick ( bContext * C,
Object * ob,
const int region_coordinates[2],
const bool select )

◆ paintvert_select_linked_vertices()

static void paintvert_select_linked_vertices ( bContext * C,
Object * ob,
const blender::Span< int > vertex_indices,
const bool select )
static

Definition at line 881 of file editface.cc.

References BKE_mesh_from_object().

Referenced by paintvert_select_linked(), and paintvert_select_linked_pick().

◆ paintvert_select_more()

void paintvert_select_more ( Mesh * mesh,
const bool face_step )

◆ paintvert_select_ungrouped()

void paintvert_select_ungrouped ( Object * ob,
bool extend,
bool flush_flags )

◆ paintvert_tag_select_update()

◆ poly_has_selected_neighbor()

static bool poly_has_selected_neighbor ( blender::Span< int > face_edges,
blender::Span< blender::int2 > edges,
blender::Span< bool > select_vert,
const bool face_step )
static

Definition at line 536 of file editface.cc.

References face_step().

◆ poly_has_unselected_neighbor()

static bool poly_has_unselected_neighbor ( blender::Span< int > face_edges,
blender::Span< blender::int2 > edges,
blender::BitSpan verts_of_unselected_faces,
const bool face_step )
static

Definition at line 592 of file editface.cc.

References face_step().