Welcome to mirror list, hosted at ThFree Co, Russian Federation.

bmesh_structure_inline.h « intern « bmesh « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e753318be46e6d40f8852a869c407984fc3b9e15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* SPDX-License-Identifier: GPL-2.0-or-later */

/** \file
 * \ingroup bmesh
 *
 * BMesh inline operator functions.
 */

#pragma once

ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1, 2)
    BLI_INLINE BMDiskLink *bmesh_disk_edge_link_from_vert(const BMEdge *e, const BMVert *v)
{
  BLI_assert(BM_vert_in_edge(e, v));
  return (BMDiskLink *)&(&e->v1_disk_link)[v == e->v2];
}

/**
 * \brief Next Disk Edge
 *
 * Find the next edge in a disk cycle
 *
 * \return Pointer to the next edge in the disk cycle for the vertex v.
 */
ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
    BLI_INLINE BMEdge *bmesh_disk_edge_next_safe(const BMEdge *e, const BMVert *v)
{
  if (v == e->v1) {
    return e->v1_disk_link.next;
  }
  if (v == e->v2) {
    return e->v2_disk_link.next;
  }
  return NULL;
}

ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
    BLI_INLINE BMEdge *bmesh_disk_edge_prev_safe(const BMEdge *e, const BMVert *v)
{
  if (v == e->v1) {
    return e->v1_disk_link.prev;
  }
  if (v == e->v2) {
    return e->v2_disk_link.prev;
  }
  return NULL;
}

ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1, 2) BLI_INLINE BMEdge *bmesh_disk_edge_next(const BMEdge *e,
                                                                                   const BMVert *v)
{
  return BM_DISK_EDGE_NEXT(e, v);
}

ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1, 2) BLI_INLINE BMEdge *bmesh_disk_edge_prev(const BMEdge *e,
                                                                                   const BMVert *v)
{
  return BM_DISK_EDGE_PREV(e, v);
}