xa.c File Reference


Detailed Description

startup - applicationBase AP_

Main application functions; not depending on GUI.
(main() is in xa_main.c)


===============================================================================
Liste_Funktionen_Beginn:

AP_get_modnam       returns WC_modnam
AP_get_dir_open
AP_set_dir_open
AP_set_dir_save
AP_set_modsiz

AP_errStat_set      set AP_stat.errStat
AP_errStat_get
AP_debug__          stop in debug
AP_test__           "Ctl shift T"

AP_decode_fnam
AP_split_fnam       split WC_modnam AP_dir_open Filetyp
AP_ck_ftyp          get filetyp(int) (Model|Mockup|Image)
AP_i2ftyp           get filetyp(txt)
AP_Import__         via dll
AP_exec_dll
AP_Mod_load         load Model <AP_dir_open><WC_modnam>

AP_APT_sysed        MAN
AP_SRC_mem_edi      copy Editor --> memory (if necessary)
AP_SRC_edi_mem      copy memory --> Editor

AP_src_new          clear src-Memory, reset Undo, Hide, View-Plane, ConstrPlane
AP_src_mod_CB
AP_src_mod_ed       modify line in memory

AP_APT_clean        remove deleted lines
AP_obj_delCk1       check if line has depending lines

AP_cre_defHdr       create new free ObjHeader
AP_cut_defHdr       extract header

AP_lNr_inc          increment AP_ED_lNr
AP_lNr_get          returns AP_ED_lNr
AP_lNr_set

AP_typ_2_bastyp     give basictyp from typ (SURRU -> Typ_SUR; Typ_CVBSP -> Typ_CV)
AP_cmp_typ          check if types identical;
AP_typ_typChar      make typ from typChar  ("P" -> Typ_PT)
AP_typChar_typ      make typChar from typ  (Typ_PT -> 'P')

AP_vec_txt          give vector from Textvec
AP_txt_vec          check if Vector is a Defaultvektor
AP_get_nxtVec       returns DB-index of next|previous Vector
AP_hili_obj         hilite obj
GR_tmpSym

AP_Set_ConstPl_Z
AP_Get_ConstPl_vz   returns WC_sur_act.vz
AP_Get_ConstPl_Z    returns ConstrPln or its Z-vec

AP_PT2EyeBp
AP_PT2EyePln

ACT_ck_act          check and activate activity.

AP_SetCol__         set default color
AP_SetCol3i         set color
AP_colSel           select color

AP_DllLst_write     write tmp/Dll.lst (list of plugins)

AP_work__           work startparameters
AP_defLoad          load DefaultModel
AP_Init1
AP_Init_planes
AP_exit__
AP_defaults_write   defaults -> tmp/xa.rc
AP_defaults_dir     defaultdirs -> xa/dir.lst
AP_defaults_read    read defaults aus <base>/tmp/xa.rc
AP_Get_Setup        read line out of gCAD3D.rc

Liste_Funktionen_Ende:
=====================================================

#include "MS_Def0.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include "../ut/ut_geo.h"
#include "../ut/ut_txt.h"
#include "../ut/ut_txfil.h"
#include "../ut/ut_os.h"
#include "../gr/ut_UI.h"
#include "../db/ut_DB.h"
#include "../xa/xa_uid.h"
#include "../xa/xa.h"

Defines

#define mem_cbuf1_SIZ   100000

Functions

int AP_typ_typChar (char typChar)
int AP_lNr_inc ()
long AP_lNr_get ()
int AP_lNr_set (long lNr)
int AP_errStat_set (int stat)
int AP_errStat_get ()
int AP_src_new ()
int AP_src_mod_CB (void *parent, void *data)
int AP_src_mod_ed (long lNr)
int AP_APT_sysed ()
int AP_SRC_mem_edi ()
int AP_SRC_edi_mem ()
int AP_APT_clean ()
int AP_obj_delCk1 (long *lNr)
long AP_cre_defHdr (int typ, int istart)
int AP_cut_defHdr (int *typ, int *ind, char *cbuf)
int AP_defLoad ()
int AP_Init1 ()
int AP_Init_planes ()
int AP_exit__ ()
int AP_defaults_write ()
int AP_defaults_dir ()
int AP_SetCol__ (ColRGB *cSel)
int AP_SetCol3i (int cr, int cg, int cb, int mode)
int AP_colSel (ColRGB *cSel)
int AP_defaults_read ()
int AP_DllLst_write ()
int AP_get_dir_open (char *cbuf)
int AP_get_modnam (char *cbuf)
int AP_set_dir_open (char *newDir)
int AP_set_dir_save (char *newDir)
int AP_set_modsiz (double newssiz)
int AP_work__ (char *cmd, char *cmd1)
int AP_Import__ (char *dllNam, char *fncnam, void *fncdat)
int AP_exec_dll (char *cbuf)
int AP_ck_ftyp (char *ftyp)
int AP_i2ftyp (char *ftyp, int ift)
int AP_decode_fnam (char *fNam, char *path, char *fnTot)
int AP_split_fnam (int imod, char *cbuf)
int AP_Mod_load (int mode)
int AP_debug__ ()
int AP_search_init ()
int AP_hili_obj (char *cbuf)
int AP_vec_txt (Vector *vco, char *p1)
int AP_txt_vec (char *cbuf, Vector *vc1)
int AP_get_nxtVec (int mode)
int AP_cmp_typ (int typ1, int typ2)
int AP_typ_2_bastyp (int typ)
char AP_typChar_typ (int typ)
int AP_test__ ()
int AP_Get_Setup (char *cbufo, char *ctyps)
int AP_Set_ConstPl_Z (char *cbuf)
int AP_Get_ConstPl_vz (Vector *vc)
char * AP_Get_ConstPl_Z (int typ)
int AP_PT2EyeBp (char *plnTyp, Point *p1, Point *p2, Point *p3, Vector *vcs)
int AP_PT2EyePln (Point *pt, char *plnTyp, Point *p1, Point *p2, Point *p3, Vector *vcs)
int ACT_ck_act (long dli)
void GR_tmpSym (int typ, Point *pt1)

Variables

int UI_InpMode
int UI_InpSM
char APP_act_nam [64]
int aus_anz
int * aus_typ = NULL
double * aus_tab = NULL
int aus_SIZ
 size of aus_typ & aus_tab
char memspc011 [1024]
char memspc012 [1024]
char memspc50 [50000]
char memspc51 [50000]
char memspc52 [50000]
char memspc53 [50000]
char memspc54 [50000]
char memspc55 [50000]
char memspc101 [100000]
char memspc102 [100000]
char memspc201 [200000]
char memspc501 [500000]
char mem_cbuf1 [mem_cbuf1_SIZ]
char IE_buf [mem_cbuf1_SIZ]
char IE_outTxt [mem_cbuf1_SIZ]
char WC_modnam [128]
 active Modelname - without path
char WC_modact [128]
 name of the active submodel; def="" (main)
int WC_modnr = -1
 the Nr of the active submodel; -1 = main.
int WC_mod_stat = -1
 -1=primary Model is active;
Point WC_mod_ori
 der Model-Origin
Plane WC_sur_act
 die fuer Definition (zB P10=0,0) aktive Plane
double WC_sur_Z = 0.0
 active Z-value of WC_sur_sur;
int WC_sur_ind = 0
 Der Index auf die ActiveConstrPlane.
Mat_4x3 WC_sur_mat
 TrMat of ActiveConstrPlane.
Mat_4x3 WC_sur_imat
 inverse TrMat of ActiveConstrPlane
char WC_ConstPl_Z [16]
 ConstPl-Z-axis (DZ, ...R20 ...
int AP_src = AP_SRC_EDI
 AP_SRC_MEM or AP_SRC_EDI.
double AP_txsiz = 3.5
 Notes-Defaultsize.
double AP_txdimsiz = 2.5
 Dimensions-Text-Defaultsize.
int AP_txNkNr = 2
 Nachkommastellen.
ColRGB AP_actcol
 the active color ..
ColRGB AP_defcol
 die DefaultColor des aktiven (sub)Model
int AP_indCol
 der DL-Index der aktuellen defCol
int WC_stat_bound = OFF
 ON OFF; Draw boundary of Flächen J/N.
char ** AP_argv
char AP_dir_open [128]
 directory for OPEN
char AP_sym_open [64]
 symbolic directory for OPEN
char AP_dir_save [128]
 directory for SAVE
char AP_sym_save [64]
 symbolic directory for SAVE
char AP_dir_prg [128]
 directory for programs
char AP_sym_prg [64]
 symbolic directory for programs
char AP_printer [80]
 Printer.
char AP_browser [64]
 HTML-browser.
char AP_lang [4]
 en or de
AP_STAT AP_stat
 progress of Start
static long AP_ED_lNr = 0
 die aktuelle Line# im Edi.
int AP_ED_cPos = 0
 die aktuelle CharPos im Edi.
char AP_ED_oNam [64]
 objectName of active Line


Define Documentation

#define mem_cbuf1_SIZ   100000


Function Documentation

int AP_typ_typChar ( char  typChar  ) 

    AP_typ_typChar     make typ from typChar  ("P" -> Typ_PT)
    Error: returns Typ_Error

int AP_lNr_inc (  ) 

long AP_lNr_get (  ) 

see also ED_get_lnr_act

int AP_lNr_set ( long  lNr  ) 

    Achtung: der Editor benutzt zumeist ED_lnr_act
    see also ED_set_lnr_act

int AP_errStat_set ( int  stat  ) 

raise / reset error

 0 = default = OK;
 1 = Error
 2 = DB_allocCDAT; rerun.

int AP_errStat_get (  ) 

int AP_src_new (  ) 

clear src-Memory, reset Undo, Hide, View-Plane, ConstrPlane.

int AP_src_mod_CB ( void *  parent,
void *  data 
)

int AP_src_mod_ed ( long  lNr  ) 

zeile im mem modifizieren; mit dem SystemEditor.

int AP_APT_sysed (  ) 

int AP_SRC_mem_edi (  ) 

int AP_SRC_edi_mem (  ) 

int AP_APT_clean (  ) 

int AP_obj_delCk1 ( long *  lNr  ) 

long AP_cre_defHdr ( int  typ,
int  istart 
)

    create ObjHeader zB "P20="
    wc3-Source: ED_add_objInd

int AP_cut_defHdr ( int *  typ,
int *  ind,
char *  cbuf 
)

    extract header from Definitionline
    see also APT_decode_obj
    Input:
      cbuf  Definitionline
    Output:
      typ, ind

int AP_defLoad (  ) 

load DefaultModel tmp/Model

int AP_Init1 (  ) 

init DL, ED, WC

int AP_Init_planes (  ) 

    init View-Plane and ConstrPlane
    see UCS_Reset
    see GL_SetConstrPln

int AP_exit__ (  ) 

int AP_defaults_write (  ) 

defaults -> tmp/xa.rc

int AP_defaults_dir (  ) 

defaultdirs -> xa/dir.lst

int AP_SetCol__ ( ColRGB cSel  ) 

int AP_SetCol3i ( int  cr,
int  cg,
int  cb,
int  mode 
)

int AP_colSel ( ColRGB cSel  ) 

int AP_defaults_read (  ) 

read defaults from <base>/tmp/xa.rc

int AP_DllLst_write (  ) 

int AP_get_dir_open ( char *  cbuf  ) 

int AP_get_modnam ( char *  cbuf  ) 

int AP_set_dir_open ( char *  newDir  ) 

sets AP_sym_open

int AP_set_dir_save ( char *  newDir  ) 

int AP_set_modsiz ( double  newssiz  ) 

int AP_work__ ( char *  cmd,
char *  cmd1 
)

int AP_Import__ ( char *  dllNam,
char *  fncnam,
void *  fncdat 
)

int AP_exec_dll ( char *  cbuf  ) 

start DLL

int AP_ck_ftyp ( char *  ftyp  ) 

    returns ftyp as int; 0=native, 1-9=Import, 10-19=Mockup, 20-29=Image
    retour m. AP_i2ftyp

int AP_i2ftyp ( char *  ftyp,
int  ift 
)

    returns ftyp as text from int
    txt-> i m. AP_ck_ftyp

int AP_decode_fnam ( char *  fNam,
char *  path,
char *  fnTot 
)

separate -> AP_dir_open & WC_modnam;

int AP_split_fnam ( int  imod,
char *  cbuf 
)

    separate -> AP_dir_open|AP_dir_save & WC_modnam; 
    returns filetyp as int
    imod 1=open, 2=save

int AP_Mod_load ( int  mode  ) 

    load Model <AP_dir_open><WC_modnam>
    mode   0 = load neu
    mode   1 = insert; do not write Title & do not rescale
    see UI_save_

int AP_debug__ (  ) 

    stop here in debug-mode; in core; with Alt-X
    in .gdbinit:
    break AP_debug__
   
    Purpose: eg set "watch <varnam>" after startup is done (saves time)

int AP_search_init (  ) 

int AP_hili_obj ( char *  cbuf  ) 

    hilite Obj from cbuf = DefLn od Header; eg "L25=..."
    see also UI_hili_actLn IE_cad_Inp_disp
    Input:
      cbuf = Definitionline

int AP_vec_txt ( Vector vco,
char *  p1 
)

    give vector-struc from vector-text (only Standardvectors & planes)
    see AP_txt_vec

int AP_txt_vec ( char *  cbuf,
Vector vc1 
)

    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, ....
    see AP_vec_txt

int AP_get_nxtVec ( int  mode  ) 

int AP_cmp_typ ( int  typ1,
int  typ2 
)

int AP_typ_2_bastyp ( int  typ  ) 

    give basictyp from typ;
    makes Typ_SURRU -> Typ_SUR   or Typ_CVBSP -> Typ_CV.
    
    siehe AP_name_typInd AP_cmp_typ

char AP_typChar_typ ( int  typ  ) 

    AP_typChar_typ      make typChar from typ  (Typ_PT -> 'P')
    Error: returns '-'

int AP_test__ (  ) 

int AP_Get_Setup ( char *  cbufo,
char *  ctyps 
)

get line from gCAD3D.rc

int AP_Set_ConstPl_Z ( char *  cbuf  ) 

int AP_Get_ConstPl_vz ( Vector vc  ) 

char* AP_Get_ConstPl_Z ( int  typ  ) 

    typ = 0       returns the active ConstrPln as Text; zB "RZ" or "R22"
    typ = Typ_VC  returns the Z-vec of the active ConstrPln as Text

int AP_PT2EyeBp ( char *  plnTyp,
Point p1,
Point p2,
Point p3,
Vector vcs 
)

int AP_PT2EyePln ( Point pt,
char *  plnTyp,
Point p1,
Point p2,
Point p3,
Vector vcs 
)

int ACT_ck_act ( long  dli  ) 

    check if selected obj is connected to interactivity and activate activity.
    RecCod:
      0=Yes, interactivity performed;
     -1=No, normal object.

void GR_tmpSym ( int  typ,
Point pt1 
)


Variable Documentation

int UI_InpSM

char APP_act_nam[64]

int aus_anz

int* aus_typ = NULL

    used for objTypes in APT_decode_ausdr
    in WC_Work1: GLT_cta;
    in IE:       memspc55   

double* aus_tab = NULL

    used for objData in APT_decode_ausdr
    in WC_Work1: GLT_pta;
    in IE:       memspc54

int aus_SIZ

size of aus_typ & aus_tab

char memspc011[1024]

char memspc012[1024]

char memspc50[50000]

char memspc51[50000]

char memspc52[50000]

char memspc53[50000]

char memspc54[50000]

char memspc55[50000]

char memspc101[100000]

char memspc102[100000]

char memspc201[200000]

char memspc501[500000]

char mem_cbuf1[mem_cbuf1_SIZ]

char IE_buf[mem_cbuf1_SIZ]

char IE_outTxt[mem_cbuf1_SIZ]

char WC_modnam[128]

active Modelname - without path

char WC_modact[128]

name of the active submodel; def="" (main)

int WC_modnr = -1

the Nr of the active submodel; -1 = main.

int WC_mod_stat = -1

-1=primary Model is active;

der Model-Origin

die fuer Definition (zB P10=0,0) aktive Plane

die aktive Plane

double WC_sur_Z = 0.0

active Z-value of WC_sur_sur;

int WC_sur_ind = 0

Der Index auf die ActiveConstrPlane.

Index auf die ActiveConstrPlane.

TrMat of ActiveConstrPlane.

inverse TrMat of ActiveConstrPlane

char WC_ConstPl_Z[16]

ConstPl-Z-axis (DZ, ...R20 ...

int AP_src = AP_SRC_EDI

AP_SRC_MEM or AP_SRC_EDI.

double AP_txsiz = 3.5

Notes-Defaultsize.

double AP_txdimsiz = 2.5

Dimensions-Text-Defaultsize.

Dimensions-Text-size.

int AP_txNkNr = 2

Nachkommastellen.

the active color ..

die DefaultColor des aktiven (sub)Model

int AP_indCol

der DL-Index der aktuellen defCol

int WC_stat_bound = OFF

ON OFF; Draw boundary of Flächen J/N.

char** AP_argv

char AP_dir_open[128]

directory for OPEN

char AP_sym_open[64]

symbolic directory for OPEN

char AP_dir_save[128]

directory for SAVE

char AP_sym_save[64]

symbolic directory for SAVE

char AP_dir_prg[128]

directory for programs

char AP_sym_prg[64]

symbolic directory for programs

char AP_printer[80]

Printer.

char AP_browser[64]

HTML-browser.

char AP_lang[4]

en or de

progress of Start

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

   1 starting
   2 voll initialisert.
  65 Batch, else interaktiv.

long AP_ED_lNr = 0 [static]

die aktuelle Line# im Edi.

int AP_ED_cPos = 0

die aktuelle CharPos im Edi.

char AP_ED_oNam[64]

objectName of active Line


Generated on Sat May 30 09:31:56 2009 for gCAD3D by  doxygen 1.5.6