gCAD3D 2.40
ut_DB.c File Reference

database More...

#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../ut/ut_geo.h"
#include "../ut/ut_cast.h"
#include "../ut/ut_obj.h"
#include "../ut/ut_txt.h"
#include "../ut/ut_TX.h"
#include "../ut/ut_ox_base.h"
#include "../ut/ut_os.h"
#include "../ut/ut_gtypes.h"
#include "../gr/ut_gr.h"
#include "../gr/ut_DL.h"
#include "../db/ut_DB.h"

Data Structures

struct  DB_obj
 

Macros

#define APT_VR_INC   200
 
#define APT_PT_INC   5000
 
#define APT_VC_INC   2000
 
#define APT_LN_INC   5000
 
#define APT_CI_INC   2000
 
#define APT_PL_INC   500
 
#define APT_MR_INC   200
 
#define APT_TL_INC   200
 
#define APT_TR_INC   200
 
#define APT_CV_INC   2000
 
#define APT_TX_INC   2000
 
#define APT_SU_INC   2000
 
#define APT_SO_INC   2000
 
#define APT_AC_INC   50
 
#define DB_CINC   2000000
 memsiz for DB_CDAT (curves .. 2000000 More...
 
#define DB_MNM_INC   5000
 memsiz for mdb_nam (DB_allocModNam) More...
 
#define DYN_VR_INC   100
 
#define DYN_PT_INC   5000
 
#define DYN_VC_INC   1000
 
#define DYN_LN_INC   1000
 
#define DYN_CI_INC   1000
 
#define DYN_PL_INC   500
 
#define DYN_CV_INC   1000
 
#define DYN_SU_INC   1000
 
#define DYN_TX_INC   1000
 
#define DYN_MB_INC   100
 
#define MNOD_INC   100
 

Functions

int DB_test__ ()
 
void DB_fix_tol (double scale)
 
int DB_dump_stat ()
 
void DB_Stat ()
 
int DB_size_set (long *lTab)
 
void DB_Init (int mode)
 
int DB_save__ (char *mNam)
 
int DB_load__ (char *mNam)
 
PointDB_get_PT (long Ind)
 
LineDB_get_LN (long Ind)
 
VectorDB_get_VC (long Ind)
 
CircDB_get_CI (long Ind)
 
PlaneDB_get_PLN (long Ind)
 
int DB_get_typ_cv (long Ind)
 
void * DB_get_CV (int *ityp, long Ind)
 
ObjGX DB_GetObjGX (int typ, long apt_ind)
 
int DB_GetObjDat (void **pDat, int *oNr, int dbTyp, long dbInd)
 
long DB_GetDynInd (int typ)
 
ObjGXDB_GetGTxt (long Ind)
 
long DB_StoreImg (long Ind, AText *oi)
 
long DB_StoreDim_ (long Ind, Dimen *dim1)
 
long DB_StoreDim3 (long Ind, Dim3 *dim3)
 
long DB_StoreATxt (long Ind, AText *atx1)
 
long DB_StoreGTxt (long Ind, GText *gtx1)
 
long DB_StoreVar (long Ind, double d1)
 
double * DB_get_Var (long Ind)
 
double DB_GetVar (long Ind)
 
int DB_CkRef (long Ind)
 
long DB_StoreRef (long Ind, Plane *pl1)
 
PlaneDB_DefRef (long Ind)
 
void DB_GetRef (Plane *pl1, long Ind)
 
ObjGXDB_GetSol (long Ind)
 
int DB_StoreSol (long *dbi, ObjGX *bd1)
 
int DB_StoreDummy (int typ, long Ind)
 
long DB_StoreSurBsp (long Ind, SurBSpl *si)
 
long DB_StoreSurStripe (long Ind, SurStripe *si)
 
long DB_StoreSurRBsp (long Ind, SurRBSpl *si)
 
long DB_StoreSurRV (long Ind, SurRev *si)
 
int DB_StoreSur (long *IndIn, ObjGX *ox1)
 
ObjGXDB_GetSur (long Ind, int mode)
 
int DB_StoreModel (long Ind, ObjGX *md1)
 
int DB_del_Mod__ ()
 
ModelRefDB_get_ModRef (long Ind)
 
int DB_dump_Activ ()
 
int DB_dump_f (FILE *fpo, int typ)
 
long DB_dyn__ (int mode, int typ, long ind)
 
int DB_dump_dyn__ (int typ)
 
int DB_dump__ ()
 
int DB_dump_ModBas ()
 
int DB_dump_ModRef ()
 
char * DB_mdlNam_iBas (int bmNr)
 
int DB_mdlNam_iRef (char **mdlNam, long dbi)
 
int DB_mdlTyp_iBas (int *mdlTyp, int mbNr)
 
int DB_mdlTyp_iRef (int *mdlTyp, long dbi)
 
int DB_ModBas_seqMax ()
 
int DB_list_ModBas ()
 
int DB_del_ModBas (long ind)
 
int DB_allocModNod ()
 
int DB_StoreModNod (int mod, int par, long ind)
 
ModelNodeDB_get_ModNod (int ind)
 
int DB_dump_ModNod ()
 
int DB_ModNod_ckLoop1 (int ibm, int errbm)
 
int DB_ModNod_ckLoop_ (int ii)
 
int DB_ModNod_ckLoaf_ (int ii)
 
int DB_StoreModBas (int mdlTyp, char *newNam)
 
ModelBasDB_get_ModBas (int Ind)
 
int DB_get_ModBasNr ()
 
int DB_get_iModBas_iModRef (long iModRef)
 
int DB_get_ModNr (char *modNam)
 
long DB_FindVector (Vector *vc1)
 
long DB_StoreVector (long Ind, Vector *vc1)
 
int DB_allocVAR (long Ind)
 
int DB_allocPoint (long Ind)
 
int DB_allocVector (long Ind)
 
int DB_allocLine (long Ind)
 
int DB_allocCirc (long Ind)
 
int DB_allocRef (long Ind)
 
int DB_allocModRef (long Ind)
 
int DB_allocModNam (long Ind)
 
int DB_allocModBas (long Ind)
 
int DB_allocTra (long Ind)
 
int DB_allocCurve (long Ind)
 
int DB_allocNote (long Ind)
 
int DB_allocSur (long Ind)
 
int DB_allocSol (long Ind)
 
int DB_allocAct (long Ind)
 
int DB_allocDynVAR (long Ind)
 
int DB_allocDynPoint (long Ind)
 
int DB_allocDynVector (long Ind)
 
int DB_allocDynLine (long Ind)
 
int DB_allocDynCirc (long Ind)
 
int DB_allocDynPlane (long Ind)
 
int DB_allocDynCurve (long Ind)
 
int DB_allocDynSur (long Ind)
 
int DB_allocDynNote (long Ind)
 
int DB_set_state (int mode)
 
int DB_CSEG__ (int mode)
 
int DB_CSEG_ck ()
 
int DB_allocCDAT (long Ind)
 
long DB_StorePoint (long Ind, Point *pt1)
 
Vector DB_GetVector (long Ind)
 
Point DB_GetPoint (long Ind)
 
long DB_StoreLine (long Ind, Line *ln1)
 
Line DB_GetLine (long Ind)
 
long DB_StoreCirc (long Ind, Circ *ci1)
 
Circ DB_GetCirc (long Ind)
 
int DB_Error (int typ)
 
void * DB_cPos ()
 
void * DB_cSav (long size, void *data)
 
void * DB_cGet (void *data, void *pos, long size)
 
long DB_Store_hdr_so (ObjGX **oxo, int typ, int form, int siz, long ind)
 
long DB_Store_hdr_su (ObjGX **oxo, long Ind)
 
long DB_Store_hdr_cv (ObjGX **cvo, long Ind)
 
long DB_Store_hdr_nt (ObjGX **txo, long Ind)
 
long DB_StoreClot (long Ind, CurvClot *cvCl)
 
long DB_StoreCvBsp (long Ind, CurvBSpl *cvbsp)
 
long DB_StoreCvRBsp (long Ind, CurvRBSpl *cvbsp)
 
long DB_StoreCvPlg (long Ind, CurvPoly *cvplg, int iNew)
 
long DB_StoreCvCCV (long Ind, CurvCCV *cvi, int iNr)
 
long DB_StoreCvEll (long Ind, CurvPoly *cvell)
 
long DB_StoreCurv (long Ind, ObjGX *cv1, int iNew)
 
ObjGXDB_GetCurv (long Ind)
 
int DB_StoreTra (long Ind, ObjGX *ox1)
 
ObjGXDB_GetTra (long Ind)
 
ActivityDB_get_Activ (long Ind)
 
int DB_StoreActiv (long Ind, Activity *data)
 
int DB_StoreJointNr (int jntNr)
 
int DB_GetConnObj (int *typ1, long *ind1, int *typ2, long *ind2, Point2 *pt1)
 
long DB_GetObjTyp2Pt (int *typ, Point2 *pt1, Point2 *pt2)
 
int DB_Query_siz (long *cSiz)
 
int DB_QueryDef (int typ, long ind)
 
long DB_dbo_get_free (int typ)
 
long DB_QueryPrvUsed (int typ, long istart)
 
long DB_QueryNxtUsed (int typ, long istart)
 
int DB_Query__ (void **oTab, long *indLast, long *indMax, int typ)
 
long DB_QueryNxtFree (int typ, int istart)
 
long DB_QueryPoint (Point *pt1)
 
long DB_QueryLine (Point *pt1)
 
long DB_QueryCirc (Point *pt1)
 
long DB_QueryCurv (Point *pt1)
 
int DB_Filter__ (ObjDB *grp, int *grpNr, ObjGX *flt, int fltNr)
 
int DB_QueryActiv (Activity **act, int typ, long ind)
 
void DB_Delete (int typ, long ind)
 
int DB_store_obj (ObjGX *oxo, ObjGX *ox1, long *ind)
 
int DB_store_stru (void **oo, int typ, int form, void *os1, int iNr, long *ind)
 
int DB_get_ObjNr (int typ)
 
int DB_VC_isFree (long dbi)
 
int DB_PLN_isFree (long dbi)
 

Variables

double AP_txsiz
 Notes-Defaultsize. More...
 
double AP_txdimsiz
 Dimensions-Text-size. More...
 
int AP_txNkNr
 Nachkommastellen. More...
 
ColRGB AP_defcol
 die DefaultColor des aktiven (sub)Model More...
 
Point AP_box_pm1
 
Point AP_box_pm2
 
int WC_sur_ind
 Index auf die ActiveConstrPlane. More...
 
Plane WC_sur_act
 die aktive Plane More...
 
Mat_4x3 WC_sur_mat
 TrMat of ActiveConstrPlane. More...
 
Mat_4x3 WC_sur_imat
 inverse TrMat of ActiveConstrPlane More...
 
ObjAttGA_ObjTab
 
int GA_recNr
 
double GR_tx_scale
 
double APT_ModSiz
 
long APT_VR_SIZ
 
long APT_VR_IND =0
 APT_.._IND: der letzte belegte Index ! More...
 
long APT_PT_SIZ
 
long APT_PT_IND =0
 
long APT_VC_SIZ
 
long APT_VC_IND =0
 
long APT_LN_SIZ
 
long APT_LN_IND =0
 
long APT_CI_SIZ
 
long APT_CI_IND =0
 
long APT_PL_SIZ
 
long APT_PL_IND =0
 
long APT_MR_SIZ
 
long APT_MR_IND =0
 
long APT_TR_SIZ
 
long APT_TR_IND =0
 
long APT_CV_SIZ
 
long APT_CV_IND =0
 
long APT_TX_SIZ
 
long APT_TX_IND =0
 
long APT_SU_SIZ
 
long APT_SU_IND =0
 
long APT_SO_SIZ
 
long APT_SO_IND =0
 
long APT_AC_SIZ
 
long APT_AC_IND =0
 
long DB_MNM_SIZ
 
long APT_MN_IND =0
 
long DB_CSIZ
 
static long DYN_VR_SIZ =0
 
static long DYN_VR_IND =0
 
static long DYN_PT_SIZ =0
 
static long DYN_PT_IND =0
 
static long DYN_VC_SIZ =0
 
static long DYN_VC_IND =0
 
static long DYN_LN_SIZ =0
 
static long DYN_LN_IND =0
 
static long DYN_CI_SIZ =0
 
static long DYN_CI_IND =0
 
static long DYN_PL_SIZ =0
 
static long DYN_PL_IND =0
 
static long DYN_CV_SIZ =0
 
static long DYN_CV_IND =0
 
static long DYN_SU_SIZ =0
 
static long DYN_SU_IND =0
 
static long DYN_TX_SIZ =0
 
static long DYN_TX_IND =0
 
static long DYN_MB_SIZ =0
 
static long DYN_MB_IND =0
 
static long DB_MNM_IND =0
 
static int DB_JNT_IND =0
 
static double * vr_tab = NULL
 
static double * vr_dyn = NULL
 
static Pointpt_tab = NULL
 
static Pointpt_dyn = NULL
 
static Vectorvc_tab = NULL
 
static Vectorvc_dyn = NULL
 
static Lineln_tab = NULL
 
static Lineln_dyn = NULL
 
static Circci_tab = NULL
 
static Circci_dyn = NULL
 
static Planepln_tab = NULL
 
static Planepln_dyn = NULL
 
static ModelRefmdr_tab = NULL
 
static ModelBasmdb_dyn = NULL
 
static char * mdb_nam = NULL
 
static Activityac_tab = NULL
 
static ObjGXtra_tab = NULL
 
static ObjGXcv_tab = NULL
 
static ObjGXcv_dyn = NULL
 
static ObjGXsu_tab = NULL
 
static ObjGXsu_dyn = NULL
 
static ObjGXso_tab = NULL
 
static ObjGXtx_tab = NULL
 
static ObjGXtx_dyn = NULL
 
static Memspc DB_CSEG
 
static char * DB_CDAT = NULL
 
static ModelNodemNod = NULL
 
static int MNOD_SIZ = 0
 
static int MNOD_IND = 0
 
double DB_sel_tol = 2.5
 
double DB_sel_tol_fakt = 2.5
 
Point DB_pt0
 
Vector DB_vc0
 

Detailed Description

database

=====================================================
List_functions_start:
DB_Stat display statistic
DB_dump__ dump complete DB
DB_dump_dyn__ dump all dynamic objects of type<typ>
DB_dump_f dump all objects of type<typ> into open file
DB_dump_Activ dump all activities
DB_save__ gesamte DB -> Datei raus
DB_load__ gesamte DB aus Datei einlesen
DB_dyn__ get/(re)set dynamic space for <typ>
DB_GetVar get var ((double)"V")
DB_get_Var get *double ((double)"V")
DB_GetRef get Plane (RefSys)
DB_DefRef das Defaultrefsys (RX/RY/RZ) liefern
DB_get_typ_cv get form of Curve
DB_get_CV get form and struct of Curve ((ObjGX*)"S")
DB_GetCurv get *Curve ((ObjGX*)"S",cv_tab/cv_dyn)
DB_GetGTxt get *Text ((ObjGX*)"N")
DB_GetSur get Surf ((ObjGX*)"A")
DB_GetTra get Transformation ((ObjGX*)"T")
DB_GetTool get Tool ((BTool*),"?",tl_tab)
DB_GetObjGX get obj (ObjGX)
DB_GetObjDat get data-struct from typ, DB-index
DB_store_obj call DB_StoreXX with ObjGX
DB_store_stru call DB_StoreXX with structTyp,struct
DB_StoreObjGX
DB_StoreImg store BMP-Bitmap (AText)
// DB_StoreTex store Texture
DB_StoreRef store Plane "R" (RefSys)
DB_StoreTool tl_tab
DB_StoreJointNr report last used jointNr
DB_StoreModel store subModel-Reference (Ditto); mdr_tab
DB_get_ModRef get Ditto from Index
DB_del_Mod__ delete Dittos und BasicModels
DB_StoreModBas store subModel; (Detail); mdb_dyn
DB_get_iModBas_iModRef get basic-ModelNr from the ReferenceModelNr
DB_get_ModBas get subModel from Index
DB_get_ModBasNr get nr of defined subModels
DB_get_ModNr get ModelNr from Modelname
DB_list_ModBas Modelnames in korrekter Reihenfolge -> Datei
DB_ModBas_seqMax get highest seqNr
DB_mdlNam_iBas get the name of a basic-model from its basicModelNr
DB_mdlNam_iRef get Modelname from DB-index of the Modelreference
DB_mdlTyp_iBas get Modeltyp from its basicModelNr
DB_mdlTyp_iRef get Modeltyp from DB-index of the Modelreference
DB_StoreModNod Model-Node (basicModelIndex+parentbasicModelIndex+DB-index)
DB_ModNod_ckLoop_ check for call itsef
DB_ModNod_ckLoaf_ not yet done ..
DB_Store_hdr_cv Curve-Header speichern
DB_Store_hdr_su Surf.-Header speichern
DB_Store_hdr_nt Note-Header speichern
DB_Filter__ get list of filtered DB-objects
DB_QueryPoint search Point in DB
DB_CkRef check if Trfsys[Ind] is defined.
DB_CheckInd unused
DB_Get_GR_Obj read &transform obj ???
DB_GetDynInd get next dyn. Index
DB_get_ObjNr get nr of defined objects of given type
DB_QueryDef check if obj is defined in DB;
DB_dbo_get_free get next free index
DB_QueryNxtFree get next free index from typ,startIndex
DB_QueryNxtUsed get next used index
DB_QueryPrvUsed get previous used index
DB_Query__ get dataTable, lastIndex, tabSiz from typ
DB_Delete delete obj in DB (set Free)
DB_setFree_Var kill DB-obj; other objects DB_setFree_..
DB_set_state save/restore all saved DB-Pointers (kill newer objects)
DB_CSEG__ reset DB_CSEG after use for temporary objects.
DB_CSEG_ck testen, ob noch mind 25 K in CDAT frei sind;
DB_allocTool
List_functions_end:
=====================================================

Macro Definition Documentation

#define APT_VR_INC   200
#define APT_PT_INC   5000
#define APT_VC_INC   2000
#define APT_LN_INC   5000
#define APT_CI_INC   2000
#define APT_PL_INC   500
#define APT_MR_INC   200
#define APT_TL_INC   200
#define APT_TR_INC   200
#define APT_CV_INC   2000
#define APT_TX_INC   2000
#define APT_SU_INC   2000
#define APT_SO_INC   2000
#define APT_AC_INC   50
#define DB_CINC   2000000

memsiz for DB_CDAT (curves .. 2000000

#define DB_MNM_INC   5000

memsiz for mdb_nam (DB_allocModNam)

#define DYN_VR_INC   100
#define DYN_PT_INC   5000
#define DYN_VC_INC   1000
#define DYN_LN_INC   1000
#define DYN_CI_INC   1000
#define DYN_PL_INC   500
#define DYN_CV_INC   1000
#define DYN_SU_INC   1000
#define DYN_TX_INC   1000
#define DYN_MB_INC   100
#define MNOD_INC   100

Function Documentation

int DB_test__ ( )
void DB_fix_tol ( double  scale)
int DB_dump_stat ( )
void DB_Stat ( )
int DB_size_set ( long *  lTab)
void DB_Init ( int  mode)

mode=0: komplettes Init (alles) mode=1: alles ausser basicModels initialisieren mode=2: nur dyn-objects resetten

int DB_save__ ( char *  mNam)

gesamte DB -> Datei raus

int DB_load__ ( char *  mNam)

gesamte DB aus Datei einlesen

Point* DB_get_PT ( long  Ind)
* returns pointer to point
* copy PT mit DB_GetPoint
*
Line* DB_get_LN ( long  Ind)

copy: DB_GetLine

Vector* DB_get_VC ( long  Ind)

copy: DB_GetVector

Circ* DB_get_CI ( long  Ind)

copy: DB_GetCirc

Plane* DB_get_PLN ( long  Ind)
* es gibt keine dyn planes !
* see DB_GetRef
*
int DB_get_typ_cv ( long  Ind)
void* DB_get_CV ( int *  ityp,
long  Ind 
)
* returns form and struct of Curve BUT NOT ITS PRIMARY OBJECT !
* Out:
* ityp <-- oGX[Ind].form (od Typ_CVTRM bei Typ_ObjGX)
* retVal <-- oGX[Ind].data (also die struct !!!
*
* see also DB_GetCurv (returns the primary obj (ObjGX))
*
ObjGX DB_GetObjGX ( int  typ,
long  apt_ind 
)
* Returns a ObjGX of any object stored in DB;
* Does NOT resolve objRefs (Typ_Index).
* DB_GetObjGX get complexObj from DB-Obj Keep Refs. Give ObjGX.
*
* Liefert einen ObjGX-Record von jedem DB-Obj.
* Error: o.typ == Typ_Error;
*
* get datastruct of DB-obj: see DB_GetObjDat or UTO_obj_getp
*
int DB_GetObjDat ( void **  pDat,
int *  oNr,
int  dbTyp,
long  dbInd 
)
* DB_GetObjDat get data-struct from typ, DB-index
* Returns a pointer to the data-struct.
* Referenced objects (Typ_Index) are resolved.
* Surfaces/Solids: retCod = typ_ObjGX; *pDat = the address of the primary obj.
*
* Output:
* pDat pointer to dataStruct of DB-Obj dbTyp/dbInd
* oNr nr of structs of type <Retcode>
* Retcode type of datastruct pDat
* Typ_Error (0) obj unused
* -1 UTO_obj_getp - error
*
* see also DB_GetObjGX UTO_obj_getp ....
*
long DB_GetDynInd ( int  typ)
* returns next free dynamic object-Index for typ (negative)
*
ObjGX* DB_GetGTxt ( long  Ind)

get Note (GText, AText, Dimen, tag, Image ..)

long DB_StoreImg ( long  Ind,
AText oi 
)
long DB_StoreDim_ ( long  Ind,
Dimen dim1 
)
long DB_StoreDim3 ( long  Ind,
Dim3 dim3 
)
long DB_StoreATxt ( long  Ind,
AText atx1 
)
long DB_StoreGTxt ( long  Ind,
GText gtx1 
)
long DB_StoreVar ( long  Ind,
double  d1 
)
double* DB_get_Var ( long  Ind)
double DB_GetVar ( long  Ind)
int DB_CkRef ( long  Ind)
* check if Trfsys[Ind] is defined.
* RC=0; jes is defined.
* RC=-1: no not defined.
* RC=-2: no Ind out of range
*
long DB_StoreRef ( long  Ind,
Plane pl1 
)
Plane* DB_DefRef ( long  Ind)
* create defaultPlanes in DB
* Input:
* Ind 0 create all defaultPlanes
* <0 return Plane
*
void DB_GetRef ( Plane pl1,
long  Ind 
)
* get a copy of a plane
*
ObjGX* DB_GetSol ( long  Ind)
int DB_StoreSol ( long *  dbi,
ObjGX bd1 
)
int DB_StoreDummy ( int  typ,
long  Ind 
)

occupy

long DB_StoreSurBsp ( long  Ind,
SurBSpl si 
)

save RevSur s1 –> su_tab[Ind], Daten nach DB_CSEG.

long DB_StoreSurStripe ( long  Ind,
SurStripe si 
)

save Rat.BspSur s1 –> su_tab[Ind], Daten nach DB_CSEG.

long DB_StoreSurRBsp ( long  Ind,
SurRBSpl si 
)

save Rat.BspSur s1 –> su_tab[Ind], Daten nach DB_CSEG.

long DB_StoreSurRV ( long  Ind,
SurRev si 
)

save RevSur s1 –> su_tab[Ind], Daten nach DB_CSEG.

int DB_StoreSur ( long *  IndIn,
ObjGX ox1 
)
* CIR u STRIP-Flaeche kommt als Punktindextabelle (von Dreiecken).
* Punkte als dynam. Punkte speichern.
*
ObjGX* DB_GetSur ( long  Ind,
int  mode 
)
* mode=0: silent; do not display Errors
* mode=1: display Errors
* Error (surf not defined): (ObjGX*)->typ == Typ_Error) !
*
int DB_StoreModel ( long  Ind,
ObjGX md1 
)

keine dynam. models

int DB_del_Mod__ ( )

DB_del_Mod delete Dittos und BasicModels

ModelRef* DB_get_ModRef ( long  Ind)

DB_get_ModRef get Ditto from Index

int DB_dump_Activ ( )

DB_dump_Activ dump all activities

int DB_dump_f ( FILE *  fpo,
int  typ 
)
* dump all objects of type<typ> into open file
* see also UT3D_dump_dbo
*
long DB_dyn__ ( int  mode,
int  typ,
long  ind 
)
* DB_dyn__ get/(re)set dynamic space for <typ>
* Input:
* mode 0=save DYN_<typ>_SIZ here and return pointer
* 1=(re)set from local stored
* 2=(re)set pointer to <ind> (not for Typ_goGeom)
* typ Typ_VC|Typ_PT|Typ_LN|Typ_CI|Typ_goGeom
* ind only for mode=2
*
int DB_dump_dyn__ ( int  typ)
int DB_dump__ ( )

dump complete DB

int DB_dump_ModBas ( )

dump basic-models mdb_dyn

int DB_dump_ModRef ( )
char* DB_mdlNam_iBas ( int  bmNr)

DB_mdlNam_iBas get the name of a basic-model from its basicModelNr Input: bmNr nr of its basic-model

int DB_mdlNam_iRef ( char **  mdlNam,
long  dbi 
)

get Modelname from DB-index of the Modelreference returns a pointer to the modelname ..

int DB_mdlTyp_iBas ( int *  mdlTyp,
int  mbNr 
)
int DB_mdlTyp_iRef ( int *  mdlTyp,
long  dbi 
)
int DB_ModBas_seqMax ( )

DB_ModBas_seqMax get highest seqNr

int DB_list_ModBas ( )
* in BasicModels gibts Reihenfolgenummer seqNr.
* Diese in korrekter Reihenfolge -> Datei <tmpdir>/Mod.lst ausgeben.
* irc: Anzahl Models; (<0: Error).
*
int DB_del_ModBas ( long  ind)
* DL-Record ind und alle folgenden werden geloescht.
* Das GL_Delete loescht auch BaseModels.
*
int DB_allocModNod ( )
int DB_StoreModNod ( int  mod,
int  par,
long  ind 
)
* mNod is a list of all submodels of the active-model. Permanent.
* Diese Liste ist so wie die basicModels permanent und hat je einen record
* fuer jedes Ditto; die refModels gibt es nur fuer das aktive submodel.
* mod der basicModelIndex
* par der parent - basicModelIndex
* ind der ref.ModelIndex (= DB-index)
*
ModelNode* DB_get_ModNod ( int  ind)
int DB_dump_ModNod ( )
int DB_ModNod_ckLoop1 ( int  ibm,
int  errbm 
)
int DB_ModNod_ckLoop_ ( int  ii)
* den aktuellen Zweig scannen, ob das Model schon vorkommt (Loop !)
* parNr ist der NODE-Index des subModel, in dem mNam gerufen wird.
*
int DB_ModNod_ckLoaf_ ( int  ii)
int DB_StoreModBas ( int  mdlTyp,
char *  newNam 
)
* check if SubModel exists. If not: create a new mdb_dyn-Record.
* Add libpath, Filename oder name of internal Model to ModNamTab.
* Add name also to mdb_dyn (if not yet present).
*
* Input:
* newNam modelName; NULL=delete all basicModels and modelNames
* mdlTyp 0: reset den Name-Buffer (init/delete)
* -2 = catalog-model
* 1 = internal model
* 2 = external model
* 3 = MockupModel
* 4 = Image-BMP
* Output:
* RC = ModelNumber; -1 = Error.
*
ModelBas* DB_get_ModBas ( int  Ind)
* get the basicModel with index <Ind>
* get Ing eg from ModelRef.modNr
*
int DB_get_ModBasNr ( )

get nr of basic models

int DB_get_iModBas_iModRef ( long  iModRef)
* get basic-ModelNr from the ReferenceModelNr
* RC >= 0: ModelNr; Model is already loaded.
* RC = -1: Model not yet loaded ..
*
int DB_get_ModNr ( char *  modNam)
* get basic-ModelNr from Modelname (of Refeference)
* Modelname eg "M20"
* RC >= 0: ModelNr; Model is already loaded.
* RC = -1: Model not yet loaded ..
*
long DB_FindVector ( Vector vc1)
long DB_StoreVector ( long  Ind,
Vector vc1 
)
int DB_allocVAR ( long  Ind)
int DB_allocPoint ( long  Ind)
int DB_allocVector ( long  Ind)
int DB_allocLine ( long  Ind)
int DB_allocCirc ( long  Ind)
int DB_allocRef ( long  Ind)
int DB_allocModRef ( long  Ind)
int DB_allocModNam ( long  Ind)
int DB_allocModBas ( long  Ind)
int DB_allocTra ( long  Ind)
int DB_allocCurve ( long  Ind)
int DB_allocNote ( long  Ind)
int DB_allocSur ( long  Ind)
int DB_allocSol ( long  Ind)
int DB_allocAct ( long  Ind)
int DB_allocDynVAR ( long  Ind)
int DB_allocDynPoint ( long  Ind)
int DB_allocDynVector ( long  Ind)
int DB_allocDynLine ( long  Ind)
int DB_allocDynCirc ( long  Ind)
int DB_allocDynPlane ( long  Ind)
int DB_allocDynCurve ( long  Ind)
int DB_allocDynSur ( long  Ind)
int DB_allocDynNote ( long  Ind)
int DB_set_state ( int  mode)
* DB_set_state save/restore all saved DB-Pointers (kill newer objects)
* mode=0 save all pointers
* mode=1 restore all pointers (kill newer objects)
*
int DB_CSEG__ ( int  mode)
int DB_CSEG_ck ( )
* testen, ob noch mind 25 K in CDAT frei sind;
* wenn nein: realloc UND stop !
* RC = 0: genug Platz vorhanden ...
* RC = -1: realloc done, restart.
*
int DB_allocCDAT ( long  Ind)
* realloc DB_CDAT
* Ind = 0 Init / reInit mit Mind.Siz = DB_CINC
* Ind = 1 increase um DB_CINC
* Ind > 1 make Mind.Siz = Ind
*
long DB_StorePoint ( long  Ind,
Point pt1 
)
Vector DB_GetVector ( long  Ind)

DB_get_VC

Point DB_GetPoint ( long  Ind)
* returns point.
* get pointer with DB_get_PT
*
long DB_StoreLine ( long  Ind,
Line ln1 
)
* create DB-record for line
* Input:
* Ind dbi; -1 get dynamic-obj-index;
* >=0 overwrite existing DB-record
* Output:
* RetCod dbi (negative for dynamic obj)
*
Line DB_GetLine ( long  Ind)
long DB_StoreCirc ( long  Ind,
Circ ci1 
)
Circ DB_GetCirc ( long  Ind)
int DB_Error ( int  typ)
void* DB_cPos ( )
void* DB_cSav ( long  size,
void *  data 
)
* <size> Bytes aus data nach DB_CDAT speichern.
* Output:
* RetCod: the position in DB_CDAT AFTER storage (unlike UME_save !)
* NULL is Error !
* Get active position with DB_cPos();
*
void* DB_cGet ( void *  data,
void *  pos,
long  size 
)

returns newPos = pos + size

long DB_Store_hdr_so ( ObjGX **  oxo,
int  typ,
int  form,
int  siz,
long  ind 
)

get index for solid AND store parent-record

long DB_Store_hdr_su ( ObjGX **  oxo,
long  Ind 
)

get surf-Index/Parent-obj Output: oxo pointer into su_dyn|su_tab for surface A<Ind> RetCod: index into su_dyn|su_tab

long DB_Store_hdr_cv ( ObjGX **  cvo,
long  Ind 
)
long DB_Store_hdr_nt ( ObjGX **  txo,
long  Ind 
)
long DB_StoreClot ( long  Ind,
CurvClot cvCl 
)
long DB_StoreCvBsp ( long  Ind,
CurvBSpl cvbsp 
)
long DB_StoreCvRBsp ( long  Ind,
CurvRBSpl cvbsp 
)
long DB_StoreCvPlg ( long  Ind,
CurvPoly cvplg,
int  iNew 
)
long DB_StoreCvCCV ( long  Ind,
CurvCCV cvi,
int  iNr 
)
long DB_StoreCvEll ( long  Ind,
CurvPoly cvell 
)
long DB_StoreCurv ( long  Ind,
ObjGX cv1,
int  iNew 
)
*
* Input:
* Ind 0 = used for temp.object (in statu nascendi, design-process)
* -1 get new dynamic cv
* >0 normal
* iNew = 0 new data; save curve & Dataspace
* 1 Derived (copied) curve; do not save curve and dataspace
* 2 trimmed curve; do not save dataspace (only ObjGX-Rec.i and curve)
* Derived used by CUT ..
* RetCod: DB-Index
*
ObjGX* DB_GetCurv ( long  Ind)

see also DB_get_CV

int DB_StoreTra ( long  Ind,
ObjGX ox1 
)
ObjGX* DB_GetTra ( long  Ind)

rc = -1 = Fehler (undefined ...)

Activity* DB_get_Activ ( long  Ind)
int DB_StoreActiv ( long  Ind,
Activity data 
)

DB_StoreActiv save Activity

int DB_StoreJointNr ( int  jntNr)
int DB_GetConnObj ( int *  typ1,
long *  ind1,
int *  typ2,
long *  ind2,
Point2 pt1 
)
* Jene Elemente suchen und Typ und Index ausgeben,
* deren Endpunkte auf pt1 liegen.
*
* RetCode: Anzahl der gefundenen Elemente; 0=nix,
* 1 = ein Obj, Ind out in ind_1
* 2 = zwei Obj, in ind_1 und ind_2
* 3 oder mehr möglich !
*
long DB_GetObjTyp2Pt ( int *  typ,
Point2 pt1,
Point2 pt2 
)
* Jenes Element vom Typ typ suchen, dess Endpunkte pt1 / pt2 sind.
* Output:
* RetCode: der Index; -1 = nix gefunden.
* typ
*
int DB_Query_siz ( long *  cSiz)
int DB_QueryDef ( int  typ,
long  ind 
)
* check if obj is defined in DB;
* RetCod
* 0 = jes, OK
* -1 = obj undefined.
*
long DB_dbo_get_free ( int  typ)
* returns next free DB-index
*
long DB_QueryPrvUsed ( int  typ,
long  istart 
)
* DB_QueryPrvUsed get previous used index
* RetCode:
* 0 Error; no obj with index istart or higher exists
* >0 index of existing obj. Is equal to istart or higher.
*
long DB_QueryNxtUsed ( int  typ,
long  istart 
)
* DB_QueryNxtUsed get next used DB-index, starting from istart
* RetCode:
* 0 Error; no obj with index istart or higher exists
* >0 index of existing obj. Is equal to istart or higher.
*
int DB_Query__ ( void **  oTab,
long *  indLast,
long *  indMax,
int  typ 
)
long DB_QueryNxtFree ( int  typ,
int  istart 
)
* returns next free index
* search free record starting from istart up to last active index.
* see also DB_dbo_get_free
*
long DB_QueryPoint ( Point pt1)
long DB_QueryLine ( Point pt1)
long DB_QueryCirc ( Point pt1)
long DB_QueryCurv ( Point pt1)

befindet sich Punkt auf Curv ???

int DB_Filter__ ( ObjDB grp,
int *  grpNr,
ObjGX flt,
int  fltNr 
)
* DB_Filter__ get list of filtered DB-objects
* Input:
* flt FilterRecords. see Filtering_Examples
* fltNr - number of records in flt
* grpNr - size of gr1
* Output:
* grpNr - nr of found objects.
* Returncodes:
* -1 not yet implemented
*
* Filtering_Examples:
* fltNr=1; flt-Rec1: typ=Typ_SURPTAB.
* find all surfaces of type Typ_SURPTAB (A=PTAB ..)
* returns grp.typ=Typ_SUR; grp.ind=DB-ind.
*
int DB_QueryActiv ( Activity **  act,
int  typ,
long  ind 
)
* query, if a interactivity is connected to obj
* RectCod: -1=no, else DB-ind of activity.
*
void DB_Delete ( int  typ,
long  ind 
)
* delete DB-object
*
int DB_store_obj ( ObjGX oxo,
ObjGX ox1,
long *  ind 
)
* DO NOT USE; use DB_store_stru
* save obj --> DB
* Input:
* ox1 eine (ObjGX*)-Struktur
* Output:
* oxo su_tab[Ind]
* ind wenn on Input < 0
* RetCod:
* 0 = OK
* -1 = Error
*
int DB_store_stru ( void **  oo,
int  typ,
int  form,
void *  os1,
int  iNr,
long *  ind 
)
* save struct os1 in DB with form=form;
* can also save the parent-ox for S,A,B (see ind)
* Input
* form type of struct os1
* os1 struct to save; datastruct, no parent-ox for curves.
* iNr nr of structs
* ind if(ind == -1) create dynam. obj; give back dynam. index
* if(ind == 0) DO NOT STORE parent-ox for S,A,B.
* else store data and parent-ox
* Output:
* oo position of os1 (in DB_CSEG)
* ind dynam. Index (only if (ind == -1))
* IRC 0 = OK
* IRC -1 = Error
*
int DB_get_ObjNr ( int  typ)
int DB_VC_isFree ( long  dbi)
* test if DB-vector is in use or free
* dbi < 0 - dynamic vector
* RetCod:
* 0 obj is in use
* 1 obj is free (unused)
*
int DB_PLN_isFree ( long  dbi)
* test if DB-plane is in use or free
* dbi < 0 - dynamic plane
* RetCod:
* 0 obj is in use
* 1 obj is free (unused)
*

Variable Documentation

double AP_txsiz

Notes-Defaultsize.

double AP_txdimsiz

Dimensions-Text-size.

Dimensions-Text-size.

int AP_txNkNr

Nachkommastellen.

ColRGB AP_defcol

die DefaultColor des aktiven (sub)Model

Point AP_box_pm1
Point AP_box_pm2
int WC_sur_ind

Index auf die ActiveConstrPlane.

Index auf die ActiveConstrPlane.

Plane WC_sur_act

die aktive Plane

die aktive Plane

Mat_4x3 WC_sur_mat

TrMat of ActiveConstrPlane.

TrMat of ActiveConstrPlane only if (WC_sur_ind > 0)

Mat_4x3 WC_sur_imat

inverse TrMat of ActiveConstrPlane

ObjAtt* GA_ObjTab
int GA_recNr
double GR_tx_scale
double APT_ModSiz
long APT_VR_SIZ
long APT_VR_IND =0

APT_.._IND: der letzte belegte Index !

long APT_PT_SIZ
long APT_PT_IND =0
long APT_VC_SIZ
long APT_VC_IND =0
long APT_LN_SIZ
long APT_LN_IND =0
long APT_CI_SIZ
long APT_CI_IND =0
long APT_PL_SIZ
long APT_PL_IND =0
long APT_MR_SIZ
long APT_MR_IND =0
long APT_TR_SIZ
long APT_TR_IND =0
long APT_CV_SIZ
long APT_CV_IND =0
long APT_TX_SIZ
long APT_TX_IND =0
long APT_SU_SIZ
long APT_SU_IND =0
long APT_SO_SIZ
long APT_SO_IND =0
long APT_AC_SIZ
long APT_AC_IND =0
long DB_MNM_SIZ
long APT_MN_IND =0
long DB_CSIZ
long DYN_VR_SIZ =0
static
long DYN_VR_IND =0
static
long DYN_PT_SIZ =0
static
long DYN_PT_IND =0
static
long DYN_VC_SIZ =0
static
long DYN_VC_IND =0
static
long DYN_LN_SIZ =0
static
long DYN_LN_IND =0
static
long DYN_CI_SIZ =0
static
long DYN_CI_IND =0
static
long DYN_PL_SIZ =0
static
long DYN_PL_IND =0
static
long DYN_CV_SIZ =0
static
long DYN_CV_IND =0
static
long DYN_SU_SIZ =0
static
long DYN_SU_IND =0
static
long DYN_TX_SIZ =0
static
long DYN_TX_IND =0
static
long DYN_MB_SIZ =0
static
long DYN_MB_IND =0
static
long DB_MNM_IND =0
static
int DB_JNT_IND =0
static
double* vr_tab = NULL
static
double* vr_dyn = NULL
static
Point* pt_tab = NULL
static
Point* pt_dyn = NULL
static
Vector* vc_tab = NULL
static
Vector* vc_dyn = NULL
static
Line* ln_tab = NULL
static
Line* ln_dyn = NULL
static
Circ* ci_tab = NULL
static
Circ* ci_dyn = NULL
static
Plane* pln_tab = NULL
static
Plane* pln_dyn = NULL
static
ModelRef* mdr_tab = NULL
static
ModelBas* mdb_dyn = NULL
static
char* mdb_nam = NULL
static
Activity* ac_tab = NULL
static
ObjGX* tra_tab = NULL
static
ObjGX* cv_tab = NULL
static
ObjGX* cv_dyn = NULL
static
ObjGX* su_tab = NULL
static
ObjGX* su_dyn = NULL
static
ObjGX* so_tab = NULL
static
ObjGX* tx_tab = NULL
static
ObjGX* tx_dyn = NULL
static
Memspc DB_CSEG
static
char* DB_CDAT = NULL
static
ModelNode* mNod = NULL
static
int MNOD_SIZ = 0
static
int MNOD_IND = 0
static
double DB_sel_tol = 2.5
double DB_sel_tol_fakt = 2.5
Point DB_pt0
Vector DB_vc0