BRL-CAD

Routines for handling the indexing of NMG structs. More...

Collaboration diagram for Element Indexing:

Files

file  index.h
 

Data Structures

struct  nmg_struct_counts
 

Macros

#define NMG_INDEX_VALUE(_tab, _index)   ((_tab)[_index])
 
#define NMG_INDEX_TEST(_tab, _p)   ((_tab)[(_p)->index])
 
#define NMG_INDEX_SET(_tab, _p)   {(_tab)[(_p)->index] = 1;}
 
#define NMG_INDEX_CLEAR(_tab, _p)   {(_tab)[(_p)->index] = 0;}
 
#define NMG_INDEX_TEST_AND_SET(_tab, _p)   ((_tab)[(_p)->index] == 0 ? ((_tab)[(_p)->index] = 1) : 0)
 
#define NMG_INDEX_IS_SET(_tab, _p)   NMG_INDEX_TEST(_tab, _p)
 
#define NMG_INDEX_FIRST_TIME(_tab, _p)   NMG_INDEX_TEST_AND_SET(_tab, _p)
 
#define NMG_INDEX_ASSIGN(_tab, _p, _val)   {(_tab)[(_p)->index] = _val;}
 
#define NMG_INDEX_GET(_tab, _p)   ((_tab)[(_p)->index])
 
#define NMG_INDEX_GETP(_ty, _tab, _p)   ((struct _ty *)((_tab)[(_p)->index]))
 
#define NMG_INDEX_OR(_tab, _p, _val)   {(_tab)[(_p)->index] |= _val;}
 
#define NMG_INDEX_AND(_tab, _p, _val)   {(_tab)[(_p)->index] &= _val;}
 
#define NMG_INDEX_RETURN_IF_SET_ELSE_SET(_tab, _index)
 
#define NMG_0MANIFOLD   1
 
#define NMG_1MANIFOLD   2
 
#define NMG_2MANIFOLD   4
 
#define NMG_DANGLING   8 /* NMG_2MANIFOLD + 4th bit for special cond (UNUSED) */
 
#define NMG_3MANIFOLD   16
 
#define NMG_SET_MANIFOLD(_t, _p, _v)   NMG_INDEX_OR(_t, _p, _v)
 
#define NMG_MANIFOLDS(_t, _p)   NMG_INDEX_VALUE(_t, (_p)->index)
 
#define NMG_CP_MANIFOLD(_t, _p, _q)   (_t)[(_p)->index] = (_t)[(_q)->index]
 

Functions

int nmg_index_of_struct (const uint32_t *p)
 
uint32_t ** nmg_m_struct_count (struct nmg_struct_counts *ctr, const struct model *m)
 
void nmg_pr_m_struct_counts (const struct model *m, const char *str)
 
void nmg_vls_struct_counts (struct bu_vls *str, const struct nmg_struct_counts *ctr)
 
void nmg_pr_struct_counts (const struct nmg_struct_counts *ctr, const char *str)
 

Detailed Description

Routines for handling the indexing of NMG structs.

Macro Definition Documentation

◆ NMG_INDEX_VALUE

#define NMG_INDEX_VALUE (   _tab,
  _index 
)    ((_tab)[_index])

Definition at line 87 of file index.h.

◆ NMG_INDEX_TEST

#define NMG_INDEX_TEST (   _tab,
  _p 
)    ((_tab)[(_p)->index])

Definition at line 88 of file index.h.

◆ NMG_INDEX_SET

#define NMG_INDEX_SET (   _tab,
  _p 
)    {(_tab)[(_p)->index] = 1;}

Definition at line 89 of file index.h.

◆ NMG_INDEX_CLEAR

#define NMG_INDEX_CLEAR (   _tab,
  _p 
)    {(_tab)[(_p)->index] = 0;}

Definition at line 90 of file index.h.

◆ NMG_INDEX_TEST_AND_SET

#define NMG_INDEX_TEST_AND_SET (   _tab,
  _p 
)    ((_tab)[(_p)->index] == 0 ? ((_tab)[(_p)->index] = 1) : 0)

Definition at line 91 of file index.h.

◆ NMG_INDEX_IS_SET

#define NMG_INDEX_IS_SET (   _tab,
  _p 
)    NMG_INDEX_TEST(_tab, _p)

Definition at line 92 of file index.h.

◆ NMG_INDEX_FIRST_TIME

#define NMG_INDEX_FIRST_TIME (   _tab,
  _p 
)    NMG_INDEX_TEST_AND_SET(_tab, _p)

Definition at line 93 of file index.h.

◆ NMG_INDEX_ASSIGN

#define NMG_INDEX_ASSIGN (   _tab,
  _p,
  _val 
)    {(_tab)[(_p)->index] = _val;}

Definition at line 94 of file index.h.

◆ NMG_INDEX_GET

#define NMG_INDEX_GET (   _tab,
  _p 
)    ((_tab)[(_p)->index])

Definition at line 95 of file index.h.

◆ NMG_INDEX_GETP

#define NMG_INDEX_GETP (   _ty,
  _tab,
  _p 
)    ((struct _ty *)((_tab)[(_p)->index]))

Definition at line 96 of file index.h.

◆ NMG_INDEX_OR

#define NMG_INDEX_OR (   _tab,
  _p,
  _val 
)    {(_tab)[(_p)->index] |= _val;}

Definition at line 97 of file index.h.

◆ NMG_INDEX_AND

#define NMG_INDEX_AND (   _tab,
  _p,
  _val 
)    {(_tab)[(_p)->index] &= _val;}

Definition at line 98 of file index.h.

◆ NMG_INDEX_RETURN_IF_SET_ELSE_SET

#define NMG_INDEX_RETURN_IF_SET_ELSE_SET (   _tab,
  _index 
)
Value:
{ \
if ((_tab)[_index]) return; \
else (_tab)[_index] = 1; \
}

Definition at line 99 of file index.h.

◆ NMG_0MANIFOLD

#define NMG_0MANIFOLD   1

Definition at line 105 of file index.h.

◆ NMG_1MANIFOLD

#define NMG_1MANIFOLD   2

Definition at line 106 of file index.h.

◆ NMG_2MANIFOLD

#define NMG_2MANIFOLD   4

Definition at line 107 of file index.h.

◆ NMG_DANGLING

#define NMG_DANGLING   8 /* NMG_2MANIFOLD + 4th bit for special cond (UNUSED) */

Definition at line 108 of file index.h.

◆ NMG_3MANIFOLD

#define NMG_3MANIFOLD   16

Definition at line 109 of file index.h.

◆ NMG_SET_MANIFOLD

#define NMG_SET_MANIFOLD (   _t,
  _p,
  _v 
)    NMG_INDEX_OR(_t, _p, _v)

Definition at line 111 of file index.h.

◆ NMG_MANIFOLDS

#define NMG_MANIFOLDS (   _t,
  _p 
)    NMG_INDEX_VALUE(_t, (_p)->index)

Definition at line 112 of file index.h.

◆ NMG_CP_MANIFOLD

#define NMG_CP_MANIFOLD (   _t,
  _p,
  _q 
)    (_t)[(_p)->index] = (_t)[(_q)->index]

Definition at line 113 of file index.h.

Function Documentation

◆ nmg_index_of_struct()

int nmg_index_of_struct ( const uint32_t *  p)

◆ nmg_m_struct_count()

uint32_t** nmg_m_struct_count ( struct nmg_struct_counts ctr,
const struct model m 
)

◆ nmg_pr_m_struct_counts()

void nmg_pr_m_struct_counts ( const struct model m,
const char *  str 
)

◆ nmg_vls_struct_counts()

void nmg_vls_struct_counts ( struct bu_vls str,
const struct nmg_struct_counts ctr 
)

◆ nmg_pr_struct_counts()

void nmg_pr_struct_counts ( const struct nmg_struct_counts ctr,
const char *  str 
)