gCAD3D 2.35
ut_DB.h File Reference

Go to the source code of this file.

Macros

#define DB_isFree_Var(obj)   *(obj) == UT_VAL_MAX
 
#define DB_isFree_PT(obj)   (obj)->x == UT_VAL_MAX
 
#define DB_isFree_LN(obj)   (obj)->p1.x == UT_VAL_MAX
 
#define DB_isFree_VC(obj)   (obj)->dx == UT_VAL_MAX
 
#define DB_isFree_CI(obj)   (obj)->p1.x == UT_VAL_MAX
 
#define DB_isFree_PLN(obj)   (obj)->p == UT_VAL_MAX
 
#define DB_isFree_CV(obj)   (obj)->typ == Typ_Error
 
#define DB_isFree_GTxt(obj)   (obj)->typ == Typ_Error
 
#define DB_isFree_Sur(obj)   (obj)->typ == Typ_Error
 
#define DB_isFree_Sol(obj)   (obj)->typ == Typ_Error
 
#define DB_isFree_Tra(obj)   (obj)->typ == Typ_Error
 
#define DB_isFree_Act(obj)   (obj)->typ == Typ_Error
 
#define DB_isFree_ModRef(obj)   (obj)->po.x == UT_VAL_MAX
 
#define DB_setFree_Var(dbi)   vr_tab[dbi] = UT_VAL_MAX
 
#define DB_setFree_VC(dbi)   vc_tab[dbi].dx = UT_VAL_MAX
 
#define DB_setFree_PT(dbi)   pt_tab[dbi].x = UT_VAL_MAX
 
#define DB_setFree_LN(dbi)   ln_tab[dbi].p1.x = UT_VAL_MAX
 
#define DB_setFree_CI(dbi)   ci_tab[dbi].p1.x = UT_VAL_MAX
 
#define DB_setFree_PLN(dbi)   pln_tab[dbi].p = UT_VAL_MAX
 
#define DB_setFree_CV(dbi)   cv_tab[dbi].typ = Typ_Error
 
#define DB_setFree_SU(dbi)   su_tab[dbi].typ = Typ_Error
 
#define DB_setFree_SO(dbi)   so_tab[dbi].typ = Typ_Error
 
#define DB_setFree_TR(dbi)   tra_tab[dbi].typ = Typ_Error
 
#define DB_setFree_TX(dbi)   tx_tab[dbi].typ = Typ_Error
 
#define DB_setFree_MR(dbi)   mdr_tab[dbi].po.x = UT_VAL_MAX
 
#define DB_setFree_Act(dbi)   ac_tab[dbi].typ = Typ_Error
 
#define DB_VCX_IND   -1
 DX. More...
 
#define DB_VCY_IND   -2
 DY. More...
 
#define DB_VCZ_IND   -3
 DZ. More...
 
#define DB_VCIX_IND   -4
 DIX. More...
 
#define DB_VCIY_IND   -5
 DIY. More...
 
#define DB_VCIZ_IND   -6
 DIZ. More...
 
#define DB_PLX_IND   -1
 RX. More...
 
#define DB_PLY_IND   -2
 RY. More...
 
#define DB_PLZ_IND   -3
 RZ. More...
 

Functions

void DB_Init (int mode)
 
int DB_Store_obj (long *dbi, int typ, void *data)
 
int DB_StoreTxt (char **pos, char *text)
 
long DB_StoreDim_ (long Ind, Dimen *dim1)
 
long DB_StoreDim3 (long Ind, Dim3 *dim3)
 
long DB_StoreGTxt (long Ind, GText *gtx1)
 
int DB_StoreSur (long *Ind, ObjGX *ox1)
 
int DB_StoreTra (long Ind, ObjGX *ox1)
 
long DB_StoreVar (long, double)
 
long DB_StoreVector (long, Vector *)
 
long DB_StorePoint (long, Point *)
 
long DB_StoreLine (long, Line *)
 
long DB_StoreCirc (long, Circ *)
 
long DB_StoreCvEll (long Ind, CurvPoly *cvell)
 
long DB_StoreCvPlg (long Ind, CurvPoly *cvplg, int iNew)
 
long DB_StoreCvBsp (long Ind, CurvBSpl *cvbsp)
 
long DB_StoreCurv (long, ObjGX *, int)
 
long DB_StoreRef (long, Plane *)
 
int DB_StoreDummy (int typ, long Ind)
 
long DB_Store_hdr_cv (ObjGX **cvo, long Ind)
 
long DB_Store_hdr_su (ObjGX **oxo, long Ind)
 
long DB_Store_hdr_nt (ObjGX **oxo, long Ind)
 
void DB_Delete (int, long)
 
long DB_FindVector (Vector *vc1)
 
long DB_GetDynInd (int)
 
char ** DB_GetTxt (long)
 
double DB_GetVar (long)
 
double * DB_get_Var (long Ind)
 
Vector DB_GetVector (long)
 
Point DB_GetPoint (long)
 
Line DB_GetLine (long)
 
Circ DB_GetCirc (long)
 
ObjGXDB_GetCurv (long)
 
ObjGXDB_GetSol (long)
 
ObjGXDB_GetGTxt (long Ind)
 
ObjGXDB_GetSur (long Ind, int mode)
 
ObjGXDB_GetTra (long Ind)
 
PointDB_get_PT (long Ind)
 
LineDB_get_LN (long Ind)
 
VectorDB_get_VC (long Ind)
 
CircDB_get_CI (long Ind)
 
void * DB_get_CV (int *ityp, long Ind)
 
PlaneDB_get_PLN (long Ind)
 
ModelRefDB_get_ModRef (long Ind)
 
ModelBasDB_get_ModBas (int Ind)
 
ModelNodeDB_get_ModNod (int ind)
 
int DB_GetObjDat (void **pDat, int *oNr, int dbTyp, long dbInd)
 
int DB_GetObj (long, long *, int *)
 
ObjGX DB_GetObjGX (int typ, long apt_ind)
 
int DB_GetConnObj (int *, long *, int *, long *, Point2 *)
 
long DB_GetObjTyp2Pt (int *, Point2 *, Point2 *)
 
void DB_GetRef (Plane *, long)
 
ActivityDB_get_Activ (long Ind)
 
PlaneDB_DefRef (long Ind)
 
void * DB_cPos ()
 
void * DB_cSav (long size, void *data)
 
void * DB_cGet (void *data, void *pos, long size)
 
int DB_Lay (int, int, int)
 
int DB_Lay_add (int, int, char *, int *, double *)
 
long DB_QueryPoint (Point *)
 
long DB_QueryLine (Point *)
 
long DB_QueryCirc (Point *)
 
long DB_QueryCurv (Point *)
 
int DB_QueryDynPoint (Point *, Point *)
 
long DB_QueryPrvUsed (int typ, long istart)
 
long DB_QueryNxtUsed (int typ, long istart)
 
long DB_QueryNxtFree (int typ, int istart)
 
long DB_dbo_get_free (int typ)
 
void DB_fix_tol (double)
 
int DB_2DTyp_3DTyp (int)
 
int DB_Typ_Char (char *)
 
char * DB_mdlNam_iBas (int bmNr)
 
void DB_Stat ()
 
int DB_save__ (char *mNam)
 
int DB_load__ (char *mNam)
 
long DB_dyn__ (int mode, int typ, long ind)
 

Variables

long APT_VR_SIZ
 
long APT_PT_SIZ
 
long APT_VC_SIZ
 
long APT_LN_SIZ
 
long APT_CI_SIZ
 
long APT_PL_SIZ
 
long APT_MR_SIZ
 
long APT_CV_SIZ
 
long APT_TX_SIZ
 
long APT_SU_SIZ
 
long APT_SO_SIZ
 
long DB_CSIZ
 
long DB_MNM_SIZ
 

Macro Definition Documentation

#define DB_isFree_Var (   obj)    *(obj) == UT_VAL_MAX
#define DB_isFree_PT (   obj)    (obj)->x == UT_VAL_MAX
#define DB_isFree_LN (   obj)    (obj)->p1.x == UT_VAL_MAX
#define DB_isFree_VC (   obj)    (obj)->dx == UT_VAL_MAX
#define DB_isFree_CI (   obj)    (obj)->p1.x == UT_VAL_MAX
#define DB_isFree_PLN (   obj)    (obj)->p == UT_VAL_MAX
#define DB_isFree_CV (   obj)    (obj)->typ == Typ_Error
#define DB_isFree_GTxt (   obj)    (obj)->typ == Typ_Error
#define DB_isFree_Sur (   obj)    (obj)->typ == Typ_Error
#define DB_isFree_Sol (   obj)    (obj)->typ == Typ_Error
#define DB_isFree_Tra (   obj)    (obj)->typ == Typ_Error
#define DB_isFree_Act (   obj)    (obj)->typ == Typ_Error
#define DB_isFree_ModRef (   obj)    (obj)->po.x == UT_VAL_MAX
#define DB_setFree_Var (   dbi)    vr_tab[dbi] = UT_VAL_MAX
#define DB_setFree_VC (   dbi)    vc_tab[dbi].dx = UT_VAL_MAX
#define DB_setFree_PT (   dbi)    pt_tab[dbi].x = UT_VAL_MAX
#define DB_setFree_LN (   dbi)    ln_tab[dbi].p1.x = UT_VAL_MAX
#define DB_setFree_CI (   dbi)    ci_tab[dbi].p1.x = UT_VAL_MAX
#define DB_setFree_PLN (   dbi)    pln_tab[dbi].p = UT_VAL_MAX
#define DB_setFree_CV (   dbi)    cv_tab[dbi].typ = Typ_Error
#define DB_setFree_SU (   dbi)    su_tab[dbi].typ = Typ_Error
#define DB_setFree_SO (   dbi)    so_tab[dbi].typ = Typ_Error
#define DB_setFree_TR (   dbi)    tra_tab[dbi].typ = Typ_Error
#define DB_setFree_TX (   dbi)    tx_tab[dbi].typ = Typ_Error
#define DB_setFree_MR (   dbi)    mdr_tab[dbi].po.x = UT_VAL_MAX
#define DB_setFree_Act (   dbi)    ac_tab[dbi].typ = Typ_Error
#define DB_VCX_IND   -1

DX.

#define DB_VCY_IND   -2

DY.

#define DB_VCZ_IND   -3

DZ.

#define DB_VCIX_IND   -4

DIX.

#define DB_VCIY_IND   -5

DIY.

#define DB_VCIZ_IND   -6

DIZ.

#define DB_PLX_IND   -1

RX.

#define DB_PLY_IND   -2

RY.

#define DB_PLZ_IND   -3

RZ.

Function Documentation

void DB_Init ( int  mode)

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

int DB_Store_obj ( long *  dbi,
int  typ,
void *  data 
)
int DB_StoreTxt ( char **  pos,
char *  text 
)
long DB_StoreDim_ ( long  Ind,
Dimen dim1 
)
long DB_StoreDim3 ( long  Ind,
Dim3 dim3 
)
long DB_StoreGTxt ( long  Ind,
GText gtx1 
)
int DB_StoreSur ( long *  Ind,
ObjGX ox1 
)
CIR u STRIP-Flaeche kommt als Punktindextabelle (von Dreiecken).
Punkte als dynam. Punkte speichern.
int DB_StoreTra ( long  Ind,
ObjGX ox1 
)
long DB_StoreVar ( long  ,
double   
)
long DB_StoreVector ( long  ,
Vector  
)
long DB_StorePoint ( long  ,
Point  
)
long DB_StoreLine ( long  ,
Line  
)
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)
long DB_StoreCirc ( long  ,
Circ  
)
long DB_StoreCvEll ( long  Ind,
CurvPoly cvell 
)
long DB_StoreCvPlg ( long  Ind,
CurvPoly cvplg,
int  iNew 
)
long DB_StoreCvBsp ( long  Ind,
CurvBSpl cvbsp 
)
long DB_StoreCurv ( long  ,
ObjGX ,
int   
)
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
long DB_StoreRef ( long  ,
Plane  
)
int DB_StoreDummy ( int  typ,
long  Ind 
)

occupy

long DB_Store_hdr_cv ( ObjGX **  cvo,
long  Ind 
)
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_nt ( ObjGX **  oxo,
long  Ind 
)
void DB_Delete ( int  ,
long   
)
delete DB-object
long DB_FindVector ( Vector vc1)
long DB_GetDynInd ( int  )
returns next free dynamic object-Index for typ (negative)
char** DB_GetTxt ( long  )
double DB_GetVar ( long  )
double* DB_get_Var ( long  Ind)
Vector DB_GetVector ( long  )

DB_get_VC

Point DB_GetPoint ( long  )
returns point.
get pointer with DB_get_PT
Line DB_GetLine ( long  )
Circ DB_GetCirc ( long  )
ObjGX* DB_GetCurv ( long  )

see also DB_get_CV

ObjGX* DB_GetSol ( long  )
ObjGX* DB_GetGTxt ( long  Ind)

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

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) !
ObjGX* DB_GetTra ( long  Ind)

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

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

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))
Plane* DB_get_PLN ( long  Ind)
es gibt keine dyn planes !
ModelRef* DB_get_ModRef ( long  Ind)

DB_get_ModRef get Ditto from Index

ModelBas* DB_get_ModBas ( int  Ind)
get the basicModel with index <Ind>
get Ing eg from ModelRef.modNr
ModelNode* DB_get_ModNod ( int  ind)
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
int DB_GetObj ( long  ,
long *  ,
int *   
)
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_GetConnObj ( int *  ,
long *  ,
int *  ,
long *  ,
Point2  
)
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 *  ,
Point2 ,
Point2  
)
Jenes Element vom Typ typ suchen, dess Endpunkte pt1 / pt2 sind.
Output:
RetCode: der Index; -1 = nix gefunden.
typ
void DB_GetRef ( Plane ,
long   
)
get a copy of a plane
Activity* DB_get_Activ ( long  Ind)
Plane* DB_DefRef ( long  Ind)
das Defaultrefsys (RX/RY/RZ) liefern.
Diese liegen fix in pln_dyn[0/1/2] !
Ind 0 alle initialisieren
Ind -1 return Plane
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

int DB_Lay ( int  ,
int  ,
int   
)
int DB_Lay_add ( int  ,
int  ,
char *  ,
int *  ,
double *   
)
long DB_QueryPoint ( Point )
long DB_QueryLine ( Point )
long DB_QueryCirc ( Point )
long DB_QueryCurv ( Point )

befindet sich Punkt auf Curv ???

int DB_QueryDynPoint ( Point ,
Point  
)
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.
long DB_QueryNxtFree ( int  typ,
int  istart 
)
returns next free index
search free record starting from istart up to last active index.
long DB_dbo_get_free ( int  typ)
returns next free DB-index
void DB_fix_tol ( double  )
int DB_2DTyp_3DTyp ( int  )
DB_2DTyp_3DTyp give 2D-Typ of 3D-Typ
RetCod: 0=Error else 2d-type
int DB_Typ_Char ( char *  )
Text > int-3D-Typ
give typ(int) from text "PT" --> Typ_PT
see also AP_src_typ__ (objTypTxt from typ)
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

void DB_Stat ( )
int DB_save__ ( char *  mNam)

gesamte DB -> Datei raus

int DB_load__ ( char *  mNam)

gesamte DB aus Datei einlesen

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

Variable Documentation

long APT_VR_SIZ
long APT_PT_SIZ
long APT_VC_SIZ
long APT_LN_SIZ
long APT_CI_SIZ
long APT_PL_SIZ
long APT_MR_SIZ
long APT_CV_SIZ
long APT_TX_SIZ
long APT_SU_SIZ
long APT_SO_SIZ
long DB_CSIZ
long DB_MNM_SIZ