gCAD3D 2.40

../../doc/gcad_doxygen/Tables-Format.dox

DynamicDataArea
PermanentAttributeList
DisplayList
Submodels
  BasicModelList
  ModelReferenceList
BasicTexureList
TextureReferenceList

DynamicDataArea

=================================================================
DynamicDataArea
=================================================================
In every model the first block is the DynamicDataArea;
it ends with the line ":DYNAMIC_DATA".
The DynamicDataArea can have the following commands:
MODSIZ ..
DEFTX ..
DEFCOL ..
VIEW ..
CONST_PL ..
GATAB
..
ENDGATAB
:DYNAMIC_DATA
GATAB starts the grafic-attributes-table;
Grafic-Attributes-Records for surfaces:
<ObjectID> [C<color> [H] [T#] [S#] [X"filename"<,parameters>]
H hidden
C R-G-B-Colors as 3 x 2 hex-chars; eg. green is C00ff00
T transparent; 0=not, 1=50% transparent, 2=full transparent
S symbolic; 0=not, 1=symbolic display
X textured surface; Format:
X"<Image>",X-scale,Y-Scale,X-Offset,Y-Offset,RotAng[,X-vec,Z-Vec]
<Image> consists of "<symbolPath>/<imagefilename>"
Offsets are Values from 0-1
RotAng in degree
Grafic-Attributes-Records for Lines, Curves:
<ObjectID> [T#]
H hide
T index Linetyp; 2=dash, 3=dashDot.
Example DynamicDataArea:
# DefaultColor
DEFCOL 224 224 242
GATAB
# Linetype; 2=dash, 3=dashDot.
L20 T2
L21 T3
# color green, semiTransparent
A20 C00ff00 T1
# textures
A21 X"Data/sample_Stein1.bmp",5,5,0,0,15
A22 X"Data/sample_Ziegel1.bmp",5,5,0,0,0
ENDGATAB
:DYNAMIC_DATA
# here starts geometric-object-space
L20=P(0 0 0) P(50 0 0)
L21=P(0 0 0) P(50 50 0)
S20=REC P(50 0 0) D(50 0 0) D(0 50 0)
S21=REC P(50 0 0) D(0 50 0) D(0 0 20)
S22=REC P(50 50 0) D(50 0 0) D(0 50 0)
A20=S20
A21=S21
A22=S22

PermanentAttributeList

=================================================================
PermanentAttributeList
=================================================================
// PermanentAttributRecord
typedef struct {long ind;
unsigned long iatt;
unsigned lay:16, typ:8,
unused:7, disp:1;} ObjAtt;
// typ DB-Typ
// ind DB-Index
// iatt for typ=LN/AC/Curve: LineTypNr.
// for typ=TAG/IMG: sx/sy
// for typ=Surf/Model: ColRGB
// disp 0=normal; 1=hidden
// oNam objectname; not yet impl.
// size = 12
../xa/xa_ga.c:
ObjAtt *GA_ObjTab=NULL; // die PermanentAttributeTable
int GA_recNr=0; // die aktuelle Anzahl von Records
Die DispList enthaelt alle fuers Display erforderlichen Infos
(Color, Texture, symbolic-yes/no usw).
Die DispList wird bei RUN neu generiert, die GA_ObjTab ist permanent.
Die GA_ObjTab ist eine Kopie, die erforderlich ist um den DL-Record
wieder zu erzeugen.
In der DispList gibt es keine Info ob ein zugehoeriger GA_ObjTab-Record
existiert.
Nur fuer typ=Surf/Model: GA_ObjTab[i].iatt ist eine ColRGB;
// Typ_Color
typedef struct {unsigned cr:8, cg:8, cb:8,
unused:3, vtra:2, vsym:1, vtex:1, color:1;} ColRGB;
// vtra view transparent; 0=not, 1=25% transparent, 2=50%, 3=75%
// vtex has texture; 0=not, 1=yes; (cr+cg+cb) = textureRefNr
// vsym view normal (0,shaded) or symbolic (1,wireframeboundary)
// color 0=color not active; 1=color from cr/cg/cb
// size = 4

DisplayList

=================================================================
DisplayList
=================================================================
// typedef struct {long ind; int lNr; short refInd, attInd;
typedef struct {long ind, lNr;
unsigned long iatt;
unsigned modInd:16, typ:8,
disp:1, pick:1, hili:1, dim:1,
grp_1:1, temp:1, unvis:1, sPar:1;} DL_Att;
// lNr APTlineNr.
// typ DB-Typ
// ind DB-Index
// refInd 2d_to_3d_Ind
// modInd ModelNr
// iatt for typ=LN/AC/Curve: LineTypNr.
// for typ=TAG/IMG: sx/sy
// for typ=Surf/Model: ColRGB
// in Parent-state DL-index of child
// disp, hili:
// normal = ((disp == 0)&&(hili == 1))
// hilite = ((disp == 1)&&(hili == 0))
// hidden = ((disp == 1)&&(hili == 1))
// pick 0=unpickable, 1=pickable
// unvis 0=visible; 1=obj does not have graph. representation
// sPar 0=independent; 1=Parent-state is active.
// grp_1 0=belongs to active Group, 1=not
// size = 16
../gr/ut_DL.c:
DL_Att *GR_ObjTab; // die DisplayList
long GR_TAB_IND; // naechster freier Index
Nur fuer typ=Surf/Model: GR_ObjTab[i].iatt ist eine ColRGB;
genauso wie bei PermanentAttributeList. For iatt see PermanentAttributeList.

Submodels

=================================================================
Submodels
=================================================================
all visible objects have a dispListRecord
- its .modInd is the basicModelNr (index mdb_dyn) the object belongs to
- if (.modInd = -1) then obj belongs to the active model.
all modelReferences (table mdr_tab) have a dispListRecord typ=Typ_Model
- its .ind is the ReferenceNr (index mdr_tab)
Vars:
mdb_dyn List of basicModels
mdr_tab List of modelReferences (dittos)
DL_Att.modInd -1=mainmodel, else basicModelNr (index mdb_dyn)
WC_modnam Modelname
WC_modact_nam name of the active submodel
Functions:
dla = DL_GetAtt(DL Index); // get DL-record
model_nr = dla.modInd; // -1=active Model, 0-n=Submodel
ModelBas * mdr;
// the BasicModelRecord of a Submodels get
mdr = DB_get_ModBas (dla.modInd);
// mdr >mnam is now the Modelname of the Submodel.
Mod_ck_isMain check if the active model is the mainmodel
DB_get_ModRef get Ditto from Index
DB_get_ModBas get the basicModel with index <Ind>
Files in <tempDir>:
Model the complete model after prg.exit
Mod.lst List of all internal subModels
Model_<subModelname>
Exp_<subModelname> subModel im zuletzt exportierten Format
M#A#.msh binary; Mesh-Faces & Edgelines.
M#A#.ptab binary; Mesh-points.
<subModelname>.tess externes Mockup-subModel (zB wrl, stl)
Catalog.lst eine Liste aller existierenden CatalogFiles
catParts.act der Filename des momentan aktiven CatalogFile
catParts.lst die PartList des momentan aktiven CatalogFile

BasicModelList

=================================================================
BasicModelList
=================================================================
../ut/ut_geo.h
///

typedef struct {char *mnam; Point po, pb1, pb2; long DLind, DLsiz; short typ, seqNr;} ModelBas;

../db/ut_DB.c: static ModelBas *mdb_dyn; the list of basicModel static long DYN_MB_IND the nr of basicModels

Functions: DB_StoreModBas store basicModel DB_get_ModBas get the basicModel

ModelReferenceList

=================================================================
ModelReferenceList
=================================================================
// Typ_Model
typedef struct {char *mnam; int modNr; double scl;
Point po; Vector vx, vz;} ModelRef;
// modNr .. modelnumber of ModelBas-obj. (DB_get_ModNr())
// po .. position of ditto
../db/ut_DB.c:
static ModelRef *mdr_tab;

BasicTexureList

=================================================================
BasicTexureList
=================================================================
// Typ_TEXB
typedef struct {long dli; char *fnam;
short xSiz, ySiz, texNr, keep;} TexBas;
// dli DispListindex of the Texture
// texNr (OpenGL-) TextureNr
// keep 0=do not keep texture; 1=keep.
// fnam Filename (symbolicPath/Filename) of the Texturefile
// xSiz, ySiz size of the Texure in pixels
../xa/xa_tex.c:
static TexBas *TexBasTab;
static int TexBasNr; // next free index

TextureReferenceList

=================================================================
TextureReferenceList
=================================================================
// Typ_TEXR
typedef struct {long ibas; float uscx, uscy, udx, udy, uar;
float scx, scy, dx, dy; Vector vx, vy;} TexRef;
// ibas index of the Base-Texure
// uscx uscy User-defined-scale in X- and Y-direction;
// udx udy User-defined-offset of texture; 0-1
// uar User-defined-rotationAngle for texture in degree
// scx scy scale in X- and Y-direction;
// dx, dy offset of texture; 0-1
// vx, vy X- and Y-vector of textureplane
../xa/xa_tex.c:
static TexRef *TexRefTab;
static int TexRefNr; // next free index
Ist ebenfalls permanent wie die PermanentAttributeList und die BasicTexureList;
beim Exit wird die GATAB daraus generiert.