gCAD3D 2.40
ut_GL.h
Go to the documentation of this file.
1 /*
2 
3 
4 Korr:
5 2001-06-08 Taginfos zu.
6 
7 
8 =======================================================================*/
9 #define GR_MODE_DRAW 0
10 #define GR_MODE_SELECT 1
11 #define GR_MODE_FEEDBACK 2
12 #define GR_MODE_NORMAL 3
13 #define GR_MODE_PRINT1 4
14 #define GR_MODE_PRINT2 5
15 #define GR_MODE_2DSELECT 6
16 
17 #define GR_STATE_WIRE 0
18 #define GR_STATE_SHADE 1
19 #define GR_STATE_HID1 2
20 #define GR_STATE_HID2 3
21 #define GR_STATE_HID3 4
22 
23 
24 
25 //----------------------------------------------------------------
26 #define DL_base_font1 32 // End of tempObj-range (1-DL_base_font1)
27  // start of Bitmapfont (alfatext)
28 #define DL_Ind_ScBack 129 // index of the scaleback-record (glPopMatrix)
29  // 130-138 Bitmap-Symbols
30  // 139 Vector
31  // 140-149 Vector-Symbols (scaled)
32 #define DL_base_LnAtt 150 // LineAttributes until DL_base_PtAtt
33 #define DL_base_PtAtt 195 // PointAttributes until DL_base_font2
34 #define DL_base_font2 200 // fontObjs until DL_Ind_Scl2D (200=Blank=Ascii 32)
35 #define DL_Ind_Scl2D 297 // DL_Set_Scl2D
36 #define DL_Ind_Cen2D 298 // set to 2D-screenCenter DL_Set_Cen2D
37 #define DL_Img_ScBack 299 // index for scale images (DL_Img_ScBack)
38 #define DL_OnTop__ 300 // overwrite-all (glDepthFunc (GL_ALWAYS))
39 #define DL_OnTopOff 301 // reset "overwrite-all"
40 #define DL_base_mod 310 // first index of BasModelnames (DL_base_mod)
41  // next is DL_base__ - first index of normal objects
42 
43 
44 
45 //----------------------------------------------------------------
46 void GL2D_pos_move (int dx, int dy);
47 void GL_DefineView (int);
48 void GL_DefineDisp (int, int);
49 
50 void GL_Init__ (int, int, int);
51 void GL_Init0 ();
52 void GL_Init1 ();
53 void GL_Init_View ();
54 void GL_InitPtAtt (int ithick);
55 int GL_InitNewAtt (int, int);
56 void GL_InitSymb ();
57 void GL_InitAFont ();
58 void GL_InitGFont ();
59 int GL_InitGF2 (int ind, int ianz, char mode[], Point2 *pta);
60 void GL_InitModelSize (double, int);
61 
62 void GL_Redraw ();
63 void GL_Redraw1 ();
64 
65 void GL_Reframe ();
66 void GL_Reframe1 ();
67 
68 void GL_Translate ();
69 void GL_Transl_Vert ();
70 void GL_Transl_VertP (Point*);
71 
72 void GL_Del0 (long);
73 void GL_Delete (long);
74 
75 void GL_GetGLMat0 ();
76 void GL_GetNormal0 ();
77 void GL_GetActPlane ();
81 Point GL_GetCen ();
82 Point GL_GetViewPt (Point *pti);
84 
85 long GL_Get_DLind ();
86 long GL_GetActInd ();
87 
88 double GL_get_Scale ();
89 double GL_query_ViewZ ();
90 
91 
92 void* GL_Print1 (int *iw, int *ih);
93 // int GL_Select (int, int*, long*, long*);
94 int GL_Feedback (int*, float*, int);
95 
96 void GL_Sk2Uk (double *,double *,double *,double,double,double);
97 void GL_Uk2Sk (double *,double *,double *,double,double,double);
98 
99 void GL_Do_Idle (int*, int*, int, int);
100 void GL_Do_Pan (int, int);
101 void GL_Do_Rot (int, int);
102 void GL_Do_Rot1 ();
103 void GL_Do_CenRot (double);
104 void GL_Do_Scale (int, int);
105 void GL_Set_Scale (double);
106 int GL_View_set (double[]);
107 int GL_View_get (double[]);
108 int GL_Set_Cen (Point *Ucen);
109 
110 void GL_Do_RubberBox ();
111 void GL_Start_RubberBox ();
112 void GL_Stop_RubberX (double *, Point *);
113 
114 void GL_Reshape (int, int);
115 void GL_Clear ();
116 void GL_Resize (int, int);
117 void GL_Rescale (double, Point*);
118 
119 
120 void GL_Draw_Ini (long*, int);
121 void GL_Disp_ln (Point*, Point*);
122 int GL_Disp_patch (int gTyp, int ptNr, Point *pa);
123 int GL_Disp_ipatch (int gTyp, int iNr, int *ia, Point *pa);
124 void GL_Disp_npt (Point *pa, int ptNr);
125 
126 void GL_DrawPoint (long*, int, Point*);
127 void GL_DrawLine (long*, int, Line*);
128 void GL_DrawLtab (long *ind, int attInd, Line *lna, int lNr);
129 void GL_DrawVec (long*, int, Point*, Vector*);
130 void GL_DrawPoly2D (long*, int, int, Point2[], double);
131 void GL_DrawPoly (long*, int, int, Point*);
132 
133 // void GL_DrawQFac (long*, int, ObjG2*, double, ObjG2*, double);
134 // void GL_DrawRFac (long*, int, ObjG2*, double, ObjG2*, double);
135 // void GL_DrawRCone (long*, int, ObjG2*, double, ObjG2*, double);
136 
137 void GL_DrawRSur (long *ind,int attInd,int ptAnz,Point *pa1,Point *pa2);
138 int GL_DrawStrip1 (Point *ps, Point *pa1, Point *pa2, int ptAnz);
139 int GL_DrawStrip2 (Point *pa1, Point *pa2, int ptAnz, int newS);
140 void GL_DrawFan (Point *pt1,int ptAnz,Point *pa1,int side, int newS);
141 
142 void GL_DrawSymB (long*, int, int att, Point*);
143 void GL_DrawSymV (long*, int, int att, Point*, double);
144 void GL_DrawSymV2 (long*, int, int att, Point*, Point*, double);
145 void GL_DrawSymV3 (long*, int, int att, Point*, Vector*, double);
146 void GL_DrawTxtA (long*, int, Point *, char *);
147 void GL_Disp_txtA (Point*, char*);
148 void GL_DrawTxtG (long *ind, int att, GText *tx1);
149 // void GL_DrawTxtG (long *ind, int att,
150  // Point *P1, float size, float ang, char *txt);
151 void GL_DrawDimen (long *ind, int att, Dimen *dim1);
152 void GL_DrawDitto2 (long *ind, Point *p1, double az, char mir, Ditto *di);
153 int GL_DrawModel (long *ind, int att, ModelRef *mdr, ModelBas *mdb);
154 
155 int GL_txt__ (int dMod, int bMod,
156  Point *ptx, double txAng, double ay, double az,
157  double scale, char *txt);
158 
159  void GL_temp_del_1 (long ind);
160  void GL_temp_del_all ();
161  long GL_temp_GetInd ();
162  long GL_GetInd_temp ();
163  long GL_GetInd_last_temp ();
164 
165 
166 int GRU_teileArc (Point2*, int*, ObjG2*);
167 int GRU_teileArc1 (Point2*, int, ObjG2*);
168 int GRU_teileLin (Point2*, int, Point2*, Point2*);
169 
170 void GRU_calc_normal (Vector*, Point*, Point*, Point*);
171 void GRU_calc_normal2 (Vector*, Point2*,Point2*,Point2*, double,double);
172 
173 // void GL_Test (long);
174 
175 
176 // #define GL_ptArr30Siz 1000
177 // #define GL_ptArr31Siz 140
178 // #define GL_ptArr32Siz 140
179 
180 
181 // size of Alfa-text (2D-Text, always normal to eye)
182 #define GLTXA_sizCX 8 // width character-bitmap
183 #define GLTXA_sizCY 13
184 #define GLTXA_sizBX 10 // width block; 8 + 2;
185 #define GLTXA_sizBY 17 // height block; 2 + sizCY + 2;
186 
187 
188 // relative move of the screenPos in screencoords
189 #define GL2D_pos_move(dx,dy) glBitmap (0,0,0.f,0.f,(float)dx,(float)dy,NULL)
190 
191 // save the current color & rasterPosition
192 #define GL2D_pos_set() glPushAttrib (GL_CURRENT_BIT)
193 
194 // restore color & rasterPosition
195 #define GL2D_pos_get glPopAttrib
196 
197 
198 
199 extern int GL_pickSiz ; // SelectionDistance in Pixel (ScreenCoords)
200 
201 
202 
203 /* ==================== EOF =============================== */
void GL_GetGLMat0(void)
Definition: ut_GL.c:2830
int GL_pickSiz
void GL_temp_del_all()
Definition: xa_batch.c:501
double GL_query_ViewZ()
Definition: ut_GL.c:16110
int GL_DrawModel(long *ind, int att, ModelRef *mdr, ModelBas *mdb)
Definition: ut_GL.c:13953
int GRU_teileArc1(Point2 *pta, int ptAnz, ObjG2 *o1)
Definition: gru.c:666
void GL_DrawTxtG(long *ind, int att, GText *tx1)
Definition: ut_GL.c:13573
int GL_txt__(int dMod, int bMod, Point *ptx, double txAng, double ay, double az, double scale, char *txt)
Definition: ut_GL.c:12912
void GL_DrawPoly2D()
Definition: xa_batch.c:522
void GL_GetActPlane()
void GL_Translate()
Definition: ut_GL.c:1614
void GL_Set_Scale(double Scale)
Definition: ut_GL.c:6655
void GL_InitAFont()
Definition: ut_GL.c:14655
int GL_Set_Cen(Point *Ucen)
Definition: ut_GL.c:6753
void GL_DefineView(int mode)
Definition: ut_GL.c:3192
void GL_InitPtAtt()
Definition: xa_batch.c:498
static Point pa[PT_MAX]
Definition: tst_gl1.c:108
void GL_DefineDisp(int mode, int mode1)
Definition: ut_GL.c:3304
3D-line, Typ_LN
Definition: ut_geo.h:367
void GL_Disp_npt(Point *pa, int ptNr)
Definition: ut_GL.c:7901
Point GL_GetViewPos()
Definition: ut_GL.c:5695
char mode
Definition: xa_tra.c:152
void GL_DrawFan(Point *pt1, int ptNr, Point *pa1, int typ, int newS)
Definition: ut_GL.c:8994
void GL_Init__(int mode, int width, int height)
Definition: ut_GL.c:15376
void GRU_calc_normal2(Vector *vc, Point2 *p1, Point2 *p2, Point2 *p3, double z1, double z2)
Definition: gru.c:810
void GL_Init0()
Definition: ut_GL.c:3020
void GL_Clear()
Definition: xa_batch.c:503
double GL_get_Scale()
Definition: ut_GL.c:16120
long GL_temp_GetInd()
Definition: ut_GL.c:3845
void GL_Uk2Sk(double *sx, double *sy, double *sz, double ux, double uy, double uz)
Definition: ut_GL.c:2914
void GL_DrawTxtA(long *ind, int att, Point *P1, char *txt)
Definition: ut_GL.c:11944
dimension; Typ_Dimen
Definition: ut_geo.h:894
void GL_Delete()
Definition: xa_batch.c:500
model reference; Typ_Model
Definition: ut_geo.h:835
void GL_Do_Rot(int, int)
void GL_Reframe1()
Definition: ut_GL.c:1572
void GL_Init1()
Definition: ut_GL.c:3075
static Point pt1
Definition: DemoPlugin_Dialog.c:85
void GL_DrawSymV2()
Definition: xa_batch.c:518
void * GL_Print1(int *iw, int *ih)
Definition: ut_GL.c:4276
long GL_GetInd_temp()
Definition: ut_GL.c:3865
void GL_Transl_Vert()
internal submodel (block); Typ_Ditto
Definition: ut_geo.h:801
void GL_DrawSymV()
Definition: xa_batch.c:517
static int ptNr
Definition: tst_gl1.c:109
int GRU_teileArc(Point2 *pta, int *ptAnz, ObjG2 *o1)
Definition: gru.c:617
void GL_DrawDimen(long *ind, int att, Dimen *dim1)
Definition: ut_GL.c:12830
int GL_Disp_ipatch(int gTyp, int iNr, int *ia, Point *pa)
Definition: ut_GL.c:9722
void GL_Reframe()
void GL_DrawVec()
Definition: xa_batch.c:520
grafic text; Typ_GTXT
Definition: ut_geo.h:748
void GL_Transl_VertP(Point *pt1)
Definition: ut_GL.c:1635
int GRU_teileLin(Point2 *pta, int ptAnz, Point2 *p1, Point2 *p2)
Definition: gru.c:711
void GL_Redraw1()
void GL_View_get()
Definition: xa_batch.c:493
void GL_Do_Pan(int, int)
int GL_DrawStrip2(Point *pa, Point *pb, int ptNr, int newS)
Definition: ut_GL.c:8775
void GL_DrawPoint()
Definition: xa_batch.c:523
int GL_Disp_patch(int gTyp, int ptNr, Point *pa)
Definition: ut_GL.c:9690
void GL_Disp_ln(Point *p1, Point *p2)
Definition: ut_GL.c:7918
void GL_InitSymb()
Definition: ut_GL.c:14815
void GL_Rescale(double scl, Point *Ucen)
Definition: ut_GL.c:7073
3D-point, Typ_PT
Definition: tessbug1.c:66
void GL_Del0()
Definition: xa_batch.c:499
Point GL_GetViewPt(Point *pti)
Definition: ut_GL.c:5552
void GL_DrawSymB()
Definition: xa_batch.c:516
basic model description; Typ_SubModel
Definition: ut_geo.h:826
void GL_Resize(int w, int h)
Definition: ut_GL.c:14246
void GL_Do_Idle(int *dx, int *dy, int x, int y)
Definition: ut_GL.c:5844
void GL_DrawLine(long *ind, int iAtt, Line *ln1)
Definition: ut_GL.c:7769
3D-vector, Typ_VC
Definition: tst_glDrawElements1.c:58
void GL_GetActInd()
Definition: xa_batch.c:494
void GL_View_set()
Definition: xa_batch.c:504
void GL_Do_Scale(int, int)
void GL_Start_RubberBox()
void GL_Do_Rot1()
Vector GL_GetEyeX()
Definition: ut_GL.c:5610
Point GL_GetCurPos()
Definition: ut_GL.c:5664
2D-point, Typ_PT2
Definition: ut_geo.h:190
int GL_Feedback(GLint *size, GLfloat *feedBuffer, GLint idim)
Definition: ut_GL.c:1821
Point GL_GetCen()
Definition: xa_batch.c:496
void GL_Stop_RubberX(double *, Point *)
int GRU_calc_normal(Vector *vc, Point *p1, Point *p2, Point *p3)
Definition: gru.c:754
void GL_DrawDitto2(long *ind, Point *p1, double az, char mir, Ditto *di)
Definition: ut_GL.c:13734
void GL_Do_CenRot(double zval)
Definition: ut_GL.c:5907
Point GL_GetConstrPos(Point *pt1)
Definition: ut_GL.c:5776
long lNr
Definition: xa_tra.c:150
void GL_Disp_txtA(Point *P1, char *txt)
Definition: ut_GL.c:11980
void GL_InitGFont()
Definition: ut_GL.c:14684
void GL_Draw_Ini(long *ind, int attInd)
Definition: ut_GL.c:7619
#define GL2D_pos_move(dx, dy)
Definition: ut_GL.h:189
void GL_Do_RubberBox()
Definition: ut_geo.h:298
void GL_Init_View()
Definition: ut_GL.c:3126
int GL_InitNewAtt(int mode, int Ind)
Definition: ut_GL.c:14510
int GL_InitGF2(int ind, int ianz, char mode[], Point2 *pta)
Definition: ut_GL.c:14743
void GL_DrawLtab(long *ind, int iAtt, Line *lna, int lNr)
Definition: ut_GL.c:7858
void GL_Sk2Uk(double *ux, double *uy, double *uz, double sx, double sy, double sz)
Definition: ut_GL.c:2936
void GL_Reshape(int width, int height)
Definition: ut_GL.c:6729
void GL_GetNormal0()
int ind
Definition: xa_tra.c:151
long GL_GetInd_last_temp()
Definition: ut_GL.c:3855
void GL_DrawPoly()
Definition: xa_batch.c:521
void GL_InitModelSize()
Definition: xa_batch.c:508
void GL_Get_DLind()
Definition: xa_batch.c:495
void GL_temp_del_1(long ind)
Definition: ut_GL.c:3799
void GL_Redraw()
Definition: ut_GL.c:1972
void GL_DrawRSur(long *ind, int attInd, int ptAnz, Point *pa1, Point *pa2)
Definition: ut_GL.c:8603
void GL_DrawSymV3()
Definition: xa_batch.c:519
int GL_DrawStrip1(Point *ps, Point *pa1, Point *pa2, int ptAnz)
Definition: ut_GL.c:8688