gCAD3D 2.40
ut_gtypes.c File Reference

get|set|check object typ, index, ID More...

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "../ut/ut_geo.h"
#include "../ut/ut_txt.h"
#include "../db/ut_DB.h"
#include "../gui/gui_types.h"
#include "../ut/ut_gtypes.h"
#include "../xa/xa_sele.h"

Functions

int APED_oid_dbo_all (char *oid, int typ, long dbi, long dli)
 
int APED_dbi_src_std_vc_pl (int *typ, long *dbi, int gti)
 
int APED_oid_dbo__ (char *buf, int typ, long ind)
 
int APED_oid_dbo_sm (char *oid, int sSiz, int dbTyp, long dbi)
 
int APED_oid_vc (char *cbuf, Vector *vc1)
 
int APED_dbo_oid (int *defTyp, long *defInd, char *txtIn)
 
char * AP_src_typ__ (int typ)
 
char * AP_src_typMod (int typ)
 
int DB_Typ_Char (char *auxBuf)
 
int DB_2DTyp_3DTyp (int typIn)
 
int AP_typ_typChar (char typChar)
 
char AP_typChar_typ (int typ)
 
int AP_typ_2_bastyp (int typ)
 
int AP_typ_FncNam (char *fncNam, int sLen)
 
int AP_typ_srcExpr (char *expr, char **pNxt)
 
int AP_cmp_typ (int typ1, int typ2)
 
int UTO_ck_dbsTyp (int typ)
 
int UTO_ck_typTyp (int typ)
 
int UTO_ck_curvLimTyp (int typ)
 
int UTO_ck_curvForm (int typ)
 

Variables

int WC_modact_ind
 
static char * TypTxtTab0 []
 
static char * TypTxtTab20 []
 
static char * TypTxtTab40 []
 
static char * TypTxtTab50 []
 
static char * TypTxtTab80 []
 
static char * TypTxtTab90 []
 
static char * TypTxtTab100 []
 
static char * TypTxtTab110 []
 
static char * TypTxtTab120 []
 
static char * TypTxtTab130 []
 
static char * TypTxtTab150 []
 
static char * TypTxtTab170 []
 
static char * TypTxtTab190 []
 
static char * TypTxtTab200 []
 
static char * TypTxtTab210 []
 
static char * TypTxtTab220 []
 
static char * TypTxtTab230 []
 
static char * TypTxtTab260 []
 
static char * TypTxtTab270 []
 
static char * TypTxtTab1000 []
 
static char * TypTxtTab1020 []
 
static char * TypTxtTab1100 []
 
static char * Fc1TxtTab []
 
static int Fc1TypTab []
 
static char * FcmTxtTab []
 
char * NcoTxtTab []
 
double NcoValTab []
 
char * GcoTxtTab []
 
int GcoDbiTab []
 
char * CopTxtTab []
 
char MOpTxtStr [] = "+-*/"
 
char * ObjCodTab []
 
static char * GL2Dtxt1 [] ={" CW","REV"," CX","CTRL","PERP","PARL"}
 
static char * GL2Dtxt2 []
 
static char * GL2Dtxt3 [] ={"LIST"}
 

Detailed Description

get|set|check object typ, index, ID

=====================================================
List_functions_start:
APED_dbo_oid give typ, index from text "P12"
APED_oid_dbo__ make name from typ and DB-Index (visible object types)
APED_oid_dbo_sm object-id from typ and DB-Index and subModelname
APED_oid_dbo_all make name from typ and DB-index (all types)
APED_oid_vc get oid for Vector; (DX or DIX or D#)
APED_dbi_src_std_vc_pl get dbi for std-vector or -planes from GcoTxtTab-index
AP_typ_srcExpr decode expression
AP_typ_FncNam get type of function
AP_typ_typChar make typ from typChar ("P" -> Typ_PT)
AP_typChar_typ make typChar from typ (Typ_PT -> 'P')
AP_cmp_typ check for identical types
AP_src_typ__ make text from (int)typ; Typ_PT --> "PT" ..
DB_Typ_Char give typ(int) from text "PT" --> Typ_PT;
UTO_ck_dbsTyp check object-typ (struct or object)
UTO_ck_typTyp check if typ=curve (Typ_lFig) or surface (Typ_SUR)
UTO_ck_curvForm check if objTyp is ObjGX or other typ
List_functions_end:
=====================================================

Function Documentation

int APED_oid_dbo_all ( char *  oid,
int  typ,
long  dbi,
long  dli 
)
* APED_oid_dbo_all make name from typ and DB-index (all types)
* Input:
* dli -1 for unknown; used only for applicationObjects
*
*
int APED_dbi_src_std_vc_pl ( int *  typ,
long *  dbi,
int  gti 
)
* get dbi for std-vector or planes from oid-index in GcoTxtTab
*
* Input:
* gti index GcoTxtTab
* Output:
* typ Typ_VC | Typ_PLN
* dbi
*
int APED_oid_dbo__ ( char *  buf,
int  typ,
long  ind 
)
* APED_oid_dbo__ make name from typ and DB-Index (visible object types)
* Input:
* typ,ind DB-obj
* Output:
* buf name for DB-obj
*
int APED_oid_dbo_sm ( char *  oid,
int  sSiz,
int  dbTyp,
long  dbi 
)
int APED_oid_vc ( char *  cbuf,
Vector vc1 
)
* APED_oid_vc get oid for Vector; (DX or DIX or D#)
* check if Vector is a Defaultvektor (DX or DIX or ...)
* Input:
* vc1 struct Vector*
* Output:
* text eg "DZ" if RetCod < 0
* RC = 0: no, allgemeiner vektor;
* RC != 0: yes, -1=DX, -4=DIX, (DB-index of standard-vector)
*
int APED_dbo_oid ( int *  defTyp,
long *  defInd,
char *  txtIn 
)
* APED_dbo_oid get type and dbi from object-ID;
* eg returns defTyp=Typ_PT and defInd=20 for "P20"
* Returns also this constantObjects: DX DY DZ DIX DIY DIZ RX RY RZ
* see also AP_cut_defHdr
*
* Input:
* txtIn
*
* Output:
* defTyp: see wincut_base.h
* values return 0 !
* defInd
*
* Retcodes:
* 0 = OK
* -1 = only defTyp (eg P(..) or D(..))
* -2 = Error
*
* TODO: combine with DBO_dbo_src__
*
char* AP_src_typ__ ( int  typ)
* get objTypTxt from typ
* returns eq "PT" for Typ_PT
*
char* AP_src_typMod ( int  typ)
* get modifier-text from (modifier)typ
* typ must be modifier (test with TYP_IS_MOD)
*
int DB_Typ_Char ( char *  auxBuf)
* return type from obj-definition ("PT" or "LN") or obj-ID ("eg "P20")
* Text > int-3D-Typ
* give typ(int) from text "PT" --> Typ_PT
* see also AP_src_typ__ (objTypTxt from typ)
*
int DB_2DTyp_3DTyp ( int  typIn)
* DB_2DTyp_3DTyp give 2D-Typ of 3D-Typ
* RetCod: 0=Error else 2d-type
*
int AP_typ_typChar ( char  typChar)
* AP_typ_typChar make typ from typChar ("P" -> Typ_PT)
* Error: returns Typ_Error
* AP_typChar_typ make typChar from typ (Typ_PT -> 'P')
*
char AP_typChar_typ ( int  typ)
* AP_typChar_typ make typChar from typ (Typ_PT -> 'P')
* Error: returns '-'
*
int AP_typ_2_bastyp ( int  typ)
* give basictyp from typ;
* makes Typ_SURRU -> Typ_SUR or Typ_CVBSP -> Typ_CV.
*
*
int AP_typ_FncNam ( char *  fncNam,
int  sLen 
)
int AP_typ_srcExpr ( char *  expr,
char **  pNxt 
)
int AP_cmp_typ ( int  typ1,
int  typ2 
)
* check if types identical;
* RC = 0 = ident;
*
*
int UTO_ck_dbsTyp ( int  typ)
* UTO_ck_dbsTyp check object-typ (struct or object)
* typ must be a basictype; see AP_typ_2_bastyp
* Retcode:
* 0 dedicated struct - VPDLCRMI
* V=Value,P=Point,D=Vector,L=Line,C=Circ,R=Plane,M=Model,I=Activity
* 1 complex-object (ObjGX) - SABNT
* S=Curve,A=Surf,B=Sol,N=Note,T=Trafo
*
int UTO_ck_typTyp ( int  typ)
* UTO_ck_typTyp check if typ=curve (Typ_lFig) or surface (Typ_SUR)
* Input
* typ must be basic-type (AP_typ_2_bastyp)
* Retcod Typ_go_LCS from LN|AC|CV (L/C/S)
* Typ_SUR from PLN|SUR|SOL (R/A/B)
* Typ_PT from PT (P)
* <typ> unmodified, from N|M (Typ_Note|Typ_Model ..)
*
int UTO_ck_curvLimTyp ( int  typ)
* UTO_ck_curvLimTyp check if CurveLimits are Points or parameters
* RetCode:
* 0 die CurveLimits basieren auf Points (LN, AC, CVELL usw)
* 1 die CurveLimits basieren auf Parameters (CVPOL, CVBSP)
*
int UTO_ck_curvForm ( int  typ)
* UTO_ck_curvForm check if objTyp is ObjGX or other typ
* Output:
* else typ
*

Variable Documentation

int WC_modact_ind
char* TypTxtTab0[]
static
Initial value:
={
"Error", "Var", "Vec", "PT", "LN",
"CI", "-", "-", "-", "-",
"VC2", "PT2", "LN2", "CI2", "CI2C"}
char* TypTxtTab20[]
static
Initial value:
={
"CV", "CvPlg", "CvPsp3", "CvBsp", "CvRBsp",
"CvEll", "CvBez", "CvRBez", "Clot", "CvLnTab",
"CV2", "CvPlg2", "CvPsp2", "CvBsp2", "CvRBsp2",
"CvEll2", "CvEll2C","CvBez2", "CvCcv", "-"}
char* TypTxtTab40[]
static
Initial value:
={
"PLN"}
char* TypTxtTab50[]
static
Initial value:
={
"SUR", "SurCon", "SurTor", "SurRU", "SurRV",
"SurSwp", "SurBsp", "SurRBsp","SurPln", "SurTps",
"SurHat", "SurCir", "SurStrip","SurBnd","SurMsh",
"SurPtab","SurFac3","SurFacQ","SurTri", "SurSup",
"SurGL_", "SurGLpp","SurGLpo","SurGLis","SurEdg"}
char* TypTxtTab80[]
static
Initial value:
={
"SOL", "Sphere", "Conus", "Torus", "Prism",
"BREP"}
char* TypTxtTab90[]
static
Initial value:
={
"Note", "TxtA", "TxtG", "Dimen", "Dim3",
"Tag", "------", "------", "------", "------"}
char* TypTxtTab100[]
static
Initial value:
={
"SymBmp", "SymVec", "SymRef", "SymRef2","Texture",
"TEXB", "TEXR", "Box", "EdgLn", "------"}
char* TypTxtTab110[]
static
Initial value:
={
"TmpPT", "Vertex", "EyePT", "------", "------"}
char* TypTxtTab120[]
static
Initial value:
={
"Part", "Grp", "ModBas", "Model", "Mockup",
"Dit", "Joint", "Proc"}
char* TypTxtTab130[]
static
Initial value:
={
"Val", "X-coord","Y-coord","Z-coord","DistX",
"DistY", "DistZ", "Angle", "Radius", "Dist",
"Par1", "UVal", "VVal", "------", "------",
"------", "------", "------", "------", "------"}
char* TypTxtTab150[]
static
Initial value:
={
"Typ", "Subtyp", "cmdSub", "Address","Size",
"Index", "Name", "Color", "LnTyp", "Thick",
"G_Att", "Activ", "Layer", "AppObj", "AppDat",
"Tool", "------", "------", "------", "------"}
char* TypTxtTab170[]
static
Initial value:
={
"Data", "Int1", "Int2", "Int4", "Int8",
"Float4", "Float8", "-", "-", "-",
"poly--", "poly1-", "poly3-", "polyD3", "-",
"Mat3x2", "Mat3x3", "Mat4x3", "Mat4x4", "-"}
char* TypTxtTab190[]
static
Initial value:
={
"Text", "String", "StrDel", "StrDel1","FncNam",
"FilNam", "CtlgPart","NumString","ConstVal","ConstObj"}
char* TypTxtTab200[]
static
Initial value:
={
"Memspc", "MemTab", "IndTab", "ObjRange","ObjSRC",
"ObjGX", "------", "------", "ObjDB", "------"}
char* TypTxtTab210[]
static
Initial value:
={
"Tra", "TraTra", "TraRot", "TraMat", "------"}
char* TypTxtTab220[]
static
Initial value:
={
"Ope__", "OpeEQ", "OpeNE", "OpeLT", "OpeGT",
"OpeGE", "OpeLE", "OpeAND", "OpeOR", "Mod"}
char* TypTxtTab230[]
static
Initial value:
={
"ModRep", "Mod1--", "Mod2--", "ModCWCCW","ModREV",
"ModCX", "ModCTRL","ModPERP","ModPARL","ModHIX",
"Mod---", "Mod---", "Mod---", "Mod---", "Mod---",
"ModCCW", "ModCW", "ModIN", "ModOUT", "ModAux",
"ModUNL", "------", "------", "------", "------",
"------", "------", "------", "------", "Undef" }
char* TypTxtTab260[]
static
Initial value:
={
"FuInit", "FuInit1","FuMod", "FuAdd", "FuDel",
"FuEnd", "FuExit", "Fu----", "Fu----", "Fu----"}
char* TypTxtTab270[]
static
Initial value:
={
"ALL", "Done", "NULL", "Last", "SIZ",
"------", "------", "------", "------", "------",
"OpmPlus","OpmMinus","OpmMult","OpmDiv","------",
"------", "------", "------", "------", "------",
"FcmSQRT","FcmSIN", "FcmCOS", "FcmTAN", "FcmASIN",
"FcmACOS","FcmATAN","FcmABS", "FcmFIX", "FcmRND"}
char* TypTxtTab1000[]
static
Initial value:
={
"goGeom", "goPrim", "goGeo1", "goGeo2", "goGeo3",
"goGeo4", "goGeo5", "goSUSU", "goGeo6", "goGeo7",
"goGeo8", "goAxis", "goLR", "go----", "go----"}
char* TypTxtTab1020[]
static
Initial value:
={
"FncVAR1","FncVAR2","FncVC1", "FncVC2", "FncNxt",
"FncPrv", "FncDirX","FncOnO", "FncOnC", "Fnc---"}
char* TypTxtTab1100[]
static
Initial value:
={
"ValSymTyp","StrDir1","Obj0", "------", "------"}
char* Fc1TxtTab[]
static
Initial value:
= {
"VAL", "ANG", "RAD", "MOD", "NEW",
""}
int Fc1TypTab[]
static
Initial value:
={
#define Typ_Rad
Radius.
Definition: AP_types.h:198
#define TYP_FuncInit
functions see also UI_Func* ../gui/gui_types.h
Definition: AP_types.h:335
#define Typ_Val
double-Value
Definition: AP_types.h:190
#define Typ_modif
modifiers TYP_IS_MOD
Definition: AP_types.h:301
#define Typ_Angle
Angle (in degree; ANG())
Definition: AP_types.h:197
char* FcmTxtTab[]
static
Initial value:
= {
"SQRT", "SIN", "COS", "TAN", "ASIN",
"ACOS", "ATAN", "ABS", "FIX", "RND",
""}
char* NcoTxtTab[]
Initial value:
= {
"PI", "RAD_1", "RAD_90", "RAD_180", "RAD_360",
"SR_2", "SR_3",
""}
double NcoValTab[]
Initial value:
= {
}
#define SR_3
SQRT(3)
Definition: ut_geo.h:75
#define RAD_1
1 Grad
Definition: ut_geo.h:72
#define RAD_360
360 Grad
Definition: ut_geo.h:61
#define RAD_180
180 Grad
Definition: ut_geo.h:64
#define SR_2
SQRT(2)
Definition: ut_geo.h:76
#define RAD_90
90 Grad
Definition: ut_geo.h:67
char* GcoTxtTab[]
Initial value:
= {
"DX", "DY", "DZ", "DIX", "DIY",
"DIZ", "RX", "RY", "RZ",
""}
int GcoDbiTab[]
Initial value:
= {
}
#define DB_VCIY_IND
DIY.
Definition: ut_DB.h:51
#define DB_VCX_IND
DX.
Definition: ut_DB.h:47
#define DB_VCIZ_IND
DIZ.
Definition: ut_DB.h:52
#define DB_VCZ_IND
DZ.
Definition: ut_DB.h:49
#define DB_PLY_IND
RY.
Definition: ut_DB.h:55
#define DB_PLX_IND
RX.
Definition: ut_DB.h:54
#define DB_VCY_IND
DY.
Definition: ut_DB.h:48
#define DB_PLZ_IND
RZ.
Definition: ut_DB.h:56
#define DB_VCIX_IND
DIX.
Definition: ut_DB.h:50
char* CopTxtTab[]
Initial value:
= {
"EQ", "NE", "LT", "GT", "G_E",
"L_E", "AND", "OR",
""}
char MOpTxtStr[] = "+-*/"
char* ObjCodTab[]
Initial value:
= {
"ON", "OFF", "IN", "OUT", "ARC",
"HI", "LO", "MA", "TAG", "PERP",
"CCW", "CW", "ELL", "IMG", "CCV2",
"POL2", "POL", "PSP3", "BSP", "CCV",
"RCIR", "RSTRIP", "SRU", "HAT", "SRV",
"PRISM", "SPH", "CON", "TOR", "CYL",
"CUT", "REV", "SWP", "LE", "RI",
"DIM", "DIMA", "LDR", "UNUSED", "FSUB",
"PRJ", "TRA", "ROT", "MIR", "TXA",
"DIMD", "DIMR", "DIM3", "REC", "INT",
"RSYS", "REPL", "RBSP", "ARC1", "CTRL",
"LDRP", "LDRC", "LDRS", "CTLG", "ISO",
"FW", "CX", "PTAB", "MSH", "CLOT",
"TNG", "IMP", "BSP1", "PARL", "BLEND",
"UNL", "UNL1", "UNL2", "DISP_PT", "DISP_PL",
""}
char* GL2Dtxt1[] ={" CW","REV"," CX","CTRL","PERP","PARL"}
static
char* GL2Dtxt2[]
static
Initial value:
={" V+"," V-", "VC+", "VC-", "NXT", "PRV",
"?", "PTonObj","PTonCP"}
char* GL2Dtxt3[] ={"LIST"}
static