gCAD3D 2.35
ut_DL.c File Reference

displayList functions More...

#include <string.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <GL/gl.h>
#include "../ut/ut_geo.h"
#include "../ut/ut_TX.h"
#include "../ut/ut_txfil.h"
#include "../ut/ut_txt.h"
#include "../ut/ut_os.h"
#include "../ut/ut_col.h"
#include "../ut/func_types.h"
#include "../gr/vf.h"
#include "../db/ut_DB.h"
#include "../gr/ut_GL.h"
#include "../gr/ut_DL.h"
#include "../gr/ut_gr.h"
#include "../xa/xa_mem.h"
#include "../xa/xa_uid.h"
#include "../xa/xa_obj_txt.h"
#include "../xa/xa.h"
#include "../xa/xa_app.h"

Macros

#define oaSIZ   10
 

Functions

int DL_txtSelect (int iNr, ObjDB **dlTab)
 
int DL_IactSelect (int iNr, ObjDB **dlTab)
 
int DL_Stat ()
 
void DL_disp_def (int mode)
 
int DL_wri_dynDat0 (FILE *fpo)
 
int DL_wri_dynDat1 (FILE *fpo)
 
void DL_hide__ (long ind, int mode)
 
int DL_hide_all (int mode)
 
int DL_hide_chg ()
 
int DL_disp_PL (int mode)
 
int DL_hide_unvisTypes (int mode)
 
int DL_unvis_set (long ind, int mode)
 
int DL_hili_on (long ind)
 
int DL_hili_off (long ind)
 
int DL_pick__ (int mode)
 
int DL_pick_typ (int typ, int mode)
 
int DL_pick_set (long ind, int mode)
 
int DL_grp1__ (long ind, char *cbuf1, int mode, int iUpd)
 
int DL_grp1_set (long ind, int mode)
 
int DL_grp1_get (long dli)
 
int DL_grp1_copy ()
 
int DL_alloc__ (long Ind)
 
void DL_Init ()
 
int DL_GetAttNr ()
 
int AttLn_Get_ind (int *col, int *dash, int *thick, int ii)
 
int AttLn_Set1 (Att_ln *atto, int col, int dash, int thick)
 
int IndAttLn_get_ltyp (void *att1)
 
int IndAttLn_Set1 (Ind_Att_ln *att1, int ltyp, int lim)
 
int DL_AttLn_store (int attInd, Att_ln *atto)
 
void DL_InitAttTab ()
 
int DL_InitAttRec (int ind, int col, int typ, int thick)
 
int DL_Draw_obj (long dli, int typ, long dbi)
 
int DL_Redraw ()
 
int DL_SetLnr (long dli, long lNr)
 
int DL_SetInd (long dli)
 
int DL_SetObj (long *dli, int typ, long dbi, int iAtt)
 
long DL_StoreObj (int Typ, long DBInd, int AttInd)
 
int DL_DumpObj__ (long idl)
 
void DL_DumpObjTab ()
 
int DL_find_APPOBJ (long dbi, long att)
 
long DL_find_obj (int typ, long DBind, long DLend)
 
long DL_find_smObj (int typ, long DBind, long DLend, int imod)
 
int DL_GetTyp (long objInd)
 
long DL_get_dbi (long dli)
 
int DL_Get_oid_dli (char *oid, long dli)
 
int DL_Get_lNr_dli (long *lNr, long dli)
 
int DL_Get_dli_lNr (long *dli, long *lNr)
 
long DL_GetTrInd (long dli)
 
int DL_GetPick (long objInd)
 
int DL_set_iatt (long dli, unsigned long iatt)
 
unsigned long DL_get_iatt (long dli)
 
int DL_get_sStyl (long dli)
 
int DL_GetNrSur ()
 
int DL_GetNrSol ()
 
void DL_Lay_act_g1 (int layNr, int mode)
 
void DL_Lay_typ_g1 (int typ, int mode)
 
void DL_Lay_col_g1 (int col, int mode)
 
void DL_Lay_ltyp_g1 (int ltyp, int mode)
 
void DL_Lay_thk_g1 (int thk, int mode)
 
int DL_Lay_mod (int layNr, int func, int mode)
 
int DL_Lay_add (int layNr)
 
int DL_ReScale__ ()
 
int DL_ReScale_box (Point *pb1, Point *pb2)
 
int DL_ReScale_Notes (Point *pb1, Point *pb2)
 
int DL_parent_ck_p (long dli)
 
int DL_parent_ck_c (long dli)
 
int DL_parent_set (long lChild, long lPar)
 
int DL_parent_hide (long dli_par)
 
int DL_disp_reset (int lNr)
 
int DL_setRefSys (long dli)
 
int DL_get_dla (DL_Att *dla, long dli)
 
int DL_typ_is_visTyp (int typ)
 
long DL_get__ (DL_Att **dl)
 
int DL_disp_hili_last (int mode)
 
long DL_SetTmpObj (int typ, long dbi)
 

Variables

AP_STAT AP_stat
 
int WC_modact_ind
 
int WC_sur_ind
 Der Index auf die ActiveConstrPlane. More...
 
Plane WC_sur_act
 the active construction-plane More...
 
double WC_sur_Z
 active Z-value of WC_sur_sur; More...
 
double AP_txsiz
 Notes-Defaultsize. More...
 
double AP_txdimsiz
 Dimensions-Text-Defaultsize. More...
 
int AP_txNkNr
 Nachkommastellen. More...
 
ColRGB AP_defcol
 die DefaultColor des aktiven (sub)Model More...
 
double APT_ModSiz
 
int GR_pick
 
int GR_lay_act
 
int APT_line_act
 
int UP_level
 
int AP_mdLev
 
int APT_dispPT
 
int APT_dispPL
 
int GL_modified
 
double GR_tx_scale
 
DL_AttGR_ObjTab = NULL
 
long GR_TAB_SIZ = 0
 
long GR_TAB_INC = 10000
 
long GR_TAB_IND = 0
 
Att_ln GR_AttLnTab [GR_ATT_TAB_SIZ]
 
static int GR_AttInd =0
 
static double uxmin =0.
 
static double uymin =0.
 
static double uzmin =0.
 
static double uxmax
 
static double uymax
 
static double uzmax
 
static int DL_disp_act
 
long DL_ind_act =-1
 

Detailed Description

displayList functions

=====================================================
List_functions_start:
DL_InitAttTab load file ltyp.rc into GR_AttTab and create DL-record
DL_InitAttRec define a new lineattributeRecord
DL_alloc__ realloc space fuer BasModelnames
DL_AttLn_store store line-attribute in table GR_AttTab
AttLn_Set1 get line-attribute from 3 integers
AttLn_Get_ind get line-attribute from GR_AttLnTab-index
IndAttLn_Set1 set linetyp, limitTyp
IndAttLn_get_ltyp get linetyp
DL_Redraw redraw complete DL
DL_Draw_obj redraw single obj, use existing DL-record
DL_Stat ausgabe Statistik
DL_SetInd modify (do not create new DL-Record); set DL_ind_act=dli;
DL_SetObj get or set disp-list-record.
DL_StoreObj Den naechsten freien DispList-Platz belegen
DL_StoreAtt store GR_Att in GR_AttTab
DL_SetTmpObj store DL-record (only for active vector)
DL_hili_on set obj hilited
DL_hili_off reset hilited
DL_disp_hili_last (change) hilite last obj of DL
// DL_disp_hili hilite Obj of line lNr
DL_hide__ change hidden/visible for single obj
DL_hide_chg change hidden/visible for all objs
DL_hide_all change all active, visible objs to hidden|visible
DL_disp_def fuer alle nun folgenden Obj GR_ObjTab.disp=mode setzen
DL_hide_unvisTypes view or hide all joints,activities.
DL_disp_reset delete all DL-objects starting from line-nr
DL_unvis_set set visible / unvisible
DL_pick__ change all objects to pickable or unpickable
DL_parent_ck_c check if DL-record has a parent-object (check .sChd-Flag)
DL_parent_ck_p check if DL-record is a parent-object (check .sPar-Flag)
DL_grp1_set Zugehoerigkeit zu Group 1 setzen; ON od OFF
DL_grp1_get get grp_1-bit
DL_grp1__ add / remove (change) Groupbit 1 of DL-Record ind
DL_grp1_copy copy all DL-obj with groupBit ON --> GroupList
DL_dbi_is_visTyp test if typ == visual typ (VC is not)
DL_OBJ_IS_HIDDEN test if obj is hidden INLINE
DL_OBJ_IS_ACTMDL test if obj belongs to active model INLINE
DL_get__ returns DispList
DL_get_dla get DL-record (DL_Att from GR_ObjTab[objInd])
DL_get_dbi get DB-index from DL-Index
DL_Get_GrAtt get graf.Att (GR_Att from GR_AttTab[Ind])
DL_get_sStyl get surfaceStyle (shaded|symbolic)
DL_get_iatt returns iatt of DL-record
DL_set_iatt modify iatt of DL-record
DL_GetTyp get obj-typ from DL-ind
DL_Get_oid_dli get objName from DispListIndex
DL_Get_lNr_dli get sourceLineNumber from DispListIndex
DL_Get_dli_lNr get DispListIndex from sourceLineNumber
DL_GetTrInd get refSys-Index from dli
DL_GetNrSur get nr of surs in DispList
DL_find_smObj get dispListIndex of DB-obj from typ/dbi/subModelNr
DL_find_obj Objekt typ=typ APTind=ind in der DL suchen
DL_find_APPOBJ find applicationObject
DL_find_sel find selected object in DL
DL_Lay_act_g1 activate GroupBit1 des layer Nr. layNr
DL_Lay_typ_g1 grp_1 fuer alle Obj, die NICHT Typ i1 haben, auf OFF.
DL_Lay_col_g1 GroupBit1 mal f. alle Obj, die NICHT Farbe i1 haben, ON
DL_txtgetInfo Infos zu Tag/Image holen
DL_txtSelect check if TextTag was selcted and add obj to tables
DL_IactSelect check if Interactivity is connected
// DL_setTagSiz bei tags und Bitmaps die size im DL-record speichern
DL_sav_dynDat save the DYNAMIC_DATA of the actual mainModel
DL_load_dynDat reload the DYNAMIC_DATA
DL_ReScale_pt_get uxmin-uzmax erweitern um Box
DL_ReScalePoint
DL_ReScaleObj
List_functions_end:
=====================================================

Macro Definition Documentation

#define oaSIZ   10

Function Documentation

int DL_txtSelect ( int  iNr,
ObjDB **  dlTab 
)

check if TextTag was selcted and add obj to tables

int DL_IactSelect ( int  iNr,
ObjDB **  dlTab 
)

check if Interactivity is connected to one of the selected objects

int DL_Stat ( )

ausgabe Statistik

void DL_disp_def ( int  mode)
fuer alle nun folgenden Obj GR_ObjTab.disp=mode setzen.
Geht nur, wenn DispListIndex mit DL_StoreObj generiert wird !
int DL_wri_dynDat0 ( FILE *  fpo)

write :DYNAMIC_DATA

int DL_wri_dynDat1 ( FILE *  fpo)
write MODSIZ DEFTX DEFCOL VIEW CONST_PL :DYNAMIC_DATA
add :DYNAMIC_DATA without HIDE
void DL_hide__ ( long  ind,
int  mode 
)
DL_hide__ change hidden/visible for single obj
mode ON(0) set visible
OFF(1) set hidden
modify DL.disp, DL.hili
int DL_hide_all ( int  mode)
DL_hide_all change all active, visible objs to hidden|visible
mode 0 = hide_all; 1 = redisplay_all.
int DL_hide_chg ( )

DL_hide_chg change hidden/visible for all objs

int DL_disp_PL ( int  mode)
int DL_hide_unvisTypes ( int  mode)
int DL_unvis_set ( long  ind,
int  mode 
)
unvis: 0 = visible; 1 = obj is unvisible
set objects with no visual representation to unvisible;
eg joints, application-data, but not curves, surfaces, ..
int DL_hili_on ( long  ind)
DL_hili_on set obj hilited
ind >= 0: Hili Obj.
ind = -1: gesamte Hili-Tabelle loeschen
ind = -2: das zuletzt bearb. Elem. hiliten
RetCod:
-1 hidden object; not hilited ..
No Redraw !
Ein schon vorhandenes Objekt hiliten.
ObjID merken fuer Redraw.
Hier wird zusätzlich das DISP-Bit auf OFF gesetzt,
um das Obj nicht doppelt zu zeichnen.
int DL_hili_off ( long  ind)
DL_hili_off reset hilited
ind >= 0: unhilite single obj
ind = -1: unhilite all hilited objects
returns nr of hilited objs
ind = -2: das zuletzt bearb. Elem. unhiliten
No Redraw !
int DL_pick__ ( int  mode)
DL_pick__ change all objects to pickable or unpickable
pickable=1; unpickable=0.
int DL_pick_typ ( int  typ,
int  mode 
)
DL_pick_typ change pickability of all objects of typ <typ>
pickable=1; unpickable=0.
int DL_pick_set ( long  ind,
int  mode 
)
Selektierbarkeit; ON od OFF.
Default == pickable == 1; not pickable==0.
ind=-1: modify last object of DispList
int DL_grp1__ ( long  ind,
char *  cbuf1,
int  mode,
int  iUpd 
)
add / remove (change) Groupbit 1 of DL-Record ind
Input:
ind DispListIndex of obj
cbuf1 Infotext; NULL for silent
mode 0=switch; 1=add to group; -1=remove from group; 2=add all
iUpd 0=update display; 1=do not update display (yet)
int DL_grp1_set ( long  ind,
int  mode 
)
Zugehoerigkeit zu Group 1; ON od OFF.
Default == nicht_zugehoerig == OFF == 1; zugehoerig == ON == 0.
ind -1 all objects
int DL_grp1_get ( long  dli)
int DL_grp1_copy ( )

copy all DL-obj with groupBit ON –> GroupList.

int DL_alloc__ ( long  Ind)
realloc space fuer DL; wird nicht gesichert !
Ind = 0 Reset DL
Ind = 1 increase DL (add GR_TAB_INC elements)
Ind > 1 set size
void DL_Init ( )
int DL_GetAttNr ( )

Anzahl definierter Attribute

int AttLn_Get_ind ( int *  col,
int *  dash,
int *  thick,
int  ii 
)
AttLn_Get_ind get line-attribute from GR_AttLnTab-index
Input:
col 3 digits RGB
dash 0=full, 1=dash-dot, 2=shortDash, 3=longDash
thick 1-6, thickness in pixels
defaultvalues from ~/gCAD3D/cfg/ltyp.rc
int AttLn_Set1 ( Att_ln atto,
int  col,
int  dash,
int  thick 
)
AttLn_Set1 get line-attribute from 3 integers
Input:
col 3 digits RGB
dash 0=full, 1=dash-dot, 2=shortDash, 3=longDash
thick 1-6, thickness in pixels
defaultvalues from ~/gCAD3D/cfg/ltyp.rc
int IndAttLn_get_ltyp ( void *  att1)

IndAttLn_get_ltyp get linetyp

int IndAttLn_Set1 ( Ind_Att_ln att1,
int  ltyp,
int  lim 
)
IndAttLn_Set1 set linetyp, limitTyp
Input:
ltyp do not change if -1
lim do not change if -1
int DL_AttLn_store ( int  attInd,
Att_ln atto 
)

DL_AttLn_store store line-attribute in table GR_AttLnTab

void DL_InitAttTab ( )
DL_InitAttTab load file ltyp.rc into GR_AttLnTab and create DL-record
Create line-attributes. File is ~/gCAD3D/cfg/ltyp.rc
int DL_InitAttRec ( int  ind,
int  col,
int  typ,
int  thick 
)
DL_InitAttRec define a new lineattributeRecord
Input:
ind Recordnr; first=0; use as attInd in GL_DrawLine
col color 900=red, 090=green, 119=blue, 990=yellow
ltyp linetyp LTYP_.. (../ut/func_types.h)
0=full, 1=dash-dot, 2=shortDash, 3=longDash
lthick 1-6, thickness in pixels
defaultvalues from <tempDir>/cfg/ltyp.rc (../../gCAD3D/cfg/ltyp.rc)
int DL_Draw_obj ( long  dli,
int  typ,
long  dbi 
)
int DL_Redraw ( )
int DL_SetLnr ( long  dli,
long  lNr 
)

Overwrite the APT-LinNr bei Modify

int DL_SetInd ( long  dli)
-1 = default = create new DL-Record.
if(dli >= 0): DL_StoreObj does not creat new DL-Record !! (modify object)
DL_SetInd (-1L); // to reset (after GL_fix_DL_ind )
DL_StoreObj restores to -1
int DL_SetObj ( long *  dli,
int  typ,
long  dbi,
int  iAtt 
)
DL_SetObj get or set disp-list-record.
Input:
dli disp-list-record#; initialize with -1L.
if (dli < 0) - create new record (DL_StoreObj)
if (dli >= 0) - use the existing record (update obj)
typ,dbi,iAtt see DL_StoreObj
Output:
dli disp-list-record# >= 0
retCod 0 DL-record did already exist
1 new DL-record created
long DL_StoreObj ( int  Typ,
long  DBInd,
int  AttInd 
)
create new or overwrite DispList-record; returns its index.
(overwrite with DL_SetInd before)
Den naechsten freien DispList-Platz belegen mit Typ, DBInd, att ....
In der (hier lokalen) Displayliste, DBInd und Att speichern.
Wird benutzt von GL zum Redraw, beim Select.
if(DL_ind_act >= 0) use this (existing) DL-record; (preset with DL_SetInd)
Dynam. Objekte, die ueberhaupt nicht in der APT-DB gespeichert werden,
erhalten als DBInd den negativen DispList-Index.
Input:
DBInd 0 definiert temp. Obj 8 (returns -8L)
-1 temp. Obj m ind. -GR_TAB_IND
AttInd ? 2 ? 5 ?
Output:
RetCod DispListIndex dli
see also:
DL_SetInd preset DL-index (to modify DL-record)
int DL_DumpObj__ ( long  idl)

see GA_dump__

void DL_DumpObjTab ( )
int DL_find_APPOBJ ( long  dbi,
long  att 
)
long DL_find_obj ( int  typ,
long  DBind,
long  DLend 
)
get dispListIndex of (last) DB-obj from typ/dbi
Objekt typ=typ APTind=ind in der DL suchen.
liefert DisplayListIndex des letzen definierten Objekts
Hidden objects haben -1 !!
Input:
typ objTyp (Typ_PT ..)
DBind dataBaseIndex of obj to search
DLend last DL-Index to check; -1L = search in complete DL
retCode = DispListIndex
-1 Error; objID not found in DL
long DL_find_smObj ( int  typ,
long  DBind,
long  DLend,
int  imod 
)
get dispListIndex of (last) DB-obj from typ/dbi/subModelNr
Objekt typ=typ APTind=ind in der DL suchen.
liefert DisplayListIndex des letzen definierten Objekts
Hidden objects haben -1 !!
Input:
typ objTyp (Typ_PT ..)
DBind dataBaseIndex of obj to search
DLend last DL-Index to check; -1L = search in complete DL
retCode = DispListIndex
-1 Error; objID not found in DL
int DL_GetTyp ( long  objInd)

liefert den Typ eines DB-Obj (als return-Code)

long DL_get_dbi ( long  dli)
liefert den DB-index eines DB-Obj (als return-Code)
Input: dli; alle andern Out.
int DL_Get_oid_dli ( char *  oid,
long  dli 
)

DL_Get_oid_dli get objName from DispListIndex

int DL_Get_lNr_dli ( long *  lNr,
long  dli 
)
DL_Get_lNr_dli get source-lineNumber from DispListIndex
see AP_lNr_set
int DL_Get_dli_lNr ( long *  dli,
long *  lNr 
)
long DL_GetTrInd ( long  dli)

get the refsys-nr (dbi of Plane) for DL-record <dli>

int DL_GetPick ( long  objInd)
int DL_set_iatt ( long  dli,
unsigned long  iatt 
)
unsigned long DL_get_iatt ( long  dli)

returns iatt of DL-record

int DL_get_sStyl ( long  dli)
get surfaceStyle (shaded|symbolic) of DispListObj
return 0=shaded; 1=symbolic
int DL_GetNrSur ( )

DL_GetNrSur get nr of sur's in DispList

int DL_GetNrSol ( )

DL_GetNrSol get nr of sol's in DispList

void DL_Lay_act_g1 ( int  layNr,
int  mode 
)

activate GroupBit1 des layer Nr. layNr

void DL_Lay_typ_g1 ( int  typ,
int  mode 
)

grp_1 fuer alle Obj, die NICHT Typ i1 haben, auf OFF.

void DL_Lay_col_g1 ( int  col,
int  mode 
)
das GroupBit1 fuer alle Obj, die NICHT Farbe i1 haben, ON setzen.
mode unused
void DL_Lay_ltyp_g1 ( int  ltyp,
int  mode 
)

grp_1 fuer alle Obj, die NICHT ltyp i1 haben, auf OFF.

void DL_Lay_thk_g1 ( int  thk,
int  mode 
)

grp_1 fuer alle Obj, die NICHT Dicke i1 haben, auf OFF.

int DL_Lay_mod ( int  layNr,
int  func,
int  mode 
)
modify layer
layNr die Nr. des zu bearbeitenden Layers; -1 = alle Layers !
func ...
mode ON oder OFF; entspr. func.
int DL_Lay_add ( int  layNr)
int DL_ReScale__ ( )
int DL_ReScale_box ( Point pb1,
Point pb2 
)
int DL_ReScale_Notes ( Point pb1,
Point pb2 
)
Notes/Images: es sollten die Eckpunkte lu und ro generiert werden und
wie normale Punkte beruecksichtigt werden.
int DL_parent_ck_p ( long  dli)
int DL_parent_ck_c ( long  dli)
int DL_parent_set ( long  lChild,
long  lPar 
)
store childInfo, parentInfo in DL
int DL_parent_hide ( long  dli_par)

DL_parent_hide hide parent.

int DL_disp_reset ( int  lNr)
remove all display-objects following (including) APT-line-Nr <lNr>
alle Ausgabeobjekte der APT-Zeilen ab (inclusive) lNr loeschen
int DL_setRefSys ( long  dli)

RefSys entprechend DL-Record setzen

int DL_get_dla ( DL_Att dla,
long  dli 
)
DL_get_dla get DispList-record (DL_Att)
RetCod: 1 = OK
0 = ERROR
was DL_GetAtt
int DL_typ_is_visTyp ( int  typ)
DL_dbi_is_visTyp test if typ == visual typ (VC is not)
retCod: 1 yes, typ can have a DL-record;
0 no, typ cannot have a DL-record;
long DL_get__ ( DL_Att **  dl)

DL_get__ returns DispList

int DL_disp_hili_last ( int  mode)

DL_disp_hili_last hilite last obj of DL

long DL_SetTmpObj ( int  typ,
long  dbi 
)

Variable Documentation

AP_STAT AP_stat
int WC_modact_ind
int WC_sur_ind

Der Index auf die ActiveConstrPlane.

Plane WC_sur_act

the active construction-plane

double WC_sur_Z

active Z-value of WC_sur_sur;

double AP_txsiz

Notes-Defaultsize.

double AP_txdimsiz

Dimensions-Text-Defaultsize.

int AP_txNkNr

Nachkommastellen.

ColRGB AP_defcol

die DefaultColor des aktiven (sub)Model

double APT_ModSiz
int GR_pick
int GR_lay_act
int APT_line_act
int UP_level
int AP_mdLev
int APT_dispPT
int APT_dispPL
int GL_modified
double GR_tx_scale
DL_Att* GR_ObjTab = NULL
long GR_TAB_SIZ = 0
long GR_TAB_INC = 10000
long GR_TAB_IND = 0
Att_ln GR_AttLnTab[GR_ATT_TAB_SIZ]
int GR_AttInd =0
static
double uxmin =0.
static
double uymin =0.
static
double uzmin =0.
static
double uxmax
static
double uymax
static
double uzmax
static
int DL_disp_act
static
long DL_ind_act =-1