BRL-CAD
op.h File Reference
#include "rt/defines.h"
Include dependency graph for op.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MKOP(x)   (x)
 
#define OP_SOLID   MKOP(1)
 Leaf: tr_stp -> solid. More...
 
#define OP_UNION   MKOP(2)
 Binary: L union R. More...
 
#define OP_INTERSECT   MKOP(3)
 Binary: L intersect R. More...
 
#define OP_SUBTRACT   MKOP(4)
 Binary: L subtract R. More...
 
#define OP_XOR   MKOP(5)
 Binary: L xor R, not both. More...
 
#define OP_REGION   MKOP(6)
 Leaf: tr_stp -> combined_tree_state. More...
 
#define OP_NOP   MKOP(7)
 Leaf with no effect. More...
 
#define OP_NOT   MKOP(8)
 Unary: not L. More...
 
#define OP_GUARD   MKOP(9)
 Unary: not L, or else! More...
 
#define OP_XNOP   MKOP(10)
 Unary: L, mark region. More...
 
#define OP_NMG_TESS   MKOP(11)
 Leaf: tr_stp -> nmgregion. More...
 
#define OP_DB_LEAF   MKOP(12)
 Leaf of combination, db fmt. More...
 
#define OP_FREE   MKOP(13)
 Unary: L has free chain. More...
 

Enumerations

enum  db_op_t { DB_OP_NULL = 0 , DB_OP_UNION = 'u' , DB_OP_SUBTRACT = '-' , DB_OP_INTERSECT = '+' }
 

Functions

db_op_t db_char2op (const char c)
 
db_op_t db_str2op (const char *str)
 

Detailed Description

Routines for detecting, using, and managing boolean operators.

Definition in file op.h.

Macro Definition Documentation

◆ MKOP

#define MKOP (   x)    (x)

Boolean operations between solids.

Definition at line 36 of file op.h.

◆ OP_SOLID

#define OP_SOLID   MKOP(1)

Leaf: tr_stp -> solid.

Definition at line 38 of file op.h.

◆ OP_UNION

#define OP_UNION   MKOP(2)

Binary: L union R.

Definition at line 39 of file op.h.

◆ OP_INTERSECT

#define OP_INTERSECT   MKOP(3)

Binary: L intersect R.

Definition at line 40 of file op.h.

◆ OP_SUBTRACT

#define OP_SUBTRACT   MKOP(4)

Binary: L subtract R.

Definition at line 41 of file op.h.

◆ OP_XOR

#define OP_XOR   MKOP(5)

Binary: L xor R, not both.

Definition at line 42 of file op.h.

◆ OP_REGION

#define OP_REGION   MKOP(6)

Leaf: tr_stp -> combined_tree_state.

Definition at line 43 of file op.h.

◆ OP_NOP

#define OP_NOP   MKOP(7)

Leaf with no effect.

Definition at line 44 of file op.h.

◆ OP_NOT

#define OP_NOT   MKOP(8)

Unary: not L.

Definition at line 46 of file op.h.

◆ OP_GUARD

#define OP_GUARD   MKOP(9)

Unary: not L, or else!

Definition at line 47 of file op.h.

◆ OP_XNOP

#define OP_XNOP   MKOP(10)

Unary: L, mark region.

Definition at line 48 of file op.h.

◆ OP_NMG_TESS

#define OP_NMG_TESS   MKOP(11)

Leaf: tr_stp -> nmgregion.

Definition at line 49 of file op.h.

◆ OP_DB_LEAF

#define OP_DB_LEAF   MKOP(12)

Leaf of combination, db fmt.

Definition at line 51 of file op.h.

◆ OP_FREE

#define OP_FREE   MKOP(13)

Unary: L has free chain.

Definition at line 52 of file op.h.

Enumeration Type Documentation

◆ db_op_t

enum db_op_t
Enumerator
DB_OP_NULL 
DB_OP_UNION 
DB_OP_SUBTRACT 
DB_OP_INTERSECT 

Definition at line 55 of file op.h.

Function Documentation

◆ db_char2op()

db_op_t db_char2op ( const char  c)

Give a single char, translate it to a db_op_t. If it does not correspond to a known operator, DB_OP_NULL is returned

◆ db_str2op()

db_op_t db_str2op ( const char *  str)

Get the next CSG boolean operator found in a given string.

Skipping any whitespace, this routine returns the CSG boolean operation in canonical (single-byte enumeration) form. It will attempt to recognize operators in various unicode formats if the input string contains mixed encodings.