Blender V5.3
MOD_lineart.hh File Reference
#include "BLI_enum_flags.hh"
#include "BLI_linklist.hh"
#include "BLI_math_matrix_types.hh"
#include "BLI_math_vector_c.hh"
#include "BLI_set.hh"
#include "BLI_threads.hh"
#include "ED_grease_pencil.hh"
#include <algorithm>
#include <cmath>

Go to the source code of this file.

Classes

struct  blender::LineartModifierRuntime
struct  blender::LineartStaticMemPoolNode
struct  blender::LineartStaticMemPool
struct  blender::LineartTriangleAdjacent
struct  blender::LineartTriangle
struct  blender::LineartTriangleThread
struct  blender::LineartElementLinkNode
struct  blender::LineartEdgeSegment
struct  blender::LineartShadowEdge
struct  blender::LineartShadowSegment
struct  blender::LineartVert
struct  blender::LineartEdge
struct  blender::LineartEdgeChain
struct  blender::LineartEdgeChainItem
struct  blender::LineartChainRegisterEntry
struct  blender::LineartAdjacentEdge
struct  blender::LineartPendingEdges
struct  blender::LineartData
struct  blender::LineartData::_qtree
struct  blender::LineartData::_geom
struct  blender::LineartData::_conf
struct  blender::LineartCache
struct  blender::LineartRenderTaskInfo
struct  blender::LineartObjectInfo
struct  blender::LineartObjectLoadTaskInfo
struct  blender::LineartBoundingArea

Namespaces

namespace  blender
 BMesh Iterators.
namespace  blender::bke
namespace  blender::bke::greasepencil

Macros

#define LRT_TILE_SPLITTING_TRIANGLE_LIMIT   100
#define LRT_TILE_EDGE_COUNT_INITIAL   32
#define DBL_TRIANGLE_LIM   1e-8
#define DBL_EDGE_LIM   1e-9
#define LRT_MEMORY_POOL_1MB   (1 << 20)
#define LRT_SHADOW_MASK_UNDEFINED   0
#define LRT_SHADOW_MASK_ILLUMINATED   (1 << 0)
#define LRT_SHADOW_MASK_SHADED   (1 << 1)
#define LRT_SHADOW_MASK_ENCLOSED_SHAPE   (1 << 2)
#define LRT_SHADOW_MASK_INHIBITED   (1 << 3)
#define LRT_SHADOW_SILHOUETTE_ERASED_GROUP   (1 << 4)
#define LRT_SHADOW_SILHOUETTE_ERASED_OBJECT   (1 << 5)
#define LRT_SHADOW_MASK_ILLUMINATED_SHAPE   (1 << 6)
#define LRT_SHADOW_TEST_SHAPE_BITS
#define LRT_THREAD_EDGE_COUNT   1000
#define LRT_OBINDEX_SHIFT   20
#define LRT_OBINDEX_LOWER   0x0FFFFF
#define LRT_OBINDEX_HIGHER   0xFFF00000
#define LRT_EDGE_IDENTIFIER(obi, e)
#define LRT_LIGHT_CONTOUR_TARGET   0xFFFFFFFF
#define LRT_TILE(tile, r, c, CCount)
#define LRT_CLAMP(a, Min, Max)
#define LRT_MAX3_INDEX(a, b, c)
#define LRT_MIN3_INDEX(a, b, c)
#define LRT_MAX3_INDEX_ABC(x, y, z)
#define LRT_MIN3_INDEX_ABC(x, y, z)
#define DBL_LOOSER   1e-5
#define LRT_DOUBLE_CLOSE_LOOSER(a, b)
#define LRT_DOUBLE_CLOSE_ENOUGH(a, b)
#define LRT_DOUBLE_CLOSE_ENOUGH_TRI(a, b)
#define LRT_CLOSE_LOOSER_v3(a, b)
#define USE_VECTOR_LINE_INTERSECTION_IGN

Enumerations

enum  blender::eLineArtElementNodeFlag { blender::LRT_ELEMENT_IS_ADDITIONAL = (1 << 0) , blender::LRT_ELEMENT_BORDER_ONLY = (1 << 1) , blender::LRT_ELEMENT_NO_INTERSECTION = (1 << 2) , blender::LRT_ELEMENT_INTERSECTION_DATA = (1 << 3) }
enum  blender::eLineartShadowSegmentFlag { blender::LRT_SHADOW_CASTED = 1 , blender::LRT_SHADOW_FACING_LIGHT = 2 }
enum  blender::eLineArtTileRecursiveLimit { blender::LRT_TILE_RECURSIVE_PERSPECTIVE = 16 , blender::LRT_TILE_RECURSIVE_ORTHO = 10 }
enum  blender::eLineartShadowCameraType { blender::LRT_SHADOW_CAMERA_DIRECTIONAL = 1 , blender::LRT_SHADOW_CAMERA_POINT = 2 }
enum  blender::eLineartTriangleFlags {
  blender::LRT_CULL_DONT_CARE = 0 , blender::LRT_CULL_USED = (1 << 0) , blender::LRT_CULL_DISCARD = (1 << 1) , blender::LRT_CULL_GENERATED = (1 << 2) ,
  blender::LRT_TRIANGLE_INTERSECTION_ONLY = (1 << 3) , blender::LRT_TRIANGLE_NO_INTERSECTION = (1 << 4) , blender::LRT_TRIANGLE_MAT_BACK_FACE_CULLING = (1 << 5) , blender::LRT_TRIANGLE_FORCE_INTERSECTION = (1 << 6)
}

Functions

 blender::ENUM_OPERATORS (eLineArtElementNodeFlag)
BLI_INLINE int blender::lineart_intersect_seg_seg (const double a1[2], const double a2[2], const double b1[2], const double b2[2], double *r_ratio, bool *r_aligned)
BLI_INLINE int blender::lineart_line_isec_2d_ignore_line2pos (const double a1[2], const double a2[2], const double b1[2], const double b2[2], double *r_a_ratio)
void blender::MOD_lineart_destroy_render_data_v3 (GreasePencilLineartModifierData *lmd)
void blender::MOD_lineart_chain_feature_lines (LineartData *ld)
void blender::MOD_lineart_chain_split_for_fixed_occlusion (LineartData *ld)
void blender::MOD_lineart_chain_connect (LineartData *ld)
void blender::MOD_lineart_chain_discard_unused (LineartData *ld, const float threshold, uint8_t max_occlusion)
void blender::MOD_lineart_chain_clip_at_border (LineartData *ld)
void blender::MOD_lineart_chain_split_angle (LineartData *ld, float angle_threshold_rad)
void blender::MOD_lineart_smooth_chains (LineartData *ld, float tolerance)
void blender::MOD_lineart_chain_offset_towards_camera (LineartData *ld, float dist, bool use_custom_camera)
void blender::MOD_lineart_chain_find_silhouette_backdrop_objects (LineartData *ld)
int blender::MOD_lineart_chain_count (const LineartEdgeChain *ec)
void blender::MOD_lineart_chain_clear_picked_flag (LineartCache *lc)
void blender::MOD_lineart_finalize_chains (LineartData *ld)
bool blender::MOD_lineart_compute_feature_lines_v3 (Depsgraph *depsgraph, GreasePencilLineartModifierData &lmd, LineartCache **cached_result, bool enable_stroke_depth_offset)
LineartBoundingArea * blender::MOD_lineart_get_parent_bounding_area (LineartData *ld, double x, double y)
LineartBoundingArea * blender::MOD_lineart_get_bounding_area (LineartData *ld, double x, double y)
void blender::MOD_lineart_gpencil_generate_v3 (const LineartCache *cache, const float4x4 &inverse_mat, Depsgraph *depsgraph, bke::greasepencil::Drawing &drawing, const int8_t source_type, Object *source_object, Collection *source_collection, const int level_start, const int level_end, const int mat_nr, const int16_t edge_types, const uchar mask_switches, const uchar material_mask_bits, const uchar intersection_mask, const float thickness, const float opacity, const bool fill_strokes, const uchar shadow_selection, const uchar silhouette_mode, const char *source_vgname, const char *vgname, const int modifier_flags, const int modifier_calculation_flags)
float blender::MOD_lineart_chain_compute_length (LineartEdgeChain *ec)
LineartCache * blender::MOD_lineart_init_cache ()
void blender::MOD_lineart_clear_cache (LineartCache **lc)

Macro Definition Documentation

◆ DBL_EDGE_LIM

#define DBL_EDGE_LIM   1e-9

◆ DBL_LOOSER

#define DBL_LOOSER   1e-5

Definition at line 627 of file MOD_lineart.hh.

◆ DBL_TRIANGLE_LIM

#define DBL_TRIANGLE_LIM   1e-8

◆ LRT_CLAMP

#define LRT_CLAMP ( a,
Min,
Max )
Value:
a = a < Min ? Min : (a > Max ? Max : a)

Definition at line 617 of file MOD_lineart.hh.

◆ LRT_CLOSE_LOOSER_v3

#define LRT_CLOSE_LOOSER_v3 ( a,
b )
Value:
(LRT_DOUBLE_CLOSE_LOOSER(a[0], b[0]) && LRT_DOUBLE_CLOSE_LOOSER(a[1], b[1]) && \
LRT_DOUBLE_CLOSE_LOOSER(a[2], b[2]))
#define LRT_DOUBLE_CLOSE_LOOSER(a, b)

Definition at line 633 of file MOD_lineart.hh.

Referenced by blender::lineart_shadow_finalize_shadow_edges_task().

◆ LRT_DOUBLE_CLOSE_ENOUGH

◆ LRT_DOUBLE_CLOSE_ENOUGH_TRI

#define LRT_DOUBLE_CLOSE_ENOUGH_TRI ( a,
b )
Value:
(((a) + DBL_TRIANGLE_LIM) >= (b) && ((a) - DBL_TRIANGLE_LIM) <= (b))
#define DBL_TRIANGLE_LIM

Definition at line 630 of file MOD_lineart.hh.

Referenced by blender::lineart_intersect_seg_seg().

◆ LRT_DOUBLE_CLOSE_LOOSER

#define LRT_DOUBLE_CLOSE_LOOSER ( a,
b )
Value:
(((a) + DBL_LOOSER) >= (b) && ((a) - DBL_LOOSER) <= (b))
#define DBL_LOOSER

Definition at line 628 of file MOD_lineart.hh.

◆ LRT_EDGE_IDENTIFIER

#define LRT_EDGE_IDENTIFIER ( obi,
e )
Value:
(((uint64_t)(obi->obindex | (e->v1->index & LRT_OBINDEX_LOWER)) << 32) | \
(obi->obindex | (e->v2->index & LRT_OBINDEX_LOWER)))
#define LRT_OBINDEX_LOWER
unsigned long long int uint64_t

Definition at line 525 of file MOD_lineart.hh.

Referenced by blender::lineart_geometry_object_load().

◆ LRT_LIGHT_CONTOUR_TARGET

#define LRT_LIGHT_CONTOUR_TARGET   0xFFFFFFFF

◆ LRT_MAX3_INDEX

#define LRT_MAX3_INDEX ( a,
b,
c )
Value:
(a > b ? (a > c ? 0 : (b > c ? 1 : 2)) : (b > c ? 1 : 2))

Definition at line 619 of file MOD_lineart.hh.

◆ LRT_MAX3_INDEX_ABC

#define LRT_MAX3_INDEX_ABC ( x,
y,
z )
Value:
(x > y ? (x > z ? a : (y > z ? b : c)) : (y > z ? b : c))
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
Definition btQuadWord.h:117

Definition at line 623 of file MOD_lineart.hh.

◆ LRT_MEMORY_POOL_1MB

#define LRT_MEMORY_POOL_1MB   (1 << 20)

◆ LRT_MIN3_INDEX

#define LRT_MIN3_INDEX ( a,
b,
c )
Value:
(a < b ? (a < c ? 0 : (b < c ? 1 : 2)) : (b < c ? 1 : 2))

Definition at line 621 of file MOD_lineart.hh.

◆ LRT_MIN3_INDEX_ABC

#define LRT_MIN3_INDEX_ABC ( x,
y,
z )
Value:
(x < y ? (x < z ? a : (y < z ? b : c)) : (y < z ? b : c))

Definition at line 625 of file MOD_lineart.hh.

◆ LRT_OBINDEX_HIGHER

◆ LRT_OBINDEX_LOWER

#define LRT_OBINDEX_LOWER   0x0FFFFF

◆ LRT_OBINDEX_SHIFT

#define LRT_OBINDEX_SHIFT   20

Definition at line 522 of file MOD_lineart.hh.

Referenced by blender::lineart_object_load_single_instance().

◆ LRT_SHADOW_MASK_ENCLOSED_SHAPE

#define LRT_SHADOW_MASK_ENCLOSED_SHAPE   (1 << 2)

◆ LRT_SHADOW_MASK_ILLUMINATED

#define LRT_SHADOW_MASK_ILLUMINATED   (1 << 0)

◆ LRT_SHADOW_MASK_ILLUMINATED_SHAPE

#define LRT_SHADOW_MASK_ILLUMINATED_SHAPE   (1 << 6)

◆ LRT_SHADOW_MASK_INHIBITED

#define LRT_SHADOW_MASK_INHIBITED   (1 << 3)

Definition at line 494 of file MOD_lineart.hh.

Referenced by blender::lineart_edge_cut().

◆ LRT_SHADOW_MASK_SHADED

◆ LRT_SHADOW_MASK_UNDEFINED

#define LRT_SHADOW_MASK_UNDEFINED   0

Definition at line 490 of file MOD_lineart.hh.

Referenced by blender::MOD_lineart_gpencil_generate_v3().

◆ LRT_SHADOW_SILHOUETTE_ERASED_GROUP

#define LRT_SHADOW_SILHOUETTE_ERASED_GROUP   (1 << 4)

◆ LRT_SHADOW_SILHOUETTE_ERASED_OBJECT

#define LRT_SHADOW_SILHOUETTE_ERASED_OBJECT   (1 << 5)

Definition at line 496 of file MOD_lineart.hh.

◆ LRT_SHADOW_TEST_SHAPE_BITS

#define LRT_SHADOW_TEST_SHAPE_BITS
Value:
#define LRT_SHADOW_MASK_INHIBITED
#define LRT_SHADOW_MASK_ILLUMINATED_SHAPE
#define LRT_SHADOW_MASK_ILLUMINATED
#define LRT_SHADOW_MASK_SHADED

Definition at line 499 of file MOD_lineart.hh.

Referenced by blender::MOD_lineart_gpencil_generate_v3().

◆ LRT_THREAD_EDGE_COUNT

#define LRT_THREAD_EDGE_COUNT   1000

Controls how many edges a worker thread is processing at one request. There's no significant performance impact on choosing different values. Don't make it too small so that the worker thread won't request too many times.

Definition at line 508 of file MOD_lineart.hh.

Referenced by blender::lineart_occlusion_make_task_info().

◆ LRT_TILE

#define LRT_TILE ( tile,
r,
c,
CCount )
Value:
tile[r * CCount + c]
const ccl_global KernelWorkTile * tile

Definition at line 615 of file MOD_lineart.hh.

◆ LRT_TILE_EDGE_COUNT_INITIAL

#define LRT_TILE_EDGE_COUNT_INITIAL   32

◆ LRT_TILE_SPLITTING_TRIANGLE_LIMIT

#define LRT_TILE_SPLITTING_TRIANGLE_LIMIT   100

◆ USE_VECTOR_LINE_INTERSECTION_IGN

#define USE_VECTOR_LINE_INTERSECTION_IGN