gCAD3D 2.40
xa_ga.c File Reference

Object-parent-table. More...

#include <string.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "../ut/ut_geo.h"
#include "../ut/ut_txt.h"
#include "../ut/ut_memTab.h"
#include "../ut/ut_col.h"
#include "../ut/ut_os.h"
#include "../db/ut_DB.h"
#include "../ut/func_types.h"
#include "../xa/xa_mem.h"
#include "../xa/xa_ga.h"
#include "../xa/xa.h"

Macros

#define GA_INC_SIZ   10000
 

Functions

long GA_find__ (int typ, long ind)
 ================================================================ More...
 
long GA_newRec ()
 ================================================================ More...
 
long GA_addRec ()
 ================================================================ More...
 
long GA_creRec (int typ, long ind)
 ================================================================ More...
 
int GA_realloc (int newSiz)
 ================================================================ More...
 
int GA_fil_wri (FILE *fpo, int iGrp, int src, int ckExist)
 
int GA_decode__ (char *cbuf)
 
int GA_load__ (char *cbuf)
 
int GA_sStylTab (int aus_anz, int *aus_typ, double *aus_tab)
 =============================================================== More...
 
int GA_LtypTab (int aus_anz, int *aus_typ, double *aus_tab)
 =============================================================== More...
 
int GA_hideTab (int aus_anz, int *aus_typ, double *aus_tab)
 =============================================================== More...
 
int GA_view__ (long dli, int mode, int typ, long dbi)
 ================================================================ More...
 
int GA_hide__ (int mode, long dli, int typ)
 =============================================================== More...
 
int GA_getRec (ObjAtt **ga_rec, long ind)
 ================================================================ More...
 
int GA_get_dbo (int *iAtt, int typ, long dbi)
 
int GA_ckEmpty (long ind)
 ================================================================ More...
 
int GA_clean1 ()
 ================================================================ More...
 
int GA_delRec (int typ, long ind)
 
int GA_find_att_SU (int typ, long ind)
 
int GA_Col__ (long dli, int mode, int typ, long ind)
 
int GA_Tex__ (long dli, int mode, int typ, long ind)
 
int GA_tex_ga2tr (long iga)
 
int GA_Tra__ (long dli, int mode, int typ, long ind)
 
int GA_lTyp__ (long dli, int lTyp, int typ, long ind, int iRedraw)
 
int GA_sStyl__ (long dli, int sStyl, int typ, long dbi)
 ================================================================ More...
 
int GA_dump_tex (FILE *fpo)
 ================================================================ More...
 
int GA_dump__ (FILE *fpo)
 ================================================================ More...
 
int GA_dump_1 (long i1, FILE *fpo)
 ================================================================ More...
 

Variables

DL_AttGR_ObjTab
 
long GR_TAB_IND
 
int TexRefNr
 
TexRefTexRefTab
 
char UI_stat_view
 
char UI_stat_hide
 
AP_STAT AP_stat
 
ColRGB AP_actcol
 the active color .. More...
 
ColRGB AP_defcol
 die DefaultColor des aktiven (sub)Model More...
 
ObjAttGA_ObjTab =NULL
 
int GA_recNr =0
 
static int GA_stat =0
 
static long GA_SIZ = 0
 
static ObjAtt GA_DefRec
 

Detailed Description

Object-parent-table.

PermanentAttributeList.

=====================================================
List_functions_start:
MEMTAB_tmpSpc_get get tempSpc for <siz> parent-records
OPAR_get_src get parents of srcObj oPar
// OPAR_init init or reset
// OPAR_set add a new record
// OPAR_get get parent of Child
// OPAR_del delete record
// OPAR_file write|read ParentTable
// OPAR_dump
List_functions_end:
=====================================================
see also:
APT_ato_par_srcLn get atomicObjects and parents
ATO_parents__ get all parents
APT_work_parent_hide
=====================================================
List_functions_start:
GA_find_att_SU get attribute for surface/solid from typ,DB-ind
GA_find__ find GA-rec if already exist
GA_getRec get ga-record
GA_get_dbo get GraficAttribute for DB-obj
GA_delRec delete ga-record
GA_hide__ hide mainfunctions ..
GA_hide_fil__ save / restore - with open File (binary file)
GA_hide_fil_tmp save Hidelist --> File / restore Hidelist from File
GA_hideTab Load Liste aus HIDE-TextLine
GA_view__ hide / view obj
GA_lTyp__ modify lineType
GA_LtypTab load Ltyp-table
GA_sStyl__ modify surfStyle
GA_sStylTab tabelle von objects laden ..
GA_Col__ modify color
GA_Tex__ texture-functions (remove/load/apply/update texture)
GA_tex_ga2tr get TexRef-nr from GA-record-nr
GA_Tra__ modify transparenz
GA_fil_wri write out the PermanentAttributes (as sourceText)
GA_load__ decode GATAB-Line ?
GA_decode__ decode a runtime-attribute
- internal:
GA_newRec get recordNr of next free record
GA_addRec add new Record
List_functions_end:
=====================================================

Macro Definition Documentation

#define GA_INC_SIZ   10000

Function Documentation

long GA_find__ ( int  typ,
long  ind 
)

================================================================

================================================================ GA_find__ find GA-rec if already exist ACHTUNG: fix typ vorher mit AP_typ_2_bastyp !

long GA_newRec ( )

================================================================

================================================================ GA_newRec get recordNr of next free record

long GA_addRec ( )

================================================================

================================================================ eine neuen GA-Record anlegen und desen Nr retournieren ..

long GA_creRec ( int  typ,
long  ind 
)

================================================================

================================================================

int GA_realloc ( int  newSiz)

================================================================

================================================================ rc 0: OK; rc -2: EOM. Exit.

int GA_fil_wri ( FILE *  fpo,
int  iGrp,
int  src,
int  ckExist 
)
* write out the PermanentAttributes. HIDE, G#, SSTYLS ..
* Input:
* iGrp 0 = all Obj's;
* 1 = only objs's in Group.
* ckExist 0=no, do not check; 1=yes.
*
int GA_decode__ ( char *  cbuf)
* GA_decode__ decode a runtime-attribute
* Example:
* ":ATTRIB:A20 C39cc30" sets color for A20
* runtime-attributes become disactivated after beeing worked (in ED_Run).
* The Attributes are stored even if the obj does not yet exist.
* (attributes can be defined before creating the obj).
*
int GA_load__ ( char *  cbuf)

parameter ist die GATAB-Line; mem_cbuf1 wenn parameter == NULL, dann delete GA-Tab.

int GA_sStylTab ( int  aus_anz,
int *  aus_typ,
double *  aus_tab 
)

===============================================================

=============================================================== eine SSTYLS-tabelle von objects laden .. zB "G2 L20 .."

int GA_LtypTab ( int  aus_anz,
int *  aus_typ,
double *  aus_tab 
)

===============================================================

=============================================================== eine Ltyp-tabelle von objects laden .. zB "G2 L20 .."

int GA_hideTab ( int  aus_anz,
int *  aus_typ,
double *  aus_tab 
)

===============================================================

=============================================================== eine hide-tabelle von objects laden ..

int GA_view__ ( long  dli,
int  mode,
int  typ,
long  dbi 
)

================================================================

================================================================ GA_view__ hide / view obj Input: mode 0=view;Redraw, 1=hide;Redraw 2=view;noRedraw 3=hide;noRedraw dli dispListIndex given: typ,dbi unused. if dli not given: dispList is not updated ! typ,dbi dataBaseTyp und -index given: dli unused (set it to -1L)

Example: GA_view__ (-1, 1, s_tab[sInd].gTyp, s_tab[sInd].gInd);

int GA_hide__ ( int  mode,
long  dli,
int  typ 
)

===============================================================

=============================================================== Input: typ = APT-Typ dli = mode==0: DB-index; mode==3: DL-Index mode =-1: clear hidden-Elements-Tabelle mode = 1: update (hidden Elements aus Tabelle wieder hiden) mode = 5: set reverseMode (display all hidden objects; mode = 6: set reverseMode off mode = 7: Display Info Hidden about Objects mode = 8: ask state; 0=normal, 1=hidden, -1=notExist

int GA_getRec ( ObjAtt **  ga_rec,
long  ind 
)

================================================================

================================================================

* get GraficAttribute for GA_ObjTab-record ind
* see AP_GA_get
*
int GA_get_dbo ( int *  iAtt,
int  typ,
long  dbi 
)
* get GraficAttribute for DB-obj
* Output:
* retCod 1 no GA-Record exists
* 0 OK, iAtt = GraficAttribute
*
int GA_ckEmpty ( long  ind)

================================================================

================================================================

int GA_clean1 ( )

================================================================

================================================================

int GA_delRec ( int  typ,
long  ind 
)
int GA_find_att_SU ( int  typ,
long  ind 
)
* GA_find_att_SU get attribute for surface/solid from typ,DB-ind
*
* other method (using DispListIndex dli): iatt = DL_get_iatt (dli);
* or: iAtt = GR_ObjTab[dli].iatt
*
int GA_Col__ ( long  dli,
int  mode,
int  typ,
long  ind 
)
* GA_Col__ modify color
* mode = 0: modify Color (apply AP_actcol)
* 1: reset Color (set color not active)
* 2: select_as_new_color
*
int GA_Tex__ ( long  dli,
int  mode,
int  typ,
long  ind 
)
* mode 0 = remove texture
* mode 1 = apply texture, redraw.
* mode 2 = load texture
* mode 3 = update texture
* mode 5 = apply texture, but do not (yet) redraw.
*
int GA_tex_ga2tr ( long  iga)
int GA_Tra__ ( long  dli,
int  mode,
int  typ,
long  ind 
)
* GA_Tra__ modify transparenz
* mode: 0 = reset transpar.
* 1 = apply 50 % transpar.
* 2 = apply 100 % transpar.
*
int GA_lTyp__ ( long  dli,
int  lTyp,
int  typ,
long  ind,
int  iRedraw 
)
* GA_lTyp__ modify lineType
* Input:
* lTyp index into attributeTable; 0-50.
* iRedraw 0=do_redraw; 1=not.
*
int GA_sStyl__ ( long  dli,
int  sStyl,
int  typ,
long  dbi 
)

================================================================

================================================================ GA_sStyl__ modify surfStyle

Input: dli DL-Ind; if(dli==-1) GA-Record anlegen od. modifizieren if(dli>=0): modify obj; sStyl 1=shaded, 2=symbolic, 3=transparent.

int GA_dump_tex ( FILE *  fpo)

================================================================

================================================================ alle GA-records mit textures raus ..

int GA_dump__ ( FILE *  fpo)

================================================================

================================================================ write into open file; do not close ..

int GA_dump_1 ( long  i1,
FILE *  fpo 
)

================================================================

================================================================

Variable Documentation

DL_Att* GR_ObjTab
long GR_TAB_IND
int TexRefNr
TexRef* TexRefTab
char UI_stat_view
char UI_stat_hide
AP_STAT AP_stat
ColRGB AP_actcol

the active color ..

ColRGB AP_defcol

die DefaultColor des aktiven (sub)Model

ObjAtt* GA_ObjTab =NULL
int GA_recNr =0
int GA_stat =0
static
long GA_SIZ = 0
static
ObjAtt GA_DefRec
static