gCAD3D 2.35
xa_obj_txt.c File Reference

convert objects –> APT-Text More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "../ut/ut_geo.h"
#include "../db/ut_DB.h"
#include "../xa/xa_obj_txt.h"

Functions

int AP_view_2_txt (char *txOut)
 
int AP_obj_set_last (char *ED_buf1)
 
int AP_obj_add_last (char *ED_buf1, long bufLen)
 
int AP_obj_add_val (char *ED_buf1, double val)
 
int AP_obj_add_int (char *ED_buf1, int ival)
 
int AP_obj_add_nval (char *ED_buf1, int iNr, double *va)
 
int AP_obj_add_pt_sp (char *ED_buf1, Point *pt1)
 
int AP_obj_add_pt (char *ED_buf1, Point *pt1)
 
int AP_obj_add_pt2 (char *ED_buf1, Point2 *pt1)
 
int AP_obj_add_pt3 (char *ED_buf1, Point *pt1)
 
int AP_obj_add_ln (char *ED_buf1, int mode, Point *pt1, Point *pt2)
 
int AP_obj_add_ci_ (char *ED_buf1, Circ *ci1)
 
int AP_obj_add_ci2 (char *ED_buf1, int mode, Circ *ci1)
 
int AP_obj_add_ci1 (char *ED_buf1, Point *pc, double *rdc, Vector *vz)
 
void AP_obj_blank (char *ED_buf1)
 
int AP_obj_add_vc (char *ED_buf1, Vector *vc1)
 
int AP_obj_add_vc0 (char *ED_buf1, Vector *vc1)
 
int AP_obj_add_cvBsp_p (char *so, int soSiz, Point *pa, int ptNr, int deg, int ctrl)
 
int AP_obj_add_cvBsp_b (char *ED_buf1, long bufLen, CurvBSpl *cv1)
 
int AP_obj_add_func1 (char *ED_buf1, int mode, double ang1)
 
int AP_obj_add_curPos (char *ED_buf1)
 
int AP_obj_add_obj (char *ED_buf1, int typ, long ind)
 
int AP_obj_2_txt_query (int *typ, long *ind)
 
int AP_obj_hdr_sur (char *ED_buf1, long bufLen, ObjGX *o1, long ind)
 
int AP_obj_2_txt (char *ED_buf1, long bufLen, ObjGX *o1, long ind)
 
int AP_stru_2_txt (char *ED_buf1, long bufLen, ObjGX *o1, long ind)
 

Variables

static int act_typ
 
static long act_ind
 
static long su_ind
 

Detailed Description

convert objects –> APT-Text

=====================================================
List_functions_start:
AP_stru_2_txt convert object-struct -> source-text
AP_obj_2_txt change obj to text and save it with UTF_add1_line
AP_obj_add_obj add typ,Ind; zB Typ_PT,10 --> "P10"
AP_obj_add_val add double (10 Nachkommastellen)
AP_obj_add_nval add n doubles (10 Nachkommastellen)
AP_obj_add_pt add Point* as "P(xyz)"
AP_obj_add_pt_sp add point mit reduced precision
AP_obj_add_pt2 add 2D-point
AP_obj_add_pt3 old version; do not use.
AP_obj_add_vc add Vector zB "DZ" or "D(0 0 1)"
AP_obj_add_vc0 add Vector as D(0 0 1)"
AP_obj_add_ln add Line as "L(Pa Pe)"
AP_obj_add_ci_ add Circ as "C(P(ptStart) P(ptEnd) P(ptCen) D(vz))"
AP_obj_add_ci1 add Circ as "C(P(100 100 0) 32 DZ)"
AP_obj_add_ci2 old version; do not use.
AP_obj_add_cvBsp_b add "BSP,...." with binary data block as ascii
AP_obj_add_cvBsp_p add "BSP,P(..) P(.." with points
AP_obj_add_func1 add [ANG|DIST|X|R|Y](<val>)
AP_obj_add_curPos add cursor-position as "P(x y z)" to string
AP_obj_blank add blank but not after '=' or '|' or blank
AP_obj_2_txt_query get typ and DB-index of last created Textline
AP_obj_add_last add last created object to buffer
AP_obj_hdr_sur create textHeader for A
AP_view_2_txt give Textline "VIEW .."
List_functions_end:
=====================================================
see also:
APED_dbo_oid Text -> (Typ, Ind)
APED_oid_dbo__ (Typ, Ind) -> Text

Function Documentation

int AP_view_2_txt ( char *  txOut)

AP_view_2_txt give Textline "VIEW .."

int AP_obj_set_last ( char *  ED_buf1)

set act_typ/act_ind

int AP_obj_add_last ( char *  ED_buf1,
long  bufLen 
)

add last created object to buffer

int AP_obj_add_val ( char *  ED_buf1,
double  val 
)

add double mit voller Genauigkeit (10 Nachkommastellen)

int AP_obj_add_int ( char *  ED_buf1,
int  ival 
)

add double mit voller Genauigkeit (10 Nachkommastellen)

int AP_obj_add_nval ( char *  ED_buf1,
int  iNr,
double *  va 
)
AP_obj_add_nval add iNr doubles separated with blanks to ED_buf1
10 digits after comma
int AP_obj_add_pt_sp ( char *  ED_buf1,
Point pt1 
)

add point mit reduced precision

int AP_obj_add_pt ( char *  ED_buf1,
Point pt1 
)
add struct Point* to string " P(x y [z])"
10 digits after comma
see AP_obj_add_pt_rp (reduced precision)
int AP_obj_add_pt2 ( char *  ED_buf1,
Point2 pt1 
)
add 2D-point-coordinates to string " P(x y)"
10 digits after comma
int AP_obj_add_pt3 ( char *  ED_buf1,
Point pt1 
)

keine Blanks vorn u hint

int AP_obj_add_ln ( char *  ED_buf1,
int  mode,
Point pt1,
Point pt2 
)
add line to string;
mode = 0: L(Pa Pe)
mode = 1: L(Pe)
int AP_obj_add_ci_ ( char *  ED_buf1,
Circ ci1 
)

add Circle as C(P(ptStart) P(ptEnd) P(ptCen) D(vz))

int AP_obj_add_ci2 ( char *  ED_buf1,
int  mode,
Circ ci1 
)
DO NOT USE - OLD VERSION !
mode = 0: C(Pa Pe Pc Dreh)
mode = 1: C(Pe Pc Dreh)
int AP_obj_add_ci1 ( char *  ED_buf1,
Point pc,
double *  rdc,
Vector vz 
)
add 3D-Circ to string as "C(P(100 100 0) 32 DZ)"
Input: center, radius, Z-Vec
void AP_obj_blank ( char *  ED_buf1)

do NOT add blank after = ( blank.

int AP_obj_add_vc ( char *  ED_buf1,
Vector vc1 
)
add struct Vector* to string " D(x y z)"
int AP_obj_add_vc0 ( char *  ED_buf1,
Vector vc1 
)

vec -> txt ("D(dx dy dz)"); no Standardvectors.

int AP_obj_add_cvBsp_p ( char *  so,
int  soSiz,
Point pa,
int  ptNr,
int  deg,
int  ctrl 
)
AP_obj_add_cvBsp_p add "BSP,P(..) P(.." with points
Input:
soSiz size of outputbuffer so
pa points
ptNr nr of points
deg degree; default = 2
ctrl 0=curve through points; 1=points are controlpoints
int AP_obj_add_cvBsp_b ( char *  ED_buf1,
long  bufLen,
CurvBSpl cv1 
)

AP_obj_add_cvBsp_b add "BSP,...." with binary data block as ascii

int AP_obj_add_func1 ( char *  ED_buf1,
int  mode,
double  ang1 
)

mode: A D X R Y

int AP_obj_add_curPos ( char *  ED_buf1)

add cursor-position as "P(x y z)" to string

int AP_obj_add_obj ( char *  ED_buf1,
int  typ,
long  ind 
)
add objname to string; " L22"
Input obj-typ und DB-index
int AP_obj_2_txt_query ( int *  typ,
long *  ind 
)

AP_obj_2_txt_query get typ and DB-index of last created Textline

int AP_obj_hdr_sur ( char *  ED_buf1,
long  bufLen,
ObjGX o1,
long  ind 
)

returns next free index for surface and "A<index>" in ED_buf1 o1 unused

int AP_obj_2_txt ( char *  ED_buf1,
long  bufLen,
ObjGX o1,
long  ind 
)
change obj to text and save it with UTF_add1_line
Input:
ind DB-index; for -1L a new (free) index is used.
o1
Output:
ED_buf1
retCod 0 OK
-1 out of mem
Example see UTF_insert1
get get db-typ, db-ind with AP_obj_2_txt_query () (after AP_obj_2_txt)
see UTRA_app_oTab AP_stru_2_txt
int AP_stru_2_txt ( char *  ED_buf1,
long  bufLen,
ObjGX o1,
long  ind 
)
convert object-struct -> source-text (definition-line)
ED_buf1=NULL,ind=0: Init DB-indices
ED_buf1=NULL,ind=1: query DB-indices (o1=int[7])
Die Objektindexe muessen initialisiert werden; init mit o1->typ=TYP_FuncInit
In und Out: pt_ind wird um 1 incrementiert !
Input:
o1
ind DB-index; for -1L a new (free) index is used.
bufLen max siz of ED_buf1
Output:
ED_buf1 source-obj; init function if NULL.
RC = -1: Fehler am Objekt, weiter.
RC = -2: Ueberlauf; sofort abbrechen.

Variable Documentation

int act_typ
static
long act_ind
static
long su_ind
static