next up previous contents
Next: C.2 Predstavitev teles z mejami Up: C. Uvodne datoteke modelirnika Previous: C. Uvodne datoteke modelirnika

C.1 Predstavitev CSG

 

Uvodna (Header) datoteka vsebuje definicije konstant in spremenljivk pri predstavitvi CSG. Definirane so konstante za posamezne operacije, velikosti vozla v seznamu teles in podatke o telesu.

#define SOLID_NODE_SIZE     32
#define DISPLAY     0
#define ADD         1
#define SUB         2
#define INT         3
#define CREATE      4
#define CHANGE      5
#define POSITION    6
#define PRIMITIV    7

#define NO_NAME     0
#define AUTO_NAME   1



#include "brep.h"       /* nrb-lists.h is included in b-rep.h */


/* 
 * Structures definition for SOLIDS
 */
typedef struct solidListElementSt {
  int ID;                           /* solid's unique ID */
  char *name;                       /* solid's name */
  Brep *brep ;                      /* pointer to B-rep of solid */
  int matID;                        /* solid's material ID */
  double volume;                    /* volume of solid */
  double area;                      /* area of solid */
  int ok;                           /* are volume and area calculated? */
  int BrepOK;                       /* Brep calculated ? */
} solidListElement ;


typedef struct solidListNodeSt {
  solidListElement solid[SOLID_NODE_SIZE];  /* array of solids in current 
                                               node */
  int filled;
  struct solidListNodeSt *prev;             /* pointer to prev node */
  struct solidListNodeSt *next;             /* pointer to next node */
} solidListNode ;


typedef struct CSGSt {
  solidListElement *solid;
  int oper;
  struct CSGSt *parent;
  struct CSGSt *childLeft;
  struct CSGSt *childRight;
} CSG;



Janez KREK
Fri Jul 5 12:10:59 METDST 1996