gCAD3D 2.35
dxf_r.c File Reference

read, write DXF-files More...

#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../ut/ut_geo.h"
#include "../ut/ut_txt.h"
#include "../ut/ut_TX.h"
#include "../ut/ut_txTab.h"
#include "../ut/ut_os.h"
#include "../ut/ut_cast.h"
#include "../ut/ut_ox_base.h"
#include "../ut/func_types.h"
#include "../db/ut_DB.h"
#include "../xa/xa.h"
#include "../xa/xa_mem.h"
#include "../xa/xa_sele.h"
#include "../exp/dxf_r.h"

Macros

#define DXF_FuncEnd   1234
 
#define DXF_fakt_txtSiz   32.0
 
#define DXF_SIZ_TXBUF   10000
 
#define SPC_TRA_SIZ   500000
 

Functions

static UtxTab_NEW (dxfr_blockTab)
 
int DXF_r__ (char *fnam)
 
int dxfr_sm__ (int *mr_ind, ModelRef *mdr)
 
int dxf_ckFileFormat (char *fnam)
 
int dxfr_init (double *dTab, FILE *fp_in, FILE *fp1)
 
int dxfr_head__ (double *dTab, FILE *fp_in, FILE *fp1)
 
int dxfr_block_find (FILE *fp_in, FILE *fp1, char *BlockNam)
 
int dxfr_section_skip (FILE *fp_in, FILE *fp1)
 
int dxfr_block_skip (FILE *fp_in, FILE *fp1)
 
int dxfr_rec_read (FILE *fp_in, FILE *fp1)
 
int dxf_log ()
 
int dxfr_rec__ (ObjGX **el, FILE *fp_in, FILE *fp1, Memspc *wrkSpc)
 
void dxfr_tra_arc (Circ *ci1, Mat_4x3 m1, Point *ptc, double wa, double we, double crd)
 
int dxf_ac_bulge_2pt (Circ2 *ci1, Point2 *p1, Point2 *p2, double *bulge)
 
int dxf_out_lwpoly (int pNr, int iClo)
 
int dxfr_out_txt (ObjGX **ox, Memspc *wrkSpc)
 
int dxf_r_src_out (ObjGX *ox1)
 

Variables

double AP_txsiz
 Notes-Defaultsize. More...
 
double AP_txdimsiz
 Dimensions-Text-Defaultsize. More...
 
double APT_ModSiz
 
static int dxf_TypTab []
 
static char * dxf_NamTab []
 
static int dxf_siz_linbuf
 
static char * dxf_linbuf
 
static char dxf_numbuf [64]
 
static char BlockNam [80]
 
static char * dxf_ptr
 
static int dxf_rectyp
 
static long dxf_LineNr
 
static int dxf_GroupTyp = 0
 
static int dxF_VertAnz
 
static Pointdxf_pa
 
static int dxf_paSiz
 
static int dxf_paNr
 
static double * dxf_da
 
static int dxf_daSiz
 
static int dxf_daNr
 
static ObjGX dxf_ox1
 
static int dxf_blk_lev
 
static int dxf_blk_tab [10]
 
static int dxf_iTra = 0
 
static char dxfr_s_1 [256]
 
static double dxfr_d_40
 
static Point dxfr_pta_10 [10]
 
static Memspc DXFR_SPC_TRA
 
static int dxf_unsupp [8]
 

Detailed Description

read, write DXF-files

=====================================================
List_functions_start:
DXF_r__ mainEntry
dxfr_rec__ read next record
dxf_r_src_out translate obj & export obj
dxfr_out_txt create gcad-obj txt
dxfr_init open, skip until ENTITIES-section
dxfr_head__ decode headersection
dxfr_block_find find Block
dxfr_section_skip skip unsupported sections
dxfr_block_skip skip unsupported blocks
dxfr_rec_read read next 2 lines
dxfr_tra_arc transform circle
dxf_log display Logmessages
dxf_ac_bulge_2pt create 2D-cirle from bulge-value and 2 points
List_functions_end:
=====================================================

Macro Definition Documentation

#define DXF_FuncEnd   1234
#define DXF_fakt_txtSiz   32.0
#define DXF_SIZ_TXBUF   10000
#define SPC_TRA_SIZ   500000

Function Documentation

static UtxTab_NEW ( dxfr_blockTab  )
static
int DXF_r__ ( char *  fnam)

load DXF-file -> memory All coordinates are translated !

int dxfr_sm__ ( int *  mr_ind,
ModelRef mdr 
)
int dxf_ckFileFormat ( char *  fnam)
int dxfr_init ( double *  dTab,
FILE *  fp_in,
FILE *  fp1 
)
int dxfr_head__ ( double *  dTab,
FILE *  fp_in,
FILE *  fp1 
)
int dxfr_block_find ( FILE *  fp_in,
FILE *  fp1,
char *  BlockNam 
)
int dxfr_section_skip ( FILE *  fp_in,
FILE *  fp1 
)
int dxfr_block_skip ( FILE *  fp_in,
FILE *  fp1 
)
int dxfr_rec_read ( FILE *  fp_in,
FILE *  fp1 
)
int dxf_log ( )
int dxfr_rec__ ( ObjGX **  el,
FILE *  fp_in,
FILE *  fp1,
Memspc wrkSpc 
)
void dxfr_tra_arc ( Circ ci1,
Mat_4x3  m1,
Point ptc,
double  wa,
double  we,
double  crd 
)
int dxf_ac_bulge_2pt ( Circ2 ci1,
Point2 p1,
Point2 p2,
double *  bulge 
)
int dxf_out_lwpoly ( int  pNr,
int  iClo 
)
int dxfr_out_txt ( ObjGX **  ox,
Memspc wrkSpc 
)
int dxf_r_src_out ( ObjGX ox1)

Variable Documentation

double AP_txsiz

Notes-Defaultsize.

double AP_txdimsiz

Dimensions-Text-Defaultsize.

Dimensions-Text-size.

double APT_ModSiz
int dxf_TypTab[]
static
Initial value:
#define Typ_SURHAT
A Hatch.
Definition: AP_types.h:106
#define Typ_apDat
application-data Typ_APPOBJ
Definition: AP_types.h:222
#define Typ_PT
P Point.
Definition: AP_types.h:60
#define Typ_CVBSP
S CurvBSpl.
Definition: AP_types.h:73
#define DXF_FuncEnd
Definition: dxf_r.c:552
#define Typ_Error
U0 = undefined.
Definition: AP_types.h:55
#define Typ_Txt
text
Definition: AP_types.h:249
#define Typ_Group
U ObjDB DB-Objects (union-group)
Definition: AP_types.h:174
#define Typ_SURCIR
tesselated fan
Definition: AP_types.h:109
#define Typ_CVELL
S CurvElli.
Definition: AP_types.h:75
#define Typ_GTXT
N GText (grafic text)
Definition: AP_types.h:143
#define Typ_LN
L Line.
Definition: AP_types.h:61
#define Typ_Dimen
N Dimen (dimension)
Definition: AP_types.h:144
#define Typ_SOL
DB-bodies 80-89.
Definition: AP_types.h:132
#define Typ_CVPOL
S CurvPoly.
Definition: AP_types.h:71
#define Typ_CI
C Circ.
Definition: AP_types.h:62
#define Typ_G_Att
G.
Definition: AP_types.h:217
char* dxf_NamTab[]
static
Initial value:
={"POINT", "VERTEX", "LINE", "CIRCLE", "ARC",
"POLYLINE", "SEQEND", "3DLINE", "TEXT", "INSERT",
"TEXT", "ELLIPSE", "DIMENSION","3DFACE", "LEADER",
"MTEXT", "LWPOLYLINE","SPLINE", "HATCH", "SOLID",
"ATTRIB", "ATTDEF", "IMAGE", "VIEWPORT","SPLINE",
"HATCH", "SOLID", "ATTDEF", "3DSOLID",""}
int dxf_siz_linbuf
static
char* dxf_linbuf
static
char dxf_numbuf[64]
static
char BlockNam[80]
static
char * dxf_ptr
static
int dxf_rectyp
static
long dxf_LineNr
static
int dxf_GroupTyp = 0
static
int dxF_VertAnz
static
Point* dxf_pa
static
int dxf_paSiz
static
int dxf_paNr
static
double* dxf_da
static
int dxf_daSiz
static
int dxf_daNr
static
ObjGX dxf_ox1
static
int dxf_blk_lev
static
int dxf_blk_tab[10]
static
int dxf_iTra = 0
static
char dxfr_s_1[256]
static
double dxfr_d_40
static
Point dxfr_pta_10[10]
static
Memspc DXFR_SPC_TRA
static
int dxf_unsupp[8]
static