/*! \page pag_pf ProgramFlow 
../../doc/gcad_doxygen/ProgramFlow.dox

<pre>
\ref Startup
\ref Workflow
\ref Events
\ref Edit_mem
\ref Edit_edi

\ref Transformations
\ref Interaction
\ref Views

\ref Textures
\ref Tesselate

\ref CAD
\ref MAN-Editor
\ref ObjBrowser
\ref NC
\ref NC-Wcut

\ref IGES
\ref DXF
\ref VRML

\ref DL-OpenGL
\ref DLLs
\ref Plotten
</pre>


<hr>



_____________________________________________________________________
\section Edit_mem
\code
Functions modifying model in memory (UTF_FilBuf0):

ED_new_File
  UTF_add_file

ED_add_File
  UTF_add1_file
    UTF_insert1

ED_srcLn_add APED_src_chg PED_exit UTO_sav_ost uva..
  UTF_add_line

AP_src_mod_ed
  UTF_chg_line

APED_src_chg UNDO_ln_res UNDO_ln_del UTF_comment_chg
  UTF_comment_line UTF_insertTxt

ED_del__


\endcode
_____________________________________________________________________
\section Edit_edi



_____________________________________________________________________
\section Transformations
<pre>
see also \ref ut_transform.c  (UTRA_)
see also \ref ConstructionPlane
</pre>
\code

UTRA_m3_inirot     transformation from rotationaxis and angle 
UTRA_def__         define transformation
UTRA_app_pt        apply all defined Transformations to a point
UTRA_app_vc        apply all defined Transformations to a Vector
UTRA_app__ UTRA_app_oTab UTRA_app_obj

UTO_obj_apptra      apply Tra; creat new struct. in:Struct; preload trMat.
UTO_obj_tra         ruft UTO_stru_tra; in: oGX u Mat_4x3
UTO_stru_tra        apply Tra; generiert neue oGX; in: oGX u Mat_4x3
UTO_pt_tratra
UTO_pt_trarot

UT2D_pt_traptm2
UT2D_vc_travcm2
UT3D_pt_traptm3
UT3D_pt_rotptm3
UT3D_pt_traptm4
UT3D_vc_travcm3
UT3D_vc_travcm4



\endcode
_____________________________________________________________________
\section Views
\code
APT_work_PrgCmd          do "VIEW" source
GL_View_get              returns active viewData
GL_View_set              set viewData
GL_View_dump             dump viewData
UI_GR_view               save/restore viewData





\endcode


_____________________________________________________________________
\section Startup
\code

main             xa_main.c      search ":/main (" 
  UI_win_main                   create window

UI_GL_draw__                    Redraw-CB of OpenGL
  AP_init__                     only 1. call
    AP_work__                   work startup-parameters


ED_work_END
  ED_work_CurSet             ruecksetzen od. bis new ln abarbeiten ..
    ED_Run






\endcode
_____________________________________________________________________
\section Workflow
<pre>
\ref NC_Main.c   CommandInterpreter - main
</pre>
\code

UI_AP                         UserInterface; 
UI_menCB                      Callback f File/new ...
UI_butCB                      Callback fuer Menufuncs, Buttons, ...
  ED_work_END
   ED_work_CurSet
    ED_Run
     ED_Read_Line
     WC_Work__                subModel
     WC_Work1                 ========= HauptEntry in NC_Main.c ==========
      APT_work_def            DefinitionLine abarbeiten (decode, draw)
        APED_dbo_oid          Typ und Index der Zielvariable bestimmen
        APT_decode_ausdr      Eingabezeile zerteilen (1. Decodierstufe)
          APT_decode_func     decode SIN() X() D() ANG() P() L() ..
            APT_decode_inp    2.Decodierstufe
        APT_store_obj         decode APT-object, store object.
          APT_decode_var
          APT_decode_pt 
          APT_decode_ln 
          APT_decode_ci       APT_DrawCirc
          APT_decode_ell
          APT_decode_pol
          APT_decode_bsp
          APT_decode_ccv__
            AP_cont_nxt       Kontursucher ..
          APT_decode_pln1     Plane/Refsys
          APT_decode_pln2     Plane   R = PERP ..
          APT_decode_sbsp     decode b-spline-surf
          APT_decode_sur
            APT_decode_srv
            APT_decode_s_sph
            APT_decode_s_cyl
            APT_decode_s_con
          APT_decode_sol
            APT_decode_bsph   Sphere
            APT_decode_bcon   CONUS
            APT_decode_btor   TORUS
            APT_decode_btor   PRISM
          APT_trim_obj        LN|CI|CV = CUT ..
          DB_StoreCurv
        APT_Draw__
         DB_GetCurv
         APT_DrawCurv
         APT_DrawDimen
         APT_DrawTxtA          2D-Text
         APT_DrawTxtG          3D-Text
         APT_DrawCurv          APT_DrawCirc
          GL_DrawPoly2D         GR_DrawCirc
          GL_DrawPoly
         APT_DrawPln
         APT_DrawSur
          GR_DrawSur
           TSU_DrawSurT_
            TSU_DrawSurTRU     Ruled Surface
            TSU_DrawSurTRV     Revolved Surface
            TSU_DrawSurTS      ungetrimmte/ungelochte Planare Flaeche
            TSU_DrawSurTC      getrimmte/gelochte Complex-Flaeche (Typ_SURTPS)
            TSU_DrawSurTP      getrimmte/gelochte Planare Flaechen
             GL_DrawSur
              GL_Surf_Ini
              GL_Disp_sur
         APT_DrawSol
          GR_CreSol__
           GL_disp_prism
      APT_work_PrgCmd         Programming-Function (goto, call, WORK, if ...)
      APT_work_NCCmd          FROM TL ..
      APT_do_auxCmd           T1;G20;R0 ..
      APT_wcut_line           nur if (APT_workmode == Typ_nc_cut) ?
      APT_drill_line          nur if (APT_workmode == Typ_nc_cut) ?


\endcode
Workflow CAD:
\code
// activate new subMenu:
IE_cad_init2   // activate new mainMenu
IE_cad_init1   // activate new subMenu

// activate new inputField:
IE_cad_InpIn__

// receive Input from user:
IE_cad_sel1

// test content of all inputFields:
IE_cad_test1

// finish cad-object:
IE_cad_OK


UI_CB_hide                    Hide - Funktion
  DL_disp_set
UI_CB_view                    View - Funktion
  GA_hide__                   hidden-Elements-Tabelle bearbeiten




\endcode
\section Events
\code

------------------- GUI-events 
UI_GL_mouse__                 OpenGL-callback for user-selection
  UI_GR_Select1
    GL_sel_sel
    UI_GR_Select2             callback von GUI_Popup (Liste der sel.Obj)
     UI_GR_Select_work1       work GR_Sel_Filter 3-7
      sele_decode                 change selected_object into requested_object
      UI_GR_Select_work2      work  hide,view,SM or call
       IE_sel_CB__               write selection -> CAD-inputfield
       IE_cad_sel1            CAD-report sel.
       ED_add_Text            MAN
  UI_GR_view_set_Z
  UI_GR_Indicate

OMN_CB_popup                  callback of popup-menu

UI_CursorWait UI_ChangeCursor UI_ResetCursor


// handle special-keycodes:
  UI_key_spcCtrl    // Ctrl on
  UI_key_spcAlt     // Alt ON
  UI_key_spcShAlt   // Shift + Alt ON


------------------- OpenGL-Events:
UI_GL_draw__                  Redraw whole scene
UI_GL_move__                  mouseMoveCallback from Grafic-window
UI_GL_mouse__                 mouseButtonCallback from Grafic-window
UI_GL_keys__                  KeybCallback from Grafic-window


Brw_CB_sel                    MouseButtonCallback from Browser-window
EDI_CB__                      KeybCallback from Editor-window


\endcode







\section CAD
\code

  UI_CAD_ON ();
  UI_CAD_OFF ();


// activate new subMenu:
IE_cad_init2   // activate new mainMenu
IE_cad_init1   // activate new subMenu

// activate new inputField:
IE_cad_InpIn__

// receive Input from user:
IE_cad_sel1


UI_cad                        Hauptmenue aufbauen
IE_cad_p_CB                   PointMenueEintrag selected ..
IE_activate                   nach Select obj: entspr. menu aktivieren.
 IE_decode_Ln                 Inputtzeile in (Typen, Worte) zerlegen
 IE_txt2par1                  decode textline -> subgroup (nach SM)
 IE_cad_sel1                  Selektion wird gemeldet, decodiert, eingearbeitet.
  IE_cad_test1                test ob alle Eingaben vorh;
                                ja:decode Felder, exec txt, activate OK.
 IE_cad_OK                    OK-Butt.pressed: clear Inputboxen,Zeile->Datei



\endcode 






\section MAN-Editor 
<pre>
sourcefiles for MAN-editor - not memory:
\ref xa_ed.c      Neutral EditorFunctions (MAN, not Gtk-specific)    ED_
\ref xa_edi__.c   Neutral EditorFunctions (MAN, not Gtk-specific)    ED_
GUI_edi_*()        GUI-EditorFunctions


sourcefiles for memory (MAN & CAD) - not editor:
\ref xa_ed_mem.c  ApplicSpecficFunctions APT-Textfunctions im Memory APED_
\ref ut_txfil.c   Textfunctions im Memory                            UTF_


create/modify textlines:
\ref xa_src.c     check, modify, convert source-objects (text)       SRC_
  

other:
\ref xa_cad_ed.c  CAD-GroupEditor                                    IE_ed1_

</pre>
\code



  UI_MAN_ON ();
  UI_MAN_OFF ();

ED_work_END                   Button END = alles abarbeiten

\endcode








\section ObjBrowser 
\code

  UI_brw__ (1);            // on; -1=off

  Brw_Mdl_init ();  // fill browserWindow

  Brw_Mdl_upd ();
    Brw_typeRow_upd    // add type-row

  Brw_typeRow_sel
    Brw_typeRow_open
      Brw_objRow_add     // add obj

\endcode






\section Interaction 
\code

AP_stat.iActStat = 1;     // ON; 0=off.
ACT_ck_act

SRCU_win_var              // init update variable
  SRCU_win__              // create Toolbar
  SRCU_work__

Events:
SRCU_ent_CB               // new value entered into entryField
SRCU_tmr_CB__             // timer callback


APT_decode_Activ
DB_StoreActiv
UI_menCB "Iact"    ckb_Iact
UI_GL_mouse__           callback mouseButton
  UI_GR_Select1         get selected obj
    sele_get_pos
    GL_sel_sel
    sele_ck_typ         test if objTyp is active in reqObjTab
    sele_ck_subCurv     test for component of curve; give point on polygon ..
      SRC_src_pt_dbo    src from point and DB-obj

   DL_IactSelect
     DB_QueryActiv

\endcode







\section NC 
\code

APT_work_PrgCmd
 APT_wcut_ln1                 CUT P
 NC_up_Work_                  CUT S
 NC_up_Pock_                  POCK
 Pock_CUT_CIRC                CUT_CIR
 Pock_POCK_CIRC               POCK_CIR




\endcode \section NC-Wcut 
\code

UI_wcg__                      gesamtes Panel generieren
UI_wcg_init_                  erster Start
UI_wcg_CBcont                 Auswahl einer Kontur
 UI_wcg_InitBuf               Text -> aus_typ,aus_tab;
  wcg_decode__                abarbeiten
   AP_cont_nxt                Kontur -> oxInpU (memspc)
   wcg_decode_APT             Konikinfos -> deTab
   wcg_CreCutAll              Ausgabeelemente -> oxOutU/O[oxOutNr]
    wcg_CreCutCyl
    wcg_CreCutCon
    wcg_CreCutCpx
     wcg_cpx_break
      wcg_cpx_teilen
  wcg_OutDrawAll              Ausgabeobjekte anzeigen.
   GR_DrawSur                 dzt werden Typ_SURRU einzeln ausgegeben
UI_wcg_InitProc               Konikinfos anzeigen
UI_wcg_UpdateProc             Konikinfos aus menue uebernehmen (OK-Butt.)
UI_wcg_askExit                beenden
 UI_wcg_CB_ExitDia            beenden
  UI_wcg_SaveOK               Progr -> Editwin
   wcg_encode__               das aktuelle APT-prog -> memspc54



........ NC-Tech ........
APT_wcut_line                 eine NC-Bearbeitungszeile decodieren
UI_wcTec__                    Window aufbauen
UI_wcTec_Init1                erster Start
 UI_wcTec_find_tec
NC_up_Work_                   WORK CUT ..
NC_up_Pock_




\endcode \section IGES 
\code

UI_menCB "open"
UI_open__
AP_Import__ ("xa_ige_r", "IGE_r__", cbuf);
AP_Mod_load
AP_ImportIges
 IGE_r__                      Mainentry in ../exp/ige_r.c
  IGE_r_D__
  IGE_r_P__
   IGE_r_work__               abarbeiten
  IGE_r_work_1                subfigs, dann main abarbeiten
   IGE_r_work_2               ein Obj ausgeben
    IGE_r_128
  AP_obj_2_txt
  UTF_add2_line

UI_expIgeCB
 AP_ExportIges__
  AP_ExportIges_Model
   IGE_w_rec
     IGE_w_mat
       IGE_w_P_ELL
 



\endcode \section DXF 
<pre>
\ref dxf_r.c        ../exp/dxf_r.c  Import DXF-functions        (dxfr_)
\ref dxf_w.c        ../exp/dxf_w.c  Export DXF-functions        (dxfw_)
\ref dxf_ut.c       ../exp/dxf_ut.c DXF-utility-functions       (dxf)
</pre>
\code

UI_menCB "impDxf"
DXF_r__
  dxfr_init            get txsiz,dimsiz,$EXT..
    dxfr_head__
  dxfr_rec__           read nxt obj 
  dxf_r_src_out
    AP_obj_2_txt         create code, write > mem_cbuf1

UI_menCB "expDxf__" UI_save__
DXFW__
  DXFW_ox
// AP_ExportDxf
  // dxfw_rec





\endcode \section VRML 
\code

wrl_readTess__                wrl_ut.c          Import

TSU_exp__                     ../gr/tess_ut.c   Export
 TSU_exp_sur



\endcode
\section Textures
<pre>
\ref ui_tex.c                  // ModifyTexturesWindow
\ref xa_tex.c                  // Texture-Utility-Functions.
\ref gru.c                     // OpenGl-Texture-Utility-Functions.
</pre>
\code


UI_Tex__

  GL_Tex_Load
    bmp_load

GR_DrawSur
 TSU_DrawSurT_ > TSU_DrawSurTP , TSU_DrawSurTRU
 GL_DrawSur
  GRU_tex_pos1          compute texture-parameters (vectors, scale)
   TSU_get_vec
   GRU_tex_rec
   GRU_tex_pos9
  GL_Tex_Ini            apply texture
   glTexGendv (GL_S,      apply horizontal vector vs
   glTexGendv (GL_T,      apply vertical vector vt
   glRotatef              apply rotation
   glScalef               apply scale
   glTranslatef           apply offset ...





\endcode
\section Tesselate 
\code

APT_DrawSur
 GR_DrawSur
  TSU_DrawSurT_
   TSU_DrawSurTC              getrimmte/gelochte Flaeche
    TSU_tr_init_
    TSU_DrawSurTBox
     GLT_comm_work
     GLT_diff_work




\endcode
\section DL-OpenGL 
\code

DL_ReScale__                  Rescale rescale ScalAll
DL_InitAttTab                 Def.Attributtabelle laden
DL_DumpObjTab                 dump DispList

GL_DrawLine                   ../gr/ut_GL.c
GL_DrawTxtG                   ../gr/ut_GL.c
GL_Redraw                     redraw DL




\endcode
\section DLLs
see also \ref xa_dll.c  (DLL_)
\code

                              xa_dll.c
UI_DllLst_read                fill list of userprograms (DLL's)
UI_DllLst_CB                  DLL by user selected ..
AP_exec_dll                   start plugin




\endcode
\section Plotten
\code

 UI_WinPrint1
  AP_print__                  ../exp/prt_w.c
   AP_print_work2


\endcode



*/
