////////////////////////////////////////////////////////////////////////////////
//
// LTDEFINE.H  
//
////////////////////////////////////////////////////////////////////////////////

#ifndef __LTDEFINE_H
#define __LTDEFINE_H
#pragma pack( push, 1)


#ifdef BUILDER_COMPILER
#ifndef __WINDOWS_H
#include <windows.h>
#endif
#endif

#ifndef __LDEFIN2D_H
#include "ldefin2d.h"
#endif

// . <ldefin2d.h> ErrorType -  

//-------------------------------------------------------------------------------
//    
// ---
struct Type1 {
  double    xBase, yBase;
  double    ang;
  double    scale;
	reference gr;
};

//-------------------------------------------------------------------------------
//   
// ---
struct Type2 {
  double    xBase, yBase;
};

//-------------------------------------------------------------------------------
//   
//    c  
// ---
struct Type3 {
  double    xBase, yBase;
  double    ang;
};

//-------------------------------------------------------------------------------
//     c  
// ---
struct Type5 {
  double    xBase, yBase;
  double    ang;
  unsigned char horizon;  //1     ; 0 - 
};

//-------------------------------------------------------------------------------
//   (  ,    )
// ---
struct Type6 {
	reference gr;  //   ,     
};

//-------------------------------------------------------------------------------
//
// ---
struct Phantom {
  unsigned short      phType;  //  
  union  { // 
    struct Type1 type1;    //   phType =1
    struct Type2 type2;    //       phType =2
    struct Type3 type3;    // phType =3
    struct Type3 type4;    //    phType =4
    struct Type5 type5;    //  phType =5
    struct Type6 type6;    //  (  ,    ) phType =6
    struct Type2 type7;    //   phType =7
  };
};

//-------------------------------------------------------------------------------
//  
// ---
struct PlacementParam {
  double    xBase, yBase;  //     
  double    scale;         //
  double    ang;           //     
};

// . <ldefin2d.h> ODBC_DB ...

// . <ldefin2d.h> TXT_CHAR ...

// . <ldefin2d.h> stACTIVE ... -   , , 

// . <ldefin2d.h>    ksSytemPath
// sptSYSTEM_FILES ...

// . <ldefin2d.h>     SystemControlStart
// scsSTOPPED_FOR_MENU_COMMAND ...

//-------------------------------------------------------------------------------
//   
// ---
struct ViewParam {
  unsigned short state;             //  
  double         x,y;               //   
  double         scale;             //  
  double         ang;               //   
  unsigned long  color;             //     
	char           name[TEXT_LENGTH]; //  
};

//-------------------------------------------------------------------------------
//    ( Unicode )
// ---
struct ViewParamW {
  unsigned short state;             //  
  double         x,y;               //   
  double         scale;             //  
  double         ang;               //   
  unsigned long  color;             //     
	wchar_t        name[TEXT_LENGTH]; //  
};

#ifdef _UNICODE
#define ViewParamT  ViewParamW
#else
#define ViewParamT  ViewParam
#endif // !_UNICODE

//-------------------------------------------------------------------------------
//   
// ---
struct LayerParam {
  unsigned short state;             //  
  unsigned long  color;             //     
  char           name[TEXT_LENGTH]; //  
};

//-------------------------------------------------------------------------------
//    ( Unicode )
// ---
struct LayerParamW {
  unsigned short state;            //  
  unsigned long  color;            //     
  wchar_t        name[TEXT_LENGTH];//  
};

#ifdef _UNICODE
#define LayerParamT  LayerParamW
#else
#define LayerParamT  LayerParam
#endif // !_UNICODE

//-------------------------------------------------------------------------------
//      :
// Cursor, Placement, CommandWindow
// ---
struct RequestInfo {
  char    * title;      			//      
  char    * commands;   			//      
  char    * prompt;     			//    
  char    * cursor;     			//       
  void    * callBack;   			//     
  int       dynamic;      		//    1- , 0-
  HINSTANCE commInstance;     // Instance ,     
};

//-------------------------------------------------------------------------------
//      :
// Cursor, Placement, CommandWindow
// (Unicode)
// ---
struct RequestInfoW {
  wchar_t * title;      			//      
  wchar_t * commands;   			//      
  wchar_t * prompt;     			//    
  wchar_t * cursor;     			//       
  void    * callBack;   			//     
  int       dynamic;      		//    1- , 0-
  HINSTANCE commInstance;     // Instance ,     
};

#ifdef _UNICODE
#define RequestInfoT  RequestInfoW
#else
#define RequestInfoT  RequestInfo
#endif // !_UNICODE

//-------------------------------------------------------------------------------
//         .
//   1,    ,
//                    0,    .
// ---
typedef int (WINAPI *PlacementCallBack)( int    com,           //     
						      double *x, double *y, //   
						      double *angle,        //  
						      RequestInfo *info,    //        
						      void   *phantom,      //    
                  int    dynamic );     //   

//-------------------------------------------------------------------------------
//         . (Unicode)
//   1,    ,
//                    0,    .
// ---
typedef int (WINAPI *PlacementCallBackW)( int    com,           //     
						      double * x, double * y, //   
						      double * angle,        //  
						      RequestInfoW * info,    //        
						      void   *phantom,      //    
                  int    dynamic );     //   

#ifdef _UNICODE
#define PlacementCallBackT  PlacementCallBackW
#else
#define PlacementCallBackT  PlacementCallBack
#endif // !_UNICODE

//-------------------------------------------------------------------------------
//       .
//   1,    ,
//                    0,    .
// ---
typedef int (WINAPI *CursorCallBack)( int     com,             //     
		       	 double *x, double *y,    //   
		       	 RequestInfo *info,       //        
	  	     	 void   *phantom,         //    
             int     dynamic );       //   

//-------------------------------------------------------------------------------
//       .
//   1,    ,
//                    0,    .
// ---
typedef int (WINAPI *CursorCallBackW)( int     com,             //     
		       	 double *x, double *y,    //   
		       	 RequestInfoW *info,       //        
	  	     	 void   *phantom,         //    
             int     dynamic );       //   


#ifdef _UNICODE
#define CursorCallBackT  CursorCallBackW
#else
#define CursorCallBackT  CursorCallBack
#endif // !_UNICODE


//-------------------------------------------------------------------------------
//          
//   1,    ,
//                    0,    .
// ---
typedef int (WINAPI *CommandWindowCallBack)( int com,            //     
																			       RequestInfo *info ); //        

//-------------------------------------------------------------------------------
//          
//   1,    ,
//                    0,    .
// ---
typedef int (WINAPI *CommandWindowCallBackW)( int com,            //     
																			        RequestInfoW *info ); //        

#ifdef _UNICODE
#define CommandWindowCallBackT  CommandWindowCallBackW
#else
#define CommandWindowCallBackT  CommandWindowCallBack
#endif // !_UNICODE


//-------------------------------------------------------------------------------
//         
//   1,   ,
//                    0,   
// ---
typedef int (WINAPI *FilePreviewFuncCallBack)( HWND HWindow,  //   
									  													  char * fileName ); // ,      

//-------------------------------------------------------------------------------
//         
//   1,   ,
//                    0,   
// ---
typedef int (WINAPI *FilePreviewFuncCallBackW)( HWND HWindow,  //   
									  													  LPWSTR fileName ); // ,      

#ifdef _UNICODE
#define FilePreviewFuncCallBackT  FilePreviewFuncCallBackW
#else
#define FilePreviewFuncCallBackT  FilePreviewFuncCallBack
#endif // !UNICODE


// . <ldefin2d.h>    GetObjParam  SetObjParam
// ALLPARAM ...

//-------------------------------------------------------------------------------
//   
//  style  (   ) :
//	1  - ,
//  2  - ,
//  3  - ,
//  4  - ,
//  5  -  
//	6  - ,
//  7  - ,
//  8  - -  2 ,
//  9  -  
//  10 - 
//  11 -,   
// ---
struct LineSegParam {
	double         x1,y1;       // 
	double         x2,y2;       // 
	unsigned short style;       // 
};

//-------------------------------------------------------------------------------
//     
// ---
struct ArcParam {
	double         xc,yc;       // 
	double         rad;         // 
	double         ang1;        //  
	double         ang2;        //  
	short          dir;         // 
	unsigned short style;       //  
};

//-------------------------------------------------------------------------------
//     
// ---
struct ArcParam1 {
	double         xc,yc;       // 
	double         rad;         // 
	double         x1,y1;       //  
	double         x2,y2;       //  
  short          dir;         // 
  unsigned short style;       //  
};

//-------------------------------------------------------------------------------
//    
// ---
struct MathPointParam {
	double  x, y;       // 
};

//-------------------------------------------------------------------------------
//    
// ---
struct RectParam {
  MathPointParam  pBot;  //   
  MathPointParam  pTop;  //   
};

//  style  (   ) :
//0 - 
//1 - 
//2 - -
//3	-	
//4	-	
//5	-	
//6	-	
//7	-	 
//8	-	 

//-------------------------------------------------------------------------------
//    
// ---
struct PointParam {
	double  x, y;       // 
	unsigned short style; // 
};

//-------------------------------------------------------------------------------
//        Bezier - 
// ---
struct BezierPointParam {
	double  x, y;       //  
	double  ang;        //       
	double  left;       //       
	double  right;      //       
};


//-------------------------------------------------------------------------------
//        Nurbs - 
// ---
struct NurbsPointParam {
	double  x, y;       //  
	double  weight;     //    > 0
};

//-------------------------------------------------------------------------------
//    bezier 
// ---
struct BezierParam {
  reference pMathPoint;   //     
	unsigned char closed;   //   0-  1- 
	unsigned short style;   // 
};

//-------------------------------------------------------------------------------
//   
// ---
struct CircleParam {
	double       xc,yc;       //
	double       rad;         //
	unsigned short style;     // 
};

//-------------------------------------------------------------------------------
//     
// ---
struct LineParam {
	double x, y;    //   
	double ang;     //    X
};

//-------------------------------------------------------------------------------
//    
// ---
struct EllipseParam {
	double xc, yc;            // 
  double a, b;              // 
	double ang;               //     X
  unsigned short style;       // 
};

//-------------------------------------------------------------------------------
//      
// ---
struct EllipseArcParam {
  double xc; double yc;    // 
  double a, b;             // 
	double ang;              //   (  a )   X
  double angFirst;         //     a
  double angSecond;        //      a 
  short dir;               //
  unsigned short style;    // 
};

//-------------------------------------------------------------------------------
//       
// ---
struct EllipseArcParam1 {
  double xc; double yc;    // 
  double a, b;             // 
	double ang;              //   (  a )   X
  double parFirst;         //  
  double parSecond;        //  
  short  dir;              //
  unsigned short style;    // 
};

//-------------------------------------------------------------------------------
//    
// ---
struct EquidistantParam {
  reference     geoObj;   //   -  
  unsigned char side;     // ,     
                          // 0-  , 1-  , 2-  
  unsigned char cutMode;  //    
                          // 0- , 1-  
  unsigned char degState; //     
                          // 0-  , 1-  
  double        radRight; //      
  double        radLeft;  //   
  unsigned short  style;    //  
};


//  style  (   ) :
// 0  - 
// 1  -  
// 2  - 
// 3  -  
// 4  - 
// 5  - 
// 6  - 
// 7  - 
// 8  -  
// 9  -  
// 10 -  
// 11 - 
// 12 -  
// 13 -    
// 14 - 

//-------------------------------------------------------------------------------
//    
// ---
struct HatchParam {
	unsigned short style;   // 
	double ang;             // 
	double step;            // 
	double width;           // , 0- 
	double x, y;            //  (   )
  reference pBoundaries;  // - ;   GetObjParam  ksHatch
};

//-------------------------------------------------------------------------------
//     
// ---
struct HatchParamEx {
	unsigned short style;   // 
	double ang;             // 
	double step;            // 
	double width;           // , 0- 
	double x, y;            //  (   )
  reference pBoundaries;  // - ;   GetObjParam  ksHatch
  unsigned long color;    //,   FREE_COLOR (0xff000000l1l)    1
  unsigned char sheetAng; //0 -     (  ) 1 -  (  )
};


// . <ldefin2d.h>    
// INVARIABLE ...

// . <ldefin2d.h> CHAR_STR_ARR ... -   

//  style  (   ) :
// 0 -     
// 1   
// 2     
// 3   
// 4   
// 5       (  )
// 6       ( \  )
// 7       (  )
// 8     
// 9     (  )
// 10    (  )
// 11    
// 12    
// 13     
// 14    


//-------------------------------------------------------------------------------
//   
// ---
struct ParagraphParam {
	unsigned short style;  //   ,  0 -  
	double x, y;           //   
	double ang;            //   
	unsigned int hFormat;  //    0-   1-  2-   
	unsigned int vFormat;  //    0-   1-  
	double width;          //   
	double height;         //   
};


//-------------------------------------------------------------------------------
//   
// ---
struct TextParam {
	ParagraphParam par;    //  
	reference pTextLine;   //       TEXT_LINE_ARR
};

//-------------------------------------------------------------------------------
//    
// ---
struct TextLineParam {  //  
	unsigned short style; //   ,  0 -  
	reference pTextItem;  //       TEXT_ITEM_ARR
};

//-------------------------------------------------------------------------------
//      
// ---
struct  TextItemFont {
	char          fontName[MAX_TEXT_LENGTH]; //  
	double        height;                    //  
	double        ksu;                       //  
	unsigned long color;                     // 
	unsigned int  bitVector;                 //   (, , ,   (, ,   ))
};

//-------------------------------------------------------------------------------
//       ( Unicode )
// ---
struct  TextItemFontW {
	wchar_t       fontName[MAX_TEXT_LENGTH];  //  
	double        height;                     //  
	double        ksu;                        //  
	unsigned long color;                      // 
	unsigned int  bitVector;                  //   (, , ,   (, ,   ))
};

#ifdef _UNICODE
#define TextItemFontT  TextItemFontW
#else
#define TextItemFontT  TextItemFont
#endif // !_UNICODE


//-------------------------------------------------------------------------------
//     
// ---
struct TextItemParam {
  int          tip;            // tip = SPECIAL_SYMBOL , FONT_SYMBOL, FRACTION_TYPE, SUM_TYPE   0
	TextItemFont font;           //     
	char         s[TEXT_LENGTH]; //      
  unsigned int iSNumb;         //  ,               0
};

//-------------------------------------------------------------------------------
//      (Unicode)
// ---
struct TextItemParamW {
  int           tip;            // tip = SPECIAL_SYMBOL , FONT_SYMBOL, FRACTION_TYPE, SUM_TYPE   0
	TextItemFontW font;           //     
	wchar_t       s[TEXT_LENGTH]; //      
  unsigned int  iSNumb;         //  ,               0
};

#ifdef _UNICODE
#define TextItemParamT  TextItemParamW
#else
#define TextItemParamT  TextItemParam
#endif // !_UNICODE


//-------------------------------------------------------------------------------
//    
// ---
struct StandartSheet {
  unsigned char  format;   //    0(0) ... 4(4)
  unsigned char  multiply; //  
  unsigned char  direct;   //   0   
};


//-------------------------------------------------------------------------------
//        -    GetObjParam()
//  SetObjParam();   
// ---
struct SheetSize {
  double  width;   //  
  double  height;  //  
};



//-------------------------------------------------------------------------------
//   
// ---
struct SheetPar{
  char         layoutName[MAX_TEXT_LENGTH];//   -   ( );   - GRAPHIC.LYT
                                           //   -        - GRAPHIC.LYT
  unsigned int shtType;                    //  -   (1-13-  )
                                           //   -   
  union {//  
    struct StandartSheet stPar;  //
    struct SheetSize     usPar;
  };
};

//-------------------------------------------------------------------------------
//    ( Unicode )
// ---
struct SheetParW{
  wchar_t      layoutName[MAX_TEXT_LENGTH];//   -   ( );   - GRAPHIC.LYT
                                           //   -        - GRAPHIC.LYT
  unsigned int shtType;                    //  -   (1-13-  )
                                           //   -   
  union {//  
    struct StandartSheet stPar;  //
    struct SheetSize     usPar;
  };
};

#ifdef _UNICODE
#define SheetParT  SheetParW
#else
#define SheetParT  SheetPar
#endif // !UNICODE


//-------------------------------------------------------------------------------
//   
// ---
struct SheetOptions{
  SheetPar      sheetPar;  //    ( API)
  unsigned char docType;   //    DocType
};

//-------------------------------------------------------------------------------
//   
// (Unicode)
// ---
struct SheetOptionsW{
  SheetParW     sheetPar;  //    ( API)
  unsigned char docType;   //    DocType
};

#ifdef _UNICODE
#define SheetOptionsT  SheetOptionsW
#else
#define SheetOptionsT  SheetOptions
#endif // !_UNICODE


//-------------------------------------------------------------------------------
//    
// ---
struct OverlapObjectOptions{
  unsigned short overlap; // 1 -      ,  0 -  
  double gap;             //    
};


//-------------------------------------------------------------------------------
// . <ldefin2d.h> DocType -  
//    (      ,  )
// ---
struct DocumentParam {
  unsigned char regim;                     // 0 -  ,
                                           // 1 -  
  unsigned char type;                      //    DocType

  char          fileName [MAX_TEXT_LENGTH];//    
  char          comment  [TEXT_LENGTH];    // 
  char          author   [TEXT_LENGTH];    // 
  SheetPar      sheet;                     //    type = 1, 2, 4;
};


//-------------------------------------------------------------------------------
// . <ldefin2d.h> DocType -    ( Unicode )
//    (      ,  )
// ---
struct DocumentParamW {
  unsigned char regim;                     // 0 -  ,
                                           // 1 -  
  unsigned char type;                      //    DocType

  wchar_t       fileName [MAX_TEXT_LENGTH];//    
  wchar_t       comment  [TEXT_LENGTH];    // 
  wchar_t       author   [TEXT_LENGTH];    // 
  SheetParW     sheet;                     //    type = 1, 2, 4;
};

#ifdef _UNICODE
#define DocumentParamT  DocumentParamW
#else
#define DocumentParamT  DocumentParam
#endif // !UNICODE

/***************************************************************/
/*        */
/***************************************************************/
//-------------------------------------------------------------------------------
// . <ldefin2d.h> CHAR_ATTR_TYPE ...
//       
// ---
struct ColumnInfo {
  char          header[80];       // o- 
  unsigned char type;             //     - .
  unsigned char key;              //  ,        
  char          def[TEXT_LENGTH]; //   
  unsigned char flagEnum;         //   ,    
                                  //       1  0 
  reference fieldEnum;            //     ()
  reference columns;              //        
};

//-------------------------------------------------------------------------------
// . <ldefin2d.h> CHAR_ATTR_TYPE ...
//       
// (Unicode)
// ---
struct ColumnInfoW {
  wchar_t       header[80];       // o- 
  unsigned char type;             //     - .
  unsigned char key;              //  ,        
  wchar_t       def[TEXT_LENGTH]; //   
  unsigned char flagEnum;         //   ,    
                                  //       1  0 
  reference fieldEnum;            //     ()
  reference columns;              //        
};

#ifdef _UNICODE
#define ColumnInfoT  ColumnInfoW
#else
#define ColumnInfoT  ColumnInfo
#endif // !_UNICODE


//-------------------------------------------------------------------------------
//    
// ---
struct AttributeType {        // 26.6.97      
  char          header[80];   // o- 
  unsigned int  rowsCount;    // -   
  unsigned char flagVisible;  // ,     
  char          password[10]; // ,      -     
  reference     columns;      //      
};


//-------------------------------------------------------------------------------
//    
// ---
struct ksAttributeType {
  unsigned int  key1;         // .   
  unsigned int  key2;         // .   
  unsigned int  key3;         // .   
  unsigned int  key4;         //   
                              //   0  1000 
                              //   ""
  char          header[80];   // o- 
  unsigned int  rowsCount;    // -   
  unsigned char flagVisible;  // ,     
  char          password[10]; // ,      -     
  reference     columns;      //      
};

//-------------------------------------------------------------------------------
//    
// (Unicode)
// ---
struct ksAttributeTypeW {
  unsigned int  key1;         // .   
  unsigned int  key2;         // .   
  unsigned int  key3;         // .   
  unsigned int  key4;         //   
                              //   0  1000 
                              //   ""
  wchar_t       header[80];   // o- 
  unsigned int  rowsCount;    // -   
  unsigned char flagVisible;  // ,     
  wchar_t       password[10]; // ,      -     
  reference     columns;      //      
};

#ifdef _UNICODE
#define ksAttributeTypeT  ksAttributeTypeW
#else
#define ksAttributeTypeT  ksAttributeType
#endif // !_UNICODE

//-------------------------------------------------------------------------------
//    
// ---
struct Attribute { // 05.6.00      
  unsigned int    key1;         // .   
  unsigned int    key2;         // .   
  unsigned int    key3;         // .   
  unsigned int    key4;         //   
                                //   0  1000 
                                //   ""
  unsigned char * flagVisible;  // ,    
                                //  -
                                // 0 -  1-  
  void          * values;       //     
                                //     1- ,
                                //     2-   ..
  unsigned int    valSize;      //    
  char            password[10]; // ,      -       
};

//-------------------------------------------------------------------------------
//    
// ---
struct ksAttribute {
  unsigned int    key1;         // .   
  unsigned int    key2;         // .   
  unsigned int    key3;         // .   
  unsigned int    key4;         //   
                                //   0  1000 
                                //   ""
  unsigned char * flagVisible;  // ,    
                                //  -
                                // 0 -  1-  
  void          * values;       //     
                                //     1- ,
                                //     2-   ..
  unsigned int    valSize;      //    
  char            password[10]; // ,      -       
  unsigned char * columnKeys;   //   
};

//-------------------------------------------------------------------------------
//    
// (Unicode)
// ---
struct ksAttributeW {
  unsigned int    key1;         // .   
  unsigned int    key2;         // .   
  unsigned int    key3;         // .   
  unsigned int    key4;         //   
                                //   0  1000 
                                //   ""
  unsigned char * flagVisible;  // ,    
                                //  -
                                // 0 -  1-  
  void          * values;       //     
                                //     1- ,
                                //     2-   ..
  unsigned int    valSize;      //    
  wchar_t         password[10]; // ,      -       
  unsigned char * columnKeys;   //   
};

#ifdef _UNICODE
#define ksAttributeT  ksAttributeW
#else
#define ksAttributeT  ksAttribute
#endif // !_UNICODE

//-------------------------------------------------------------------------------
//        
// ---
struct LibraryAttrTypeParam {
  char     name [MAX_TEXT_LENGTH];//    
  double   typeId;                //     
};

//-------------------------------------------------------------------------------
//        
// (Unicode)
// ---
struct LibraryAttrTypeParamW {
  wchar_t  name [MAX_TEXT_LENGTH];//    
  double   typeId;                //     
};

#ifdef _UNICODE
#define LibraryAttrTypeParamT  LibraryAttrTypeParamW
#else
#define LibraryAttrTypeParamT  LibraryAttrTypeParam
#endif // !_UNICODE


//-------------------------------------------------------------------------------
//
// ---
struct  CON {
  double xc, yc;                  //   
  double x1, y1, x2, y2;          //   
};

//-------------------------------------------------------------------------------
//
// ---
struct  TAN {
  double x1, y1, x2, y2;          //  
};

//     
typedef void ( WINAPI *DeleteFunc)(void * );


//-------------------------------------------------------------------------------
// . <ldefin2d.h>    
// _AUTONOMINAL ...
//    
// ---
struct DimText {  //  
  unsigned short style; //   ,  0 - 
  unsigned int sign;    //      0- 1 - , 2-  3-   > 3 -    "Symbol type A"
  unsigned int bitFlag; // 0 -      
  reference  pText;     //     (DIM_TEXT_PARAM)     (DIM_TEXT_PARAM_W)
                        //        
                        //  :  PREFIX, , TOLERANCE,
                        //  ,  , UNIT,SUFFIX,
                        //  ,   , 
                        //  TOLERANCE    DEVIATION  - 
                        //   
                        //  
   unsigned char stringFlag;// 0- pText   -      (DIM_TEXT_PARAM)       (DIM_TEXT_PARAM_W)
                            // 1- pText  TEXT_LINE_ARR -     -  TextLineParam
                            //   GetObjParam    ,  0 -      
};


//-------------------------------------------------------------------------------
//      
// ---
struct LDimSource {
  unsigned char ps;        //  0-, 1- 2 - ., 3 -  dx,dy, 4-       dx, dy
  double x1, y1;           //    1 -  
  double x2, y2;           //    2 -  
  double dx, dy;           //     ;  (     )
  unsigned char basePoint; //  1-dx, dy -   , 2-  
};

//-------------------------------------------------------------------------------
//       
// ---
struct DimDrawing {
  unsigned char pl1;      //  ./.   1    0/1
  unsigned char pl2;      //  ./.   2    0/1

//    1-  
// 0 -   1 - ( ) 2 - ( ) 3 -  4 -  
// 5 -    6 -    7 -    8 -   
// 9 -  90   10 -  90   11 -  (      )
// 12 -   (   0.6    )
// 13 -    
  unsigned char pt1;
  unsigned char pt2;      //    2-  
  int textPos;            //  ; 0-    
                          //  - . . .- . ; >0    1   2;   (     )
  unsigned char textBase; //   : 0  ,  1- textPos  1 ;
                          // 2 - textPos  2 ; 3-   
  int shelfDir;           //       X   0-   -1-  1- 
                          // 2-     3-   
  double ang;             //   
  int length;             //  ;  (     )
};

//-------------------------------------------------------------------------------
//    
// ---
struct LDimParam {
  DimText    tPar;  //                        3
  DimDrawing dPar;  //             2
  LDimSource sPar;  //       1
};


//-------------------------------------------------------------------------------
//        
// ---
struct LBreakDimSource {
  double x1, y1;           //    1 -  
  double x2, y2;           //     
  double x3, y3;           //       
};

//-------------------------------------------------------------------------------
//         
// ---
struct BreakDimDrawing {
  unsigned char pl;      //  ./.       0/1

//    1-  
// 0 -   1 - ( ) 2 - ( ) 3 -  4 -  
// 5 -    6 -    7 -    8 -   
// 9 -  90   10 -  90   11 -  (      )
// 12 -   (   0.6    )
// 13 -    

  unsigned char pt;
  int textPos;           //  ; 0-    
                         //  - . . ; >0    1   2;   (     )
  int shelfDir;          //       X   0-   -1-  1- 
                         // 2-     3-   
  double ang;            //   
  int length;            //  ;  (     )
};

//-------------------------------------------------------------------------------
//     c 
// ---
struct LBreakDimParam {
  DimText          tPar;  //                        3
  BreakDimDrawing  dPar;  //             2
  LBreakDimSource  sPar;  //       1
};

//-------------------------------------------------------------------------------
//     
// ---
struct ADimSource {
  double xc, yc;       //   
  double rad;          //   ;   (     )
	double ang1;         //     
	double ang2;         //     ,       
  int    dir;          //  1 -     ; -1 -   
  double x1, y1;       //     
  double x2, y2;       //     ,        
};

//-------------------------------------------------------------------------------
//    
// ---
struct ADimParam {
  DimText    tPar;  //                        3
  DimDrawing dPar;  //             2
  ADimSource sPar;  //        1
};

//-------------------------------------------------------------------------------
//     c 
// ---
struct ABreakDimParam {
  DimText          tPar;  //                        3
  BreakDimDrawing  dPar;  //             2
  ADimSource       sPar;  //       1
};

//-------------------------------------------------------------------------------
//       
// ---
struct RDimSource {
  double xc, yc;       //    , 
  double rad;          //   , 
};

//-------------------------------------------------------------------------------
//        
// ---
struct RDimDrawing {
//    1-  
// 0 -   1 - ( ) 2 - ( ) 3 -  4 -  
// 5 -    6 -    7 -    8 -   
// 9 -  90   10 -  90   11 -  (      )
// 12 -   (   0.6    )
// 0xff -   ( )
  unsigned char pt1;
  unsigned char pt2;      // ( ) 2- ,(  ) 0 -    1-   
  int           textPos;  //      ;  (     )
                          // 0 -    ,
                          // 1 -       ,
                          // -1-       
                          //    
  int           shelfDir; //       X   0-   -1-  1- 
                          // 2-     3-   
  double        ang;      //      
};

//-------------------------------------------------------------------------------
//          
// ---
struct RDimParam {
  DimText     tPar;    //                                          3
  RDimDrawing dPar;    //                               2
  RDimSource  sPar;    //       1
};

//-------------------------------------------------------------------------------
//       
// ---
struct RBreakDrawing {
//    1-  
// 0 -   1 - ( ) 2 - ( ) 3 -  4 -  
// 5 -    6 -    7 -    8 -   
// 9 -  90   10 -  90   11 -  (      )
// 12 -   (   0.6    )
  unsigned char pt;
  double ang;       //    
  unsigned int  pb; //  ;  (     )
};

//-------------------------------------------------------------------------------
//       
// ---
struct RBreakDimParam {
  RDimSource    sPar; //        1
  RBreakDrawing dPar; //             2
  DimText       tPar; //                        3
};


//   
#define OD_FRONTVIEW     0x00 //   ,    ,   
#define OD_TOPVIEW       0x08 //     - -    
#define OD_TOPVIEWLEADER 0x10 //     -

//    
struct OrdinatedDrawing {
  unsigned char type; //   
};

//-------------------------------------------------------------------------------
//    
// ---
struct OrdinatedSource {
  double x0, y0;           //  ,   
  double x1, y1;           //  ,   
  double x2, y2;           //  ,    
};


//-------------------------------------------------------------------------------
//     ORDINATEDIMENSION_OBJ
// ---
struct OrdinatedDimParam {
  DimText          tPar;  //  
  OrdinatedDrawing dPar;  //   
  OrdinatedSource  sPar;  //   
};


//#define   INDICATIN_TEXT_LINE_ARR        0xFFFF  // ,   ,   
                                                 //,       TEXT_LINE_ARR

//-------------------------------------------------------------------------------
//     
// ---
struct RoughPar {
  unsigned short style; //  ,  0 -  ,
                        //  style = INDICATIN_TEXT_LINE_ARR -> pText-  TEXT_LINE_ARR
  unsigned char type;   //    0- -  - 1- -   
                        // 2 --    
  unsigned char around; // =1 -  " "
  double x, y;          //   
  double ang;           //        X
  unsigned char cText0; //       ( -   2789-73)
  unsigned char cText1; //       ( -  ,)
  unsigned char cText2; //       (    2789-73)
                        //   2 
  unsigned char cText3; //       (.. )
                        //   1 
  reference pText;      //  style = INDICATIN_TEXT_LINE_ARR , TEXT_LINE_ARR -    
                        // CHAR_STR_ARR  CHAR_STR_ARR_W -      
                        //  4    ;
                        //      
                        // -   ( -   2789-73) - cText0=0 -  
                        // -   ( -  ,)        - cText1=0 -  
                        // -   (    2789-73)    - cText2=0 -  
                        // -   (.. )- cText3=0 -  
};

//-------------------------------------------------------------------------------
//    
// ---
struct ShelfPar { //    
  int psh;        //    X   0-   -1-  1- 
                  // 2-     3-   
  double ang;     //         
                  //       
  int length;     //  
};

//-------------------------------------------------------------------------------
//   
// ---
struct RoughParam {
  RoughPar rPar;
  ShelfPar shPar; //   
};

//-------------------------------------------------------------------------------
//      
// ---
struct LeaderParam {
  double x, y;             //    (   )
  //   0 -   1 -  2 -  3 -    4 -   
  //             5 -   90 6 -   7 -   8 -  (     )
  //             9 -   ( = 0.6    ) 10 -    60 11 -    90
  unsigned char arrowType; 
  int           dirX;      //    X (1 - -1-, 2-     3-   )
  unsigned char signType;  //   0-  1-  2- 
                           // 3-   4 -   .
                           // 5 -    .
                           // 6 -   
  unsigned char around;    //     0- 1- 
  unsigned char cText0;    //      0-  
  unsigned char cText1;    //      0-  
  unsigned char cText2;    //      (  1 )0-  
  unsigned char cText3;    //      (  1 )0-  
  reference pTextline;     // TEXT_LINE_ARR -    
                           //  4     
                           //      
                           // -    - cText0=0 -  
                           // -    - cText1=0 -  
                           // -    - cText2=0 -  
                           // -    - cText3=0 -  
  reference pPolyline;     // POLYLINE_ARR -     
                           //      -  
                           //     (       -    ),
                           //   - (  )
                           //   -   (  )
};

//-------------------------------------------------------------------------------
//       
// ---
struct PosLeaderParam {
  unsigned short style;    //  ,  0 -  ,
                           //  style = INDICATIN_TEXT_LINE_ARR -> pText-  TEXT_LINE_ARR
  double x, y;             //    (    )
  //   0 -   1 -  2 - 
  //             3 -   90 4 -   5 -   
  //             6 -  (     )
  //             7 -   ( = 0.6    )
  unsigned char arrowType; //
  int           dirX;      //    X (1 - -1-)
  int           dirY;      //     Y (1 - -1-)
  reference pText;         //  style = INDICATIN_TEXT_LINE_ARR , TEXT_LINE_ARR -    
                           // CHAR_STR_ARR  CHAR_STR_ARR_W -    
                           //      
  reference pPolyline;     // POLYLINE_ARR -      
                           //      -  
                           //     (       -    ),
                           //   - (  )
                           //   -   (  )
};

//-------------------------------------------------------------------------------
//       
// ---
struct BrandLeaderParam {
  int           dirX;      //    X (1 - -1-)
  double x, y;             //    (    )
  unsigned char arrowType; //  
  unsigned short style1;   //      ,  0 -  
                           //  style1 = INDICATIN_TEXT_LINE_ARR -> pText-  TEXT_LINE_ARR
  unsigned short style2;   //      ,  0 -  
  unsigned char cText0;    //      (  1 )0-  
  unsigned char cText1;    //      (  1 )0-  
  unsigned char cText2;    //      (  1 )0-  
  reference pText;         //  style1 = INDICATIN_TEXT_LINE_ARR , TEXT_LINE_ARR -    
                           // CHAR_STR_ARR  CHAR_STR_ARR_W -    
                           //      
                           //   
                           //   
                           //   
  reference pPolyline;     // POLYLINE_ARR -      
                           //      -  
                           //     (       -    ),
                           //   - (  )
                           //   -   (  )
};

//-------------------------------------------------------------------------------
//       
// ---
struct MarkerLeaderParam {
  double x, y;             //    (    )
  unsigned char arrowType; //  
  unsigned short style1;   //      ,  0 -  
                           //  style1 = INDICATIN_TEXT_LINE_ARR -> pText-  TEXT_LINE_ARR
  unsigned short style2;   //      ,  0 -  
  unsigned char cText0;    //     (  1 )0-  
  unsigned char cText1;    //      (  1 )0-  
  unsigned char cText2;    //      (  1 )0-  
  reference pText;         //  style1 = INDICATIN_TEXT_LINE_ARR , TEXT_LINE_ARR -    
                           // CHAR_STR_ARR  CHAR_STR_ARR_W -    
                           //      
                           //   
                           //   
                           //   
  reference pPolyline;     // POLYLINE_ARR -      
                           //      -  
                           //     (       -    ),
                           //   - (  )
                           //   -   (  )
};


//-------------------------------------------------------------------------------
//       
// ---
struct ChangeLeaderParam {
  double         x, y;         //    (    )
  unsigned short style;        //    
  unsigned char  signType;     //  
  double         signHeight;   //  
  double         leaderLength; //   < 0   
  reference      pText;        //  style1 = INDICATIN_TEXT_LINE_ARR , TEXT_LINE_ARR -    
                               // CHAR_STR_ARR  CHAR_STR_ARR_W -    
                               //      
                               //   
                               //   
                               //   
  reference     pPolyline;     // POLYLINE_ARR -      
                               //      -  
                               //     (       -    ),
                               //   - (  )
                               //   -   (  )
};


//-------------------------------------------------------------------------------
//   " "
// ---
struct BaseParam {
  unsigned short style;      //  ,  0 -  
  double         x1, y1;     //    (   )
  double         x2, y2;     //    
  unsigned char  type;       // 0-     1-    
  union {
    char      str[50];       // 
    reference pTextItem;     //     TEXT_ITEM_ARR  ()
  };
};

//-------------------------------------------------------------------------------
//   " "
// (Unicode)
// ---
struct BaseParamW {
  unsigned short style;  //  ,  0 -  
  double         x1, y1; //    (   )
  double         x2, y2; //    
  unsigned char  type;   // 0-     1-    
  union {
    wchar_t   str[50];   // 
    reference pTextItem; //     TEXT_ITEM_ARR  ()
  };
};

#ifdef _UNICODE
#define BaseParamT  BaseParamW
#else
#define BaseParamT  BaseParam
#endif // !_UNICODE

//-------------------------------------------------------------------------------
//   " / "
// ---
struct CutLineParam {
  unsigned short style;      //  ,  0 -  
  unsigned char  right;      //   0 / 1    
  double         x1, y1;     //     
  double         x2, y2;     //     
  unsigned char  type;       // 0-     1-    
  union {
    char      str[50];       // 
    reference pTextItem;     //     TEXT_ITEM_ARR  ()
  };
  reference      pMathPoint; // POINT_ARR    .,  , .
};

//-------------------------------------------------------------------------------
//   " / "
// (Unicode)
// ---
struct CutLineParamW {
  unsigned short style;      //  ,  0 -  
  unsigned char  right;      //   0 / 1    
  double         x1, y1;     //     
  double         x2, y2;     //     
  unsigned char  type;       // 0-     1-    
  union {
    wchar_t   str[50];       // 
    reference pTextItem;     //     TEXT_ITEM_ARR  ()
  };
  reference      pMathPoint; // POINT_ARR    .,  , .
};

#ifdef _UNICODE
#define CutLineParamT  CutLineParamW
#else
#define CutLineParamT  CutLineParam
#endif // !_UNICODE

//-------------------------------------------------------------------------------
//   " "
// ---
struct ViewPointerParam {
  unsigned short style;      //  ,  0 -  
  double         x1, y1;     //  ( ) 
  double         x2, y2;     //    
  double         xt, yt;     //  
  unsigned char  type;       // 0-     1-    
  union {
    char      str[50];       // 
    reference pTextItem;     //      TEXT_ITEM_ARR  ()
  };
};

//-------------------------------------------------------------------------------
//   " "
// (Unicode)
// ---
struct ViewPointerParamW {
  unsigned short style;      //  ,  0 -  
  double         x1, y1;     //  ( ) 
  double         x2, y2;     //    
  double         xt, yt;     //  
  unsigned char  type;       // 0-     1-    
  union {
    wchar_t   str[50];       // 
    reference pTextItem;     //      TEXT_ITEM_ARR  ()
  };
};

#ifdef _UNICODE
#define ViewPointerParamT  ViewPointerParamW
#else
#define ViewPointerParamT  ViewPointerParam
#endif // !_UNICODE


//-------------------------------------------------------------------------------
//     
// ---
struct ToleranceBranch {
  unsigned char arrowType;  //    1-  2-  0-  
  unsigned char tCorner;    // 1-8       
  reference pMathPoint;     //     ( POINT_ARR  )
                            //   -   (       -  tCorner1),
                            //   - (  )
                            //   -   (  )
};


//-------------------------------------------------------------------------------
//   " "
// ---
struct ToleranceParam {// 12.1.2001      
  unsigned char  tBase;     // 1-8      ( 1-      3..4..5  )
  unsigned short style;     //  ,  0 -                     :     :
  double x, y;              //                                           2     6
  unsigned char type;       //   0-  , 1-             :     :
  ToleranceBranch  branch1; //                                                      1..8..7
  ToleranceBranch  branch2; //  
};

//-------------------------------------------------------------------------------
//   " "
// ---
struct ksTolerancePar {
  unsigned char  tBase;     // 1-8      ( 1-      3..4..5  )
  unsigned short style;     //  ,  0 -                     :     :
  double x, y;              //                                           2     6
  unsigned char type;       //   0-  , 1-             :     :
  reference branchArr;      //    ( ToleranceBranch )            1..8..7
};

// . <ldefin2d.h>  
// CURVE_STYLE ...

//-------------------------------------------------------------------------------
//     
// ---
struct CurvePattern {
	double  visibleSeg;     //   
	double  invisibleSeg;   //   
};

//-------------------------------------------------------------------------------
//     
// ---
struct  CurvePicture {
  reference      polygon; //   ,   POLYLINE_ARR   (      0 )
  reference      fill;    //   ,    POLYLINE_ARR (     0 )
};

//-------------------------------------------------------------------------------
//      
// ---
struct CurvePatternEx {
	double         visibleSeg;      //   
	double         invisibleSeg;    //   
  double         dx;              //  .()    
  double         dy;              //
  unsigned char  pictureType;     //  
  union {
    struct  CurvePicture picture; // pictureType 0 -     
  	char    frwName[TEXT_LENGTH]; // pictureType 1     ,      AddStyle
  };
};

//-------------------------------------------------------------------------------
//      
// (Unicode)
// ---
struct CurvePatternExW {
	double         visibleSeg;      //   
	double         invisibleSeg;    //   
  double         dx;              //  .()    
  double         dy;              //
  unsigned char  pictureType;     //  
  union {
    struct  CurvePicture picture; // pictureType 0 -     
  	wchar_t frwName[TEXT_LENGTH]; // pictureType 1     ,      AddStyle
  };
};

#ifdef _UNICODE
#define CurvePatternExT  CurvePatternExW
#else
#define CurvePatternExT  CurvePatternEx
#endif // !_UNICODE


//-------------------------------------------------------------------------------
// curveType | LIKE_BASIC_LINE -       
// . <ldefin2d.h> LIKE_BASIC_LINE ...
//    
// ---
struct CurveStyleParam {
 	char           name[TEXT_LENGTH]; //  
  unsigned long  color;             // 
  double         paperWidth;        //    
  unsigned char  screenWidth;       //    
  unsigned char  curveType;         //   0-  1-  2-   
  reference      pattern;           // (  )        CURVE_STYLE-CurvePattern,  CURVE_STYLE_EX -CurvePatternEx
  unsigned char  even;              // (  ) 1-     0-  
};

//-------------------------------------------------------------------------------
// curveType | LIKE_BASIC_LINE -       
// . <ldefin2d.h> LIKE_BASIC_LINE ...
//    
// (Unicode)
// ---
struct CurveStyleParamW {
 	wchar_t        name[TEXT_LENGTH]; //  
  unsigned long  color;             // 
  double         paperWidth;        //    
  unsigned char  screenWidth;       //    
  unsigned char  curveType;         //   0-  1-  2-   
  reference      pattern;           // (  )        CURVE_STYLE-CurvePattern,  CURVE_STYLE_EX -CurvePatternEx
  unsigned char  even;              // (  ) 1-     0-  
};

#ifdef _UNICODE
#define CurveStyleParamT  CurveStyleParamW
#else
#define CurveStyleParamT  CurveStyleParam
#endif // !_UNICODE


//-------------------------------------------------------------------------------
//       (  -   )
// ---
struct DimensionPartsParam {
  reference      line1;     //   1
  reference      line2;     //   2
  reference      dimLine;   //   
  reference      dimLine1;  //   
  reference      leg;       // 
  reference      shelf;     // 
  reference      gr;        //      ,  
  reference      curveExt;  //   (   ),   (     )
};

//-------------------------------------------------------------------------------
//    
// ---
struct TextStyleParam {
  char           name[TEXT_LENGTH];      //  
  double         height;                 //  
  double         ksu;                    //  
  double         step;                   //  
  char           fontName[TEXT_LENGTH];  //  
  unsigned long  color;                  // 
  unsigned char  align;                  //  0-, 1- ,2-, 3 -  
  unsigned char  bold;                   //  1- , 0- 
  unsigned char  italic;                 //  1-  , 0-  
  unsigned char  underline;              //  1-  , 0 -  
  double         posKS;                  //   
  double         stepParPre;             //  ,  
  double         stepParPst;             //    
  double         leftEdge;               //   
  double         rightEdge;              //   
};

//-------------------------------------------------------------------------------
//    
// (Unicode)
// ---
struct TextStyleParamW {
  wchar_t        name[TEXT_LENGTH];      //  
  double         height;                 //  
  double         ksu;                    //  
  double         step;                   //  
  wchar_t        fontName[TEXT_LENGTH];  //  
  unsigned long  color;                  // 
  unsigned char  align;                  //  0-, 1- ,2-, 3 -  
  unsigned char  bold;                   //  1- , 0- 
  unsigned char  italic;                 //  1-  , 0-  
  unsigned char  underline;              //  1-  , 0 -  
  double         posKS;                  //   
  double         stepParPre;             //  ,  
  double         stepParPst;             //    
  double         leftEdge;               //   
  double         rightEdge;              //   
};

#ifdef _UNICODE
#define TextStyleParamT  TextStyleParamW
#else
#define TextStyleParamT  TextStyleParam
#endif // !_UNICODE

//-------------------------------------------------------------------------------
//      
// ---
struct ConicArcParam {
 double         A;
 double         B;
 double         C;
 double         D;
 double         E;
 double         F;      //   
 double x1; double y1;  //   
 double x2; double y2;  //   
 unsigned short style;  // 
};

//-------------------------------------------------------------------------------
//    
// ---
struct PolylineParam {
 reference      pMathPoint; //       POINT_ARR
 unsigned short style;      // 
};

//-------------------------------------------------------------------------------
//    . 
// ---
struct PolylineParamEx {
	reference      pMathPoint; //       POINT_ARR
	unsigned short style;      // 
	unsigned char  closed;     //    - 1  , 0 
	char           rezerv[10]; //  
};

//-------------------------------------------------------------------------------
//       
// ---
struct LibStyle {
  char          fileName [MAX_TEXT_LENGTH];//   
  int           styleNumber;               //    
  unsigned char typeAllocation;            //      0- ; 1-    
};

//-------------------------------------------------------------------------------
//       
// (Unicode)
// ---
struct LibStyleW {
  wchar_t       fileName [MAX_TEXT_LENGTH];//   
  int           styleNumber;               //    
  unsigned char typeAllocation;            //      0- ; 1-    
};

#ifdef _UNICODE
#define LibStyleT  LibStyleW
#else
#define LibStyleT  LibStyle
#endif // !_UNICODE


//-------------------------------------------------------------------------------
//      
// ---
struct TechnicalDemandParam {
  reference pGab;          //     RECT_ARR -( RectParam)
  unsigned short style;    // 
  unsigned short strCount; //     
};

//-------------------------------------------------------------------------------
//      
// ---
struct SpecRoughParam {
  unsigned short style;          //  
  unsigned char  sign;           //   0- -  , 1- -   , 2 --    
  unsigned char  t;              // 1-     0 -
  char           s[TEXT_LENGTH]; // 
};

//-------------------------------------------------------------------------------
//      
// ( Unicode )
// ---
struct SpecRoughParamW {
  unsigned short style;          //  
  unsigned char  sign;           //   0- -  , 1- -   , 2 --    
  unsigned char  t;              // 1-     0 -
  wchar_t        s[TEXT_LENGTH]; // 
};

#ifdef _UNICODE
#define SpecRoughParamT  SpecRoughParamW
#else
#define SpecRoughParamT  SpecRoughParam
#endif // !_UNICODE


// . <ldefin2d.h>    GetDocOptions
// DIMENTION_OPTIONS ...

//-------------------------------------------------------------------------------
//      
// ---
struct DimensionsOptions {
  double proLineExtension;        //     
  double textDistanceFromDimLine; //   .  
  double textDistanceFromProLine; //      
  double dimLineExtension;        //     
  double arrowLength;             //    

  unsigned short style;  // 

  unsigned char decimalsCount;  // -    0-9
  int anglePrecisionLevel;      //    0-, 1- , 2- 
  int hiddenToleranceNumber;    // -1  ;      1-17
};


//-------------------------------------------------------------------------------
// . <ldefin2d.h>    
// SPC_CLM_FORMAT ...
// . <ldefin2d.h>     
// SPC_INT ...
//     
// ---
struct SpcColumnParam {
  unsigned int  columnType;          //   SPC_CLM_FORMAT...SPC_CLM_USER
  unsigned int  ispoln;              //    
  unsigned int  block;               //  
  unsigned int  typeVal;             //    : LINT_ATTR_TYPE,
  											          	 // DOUBLE_ATTR_TYPE, STRING_ATTR_TYPE, RECORD_ATTR_TYPE
  char          name[ TEXT_LENGTH ]; //  
};

//-------------------------------------------------------------------------------
// . <ldefin2d.h>    
// SPC_CLM_FORMAT ...
// . <ldefin2d.h>     
// SPC_INT ...
//     
// (Unicode)
// ---
struct SpcColumnParamW {
  unsigned int  columnType;          //   SPC_CLM_FORMAT...SPC_CLM_USER
  unsigned int  ispoln;              //    
  unsigned int  block;               //  
  unsigned int  typeVal;             //    : LINT_ATTR_TYPE,
  											          	 // DOUBLE_ATTR_TYPE, STRING_ATTR_TYPE, RECORD_ATTR_TYPE
  wchar_t       name[ TEXT_LENGTH ]; //  
};

#ifdef _UNICODE
#define SpcColumnParamT  SpcColumnParamW
#else
#define SpcColumnParamT  SpcColumnParam
#endif // !_UNICODE

//-------------------------------------------------------------------------------
// . <ldefin2d.h>   
// CURVE_STYLE_LIBRARY ...    . ksGetLibraryStylesArray 
//       
// ---
struct LibraryStyleParam {
  char           styleName [MAX_TEXT_LENGTH]; //   
  unsigned int   styleId;                     //    
};

//-------------------------------------------------------------------------------
// . <ldefin2d.h>   
// CURVE_STYLE_LIBRARY ...    . ksGetLibraryStylesArray 
//       
// (Unicode)
// ---
struct LibraryStyleParamW {
  wchar_t        styleName [MAX_TEXT_LENGTH]; //   
  unsigned int   styleId;                     //    
};

#ifdef _UNICODE
#define LibraryStyleParamT  LibraryStyleParamW
#else
#define LibraryStyleParamT  LibraryStyleParam
#endif // !_UNICODE


//-------------------------------------------------------------------------------
//      - 
// . <ldefin2d.h>       - 
// ST_MIX_MM ...
// ---
struct InertiaParam {
  double xc, yc;      //   ,
  double f;           // ,
  double ly, lx;      //              x  y,
  double lxy;         //          x  y,
  double my, mx;      //             ( ,        )
  double mxy;         //        ( ,        )
  double jy, jx;      //    ,
  double a;           //        x
};

//-------------------------------------------------------------------------------
//     - 
// . <ldefin2d.h>       - 
// ST_MIX_MM ...
// ---
struct MassInertiaParam {
  double  r;               // 
  double  m;               // 
  double  v;               // 
  double  xc,   yc,   zc;  //   
  double  lxy,  lxz,  lyz; //       
  double  lx,   ly,   lz;  //             
  double  jy0z, jx0z, jx0y;//     ( )    
  double  jxy,  jxz,  jyz; //       
  double  jx,   jy,   jz;  //             
};

//-------------------------------------------------------------------------------
//     
// ---
struct VariableParam {
  char    name [MAX_TEXT_LENGTH];//   
  double  value;                 //  
  char    note[MAX_TEXT_LENGTH]; // 
};

//-------------------------------------------------------------------------------
//     
// (Unicode)
// ---
struct VariableParamW {
  wchar_t name [MAX_TEXT_LENGTH];//   
  double  value;                 //  
  wchar_t note[MAX_TEXT_LENGTH]; // 
};

#ifdef _UNICODE
#define VariableParamT  VariableParamW
#else
#define VariableParamT  VariableParam
#endif // !_UNICODE


//-------------------------------------------------------------------------------
// . <ldefin2d.h>   
// SN_NEAREST_POINT ...
// . <ldefin2d.h>     
// SN_DYNAMICALLY ...
//     
// ---
struct SnapOptions {
  // 
  unsigned char nearestPoint;      //  
  unsigned char nearestMiddle;     // 
  unsigned char intersect;         // 
  unsigned char tangentToCurve;    // 
  unsigned char normalToCurve;     // 
  unsigned char grid;              //  
  unsigned char xyAlign;           // 
  unsigned char angSnap;           //  
  unsigned char pointOnCurve;      //   

  unsigned int  commonOpt;         //    :  ,  ,    ,  
  double        angleStep;         //      
  unsigned char localSnap;         //     SN_NEAREST_POINT...SN_POINT_CURVE  0
};

// . <ldefin2d.h>     GetSysOptions   SetSysOptions
// SNAP_OPTIONS ...


//-------------------------------------------------------------------------------
//    Nurbs-
// ---
struct NurbsParam {
  unsigned  char  degree;   //   > 2 && < 9
  unsigned  char  close;    //    0 -  1 - 
  unsigned  short style;    //   
  reference       pPoint;   //     (NurbsPointParam )
  reference       pKnot;    //     (double)
  unsigned  char  periodic; // 1 -  ; 0 -   - GetObjParam
};

//-------------------------------------------------------------------------------
//     
// ---
struct InsertFragmentParam {
  PlacementParam  place;        //    
  unsigned  char  insertType;   //  
                                // 0-   , 1- , 3-  
  unsigned char   multiLayer;   //  1 -  , 0 - 
  
  char            fileName[MAX_TEXT_LENGTH]; //     "\0"   
  char            comment[MAX_TEXT_LENGTH];  //  
};

//-------------------------------------------------------------------------------
//    
// (Unicode)
// ---
struct InsertFragmentParamW {
  PlacementParam  place;        //    
  unsigned  char  insertType;   //  
                                // 0-   , 1- , 3-  
  unsigned char   multiLayer;   //  1 -  , 0 - 
  
  wchar_t         fileName[MAX_TEXT_LENGTH]; //     "\0"   
  wchar_t         comment[MAX_TEXT_LENGTH];  //  
};

#ifdef _UNICODE
#define InsertFragmentParamT  InsertFragmentParamW
#else
#define InsertFragmentParamT  InsertFragmentParam
#endif // !_UNICODE


//-------------------------------------------------------------------------------
//      
// ---
struct InsertFragmentParamEx {
  PlacementParam place;                      //    
  unsigned  char insertType;                 //  
                                             // 0-   , 1- , 3-  
  unsigned char  multiLayer;                 //  1 -  , 0 - 
  char           fileName [MAX_TEXT_LENGTH]; //     "\0"   
  char           comment  [MAX_TEXT_LENGTH]; //  
  unsigned char  scaleProjLinesSize;         //       
};

//-------------------------------------------------------------------------------
//      
// (Unicode)
// ---
struct InsertFragmentParamExW {
  PlacementParam place;                      //    
  unsigned  char insertType;                 //  
                                             // 0-   , 1- , 3-  
  unsigned char  multiLayer;                 //  1 -  , 0 - 
  wchar_t        fileName [MAX_TEXT_LENGTH]; //     "\0"   
  wchar_t        comment  [MAX_TEXT_LENGTH]; //  
  unsigned char  scaleProjLinesSize;         //       
};

#ifdef _UNICODE
#define InsertFragmentParamExT  InsertFragmentParamExW
#else
#define InsertFragmentParamExT  InsertFragmentParamEx
#endif // !_UNICODE


//-------------------------------------------------------------------------------
// . <ldefin2d.h>   
// CONSTRAINT_FIXED_POINT ...
//    
// ---
struct ConstraintParam {
  unsigned short  constrType;    //  
  int             index;         //     (   0,     0- )
  reference       partner;       //  
  int             partnerIndex;  //      (   0,     0- )
};

//-------------------------------------------------------------------------------
//       
// ---
struct CornerParam {
  int           index;  //   ( 0, 1, 2, .... )
  unsigned char fillet; //   1 - , 0 - 
  double        l1;     //   1   
  double        l2;     //   2 
};

//-------------------------------------------------------------------------------
//   
// ---
struct RectangleParam {
	double         x;          //   1
  double         y;
  double         ang;        //     1-   2-
  double         height;     // 
  double         width;      // 
	unsigned short style;      //  
  reference      pCorner;    //      CORNER_ARR
};

//-------------------------------------------------------------------------------
//    
// ---
struct RegularPolygonParam {
  int            count;         //   
  double         xc;            //  
  double         yc;
  double         ang;           //   
  double         radius;        //  
  unsigned char  describe;      //   .
	unsigned short style;         //  
  reference      pCorner;       //      CORNER_ARR
};

//-------------------------------------------------------------------------------
//    " "
// ---
struct CentreParam {
  reference	    baseCurve;  //     0
  double        x, y;       //  ,  baseCurve  -  
  double        ang;        // ,  baseCurve  -  
  unsigned char type;       //    0- , 1-   2-  
  unsigned char standXpTail;// 1-  "" 
  unsigned char standXmTail;//
  unsigned char standYpTail;//
  unsigned char standYmTail;//
  double        lenXpTail;  //  ,    
  double        lenXmTail;
  double        lenYpTail;
  double        lenYmTail;
};

//-------------------------------------------------------------------------------
//      
// ---
struct DocAttachedSpcParam {
  char          fileName[MAX_TEXT_LENGTH]; //    
  char          comment[MAX_TEXT_LENGTH];  //    
  unsigned char transmit;                  // 1 -   -     
};

//-------------------------------------------------------------------------------
//      
// (Unicode)
// ---
struct DocAttachedSpcParamW {
  wchar_t       fileName[MAX_TEXT_LENGTH]; //    
  wchar_t       comment[MAX_TEXT_LENGTH];  //    
  unsigned char transmit;                  // 1 -   -     
};

#ifdef _UNICODE
#define DocAttachedSpcParamT  DocAttachedSpcParamW
#else
#define DocAttachedSpcParamT  DocAttachedSpcParam
#endif // !_UNICODE


//-------------------------------------------------------------------------------
// . <ldefin2d.h>   
// SPC_BASE_OBJECT ...
//    
// ---
struct SpcObjParam {
  reference      docArr;         //   DOC_SPCOBJ_ARR       

  //     
  unsigned short typeObj;        //   - SPC_BASE_OBJECT ... SPC_EMPTY_STR !!!    !!!
  unsigned short numbSection;    //                                     !!!    !!!

  //     - 
  unsigned short blockNumber;    //   (  - 0 )  SPC_COMMENT - 

  //      
  unsigned short numbSubSection; //  
  char           subSectionName[MAX_TEXT_LENGTH]; //   !!!    !!!
  unsigned char  firstOnSheet;   // 1 -   
  unsigned char  insFrgType;     // 0 -  ,     1 -    
                                 // 2 -     !!!    !!!
  unsigned char  posInc;         // 1 -  ; 0 -   

  //     
  unsigned char  first;          // 1 -   , 0 -    !!!    !!!
  unsigned char  draw;           // 1 -    0 -    (    )
  unsigned char  posNotDraw;     // 0 -     1  
  unsigned char  ispoln;         // 1 -   
};

//-------------------------------------------------------------------------------
// . <ldefin2d.h>   
// SPC_BASE_OBJECT ...
//    
// (Unicode)
// ---
struct SpcObjParamW {
  reference      docArr;         //   DOC_SPCOBJ_ARR       

  //     
  unsigned short typeObj;        //   - SPC_BASE_OBJECT ... SPC_EMPTY_STR !!!    !!!
  unsigned short numbSection;    //                                     !!!    !!!

  //     - 
  unsigned short blockNumber;    //   (  - 0 )  SPC_COMMENT - 

  //      
  unsigned short numbSubSection; //  
  wchar_t        subSectionName[MAX_TEXT_LENGTH]; //   !!!    !!!
  unsigned char  firstOnSheet;   // 1 -   
  unsigned char  insFrgType;     // 0 -  ,     1 -    
                                 // 2 -     !!!    !!!
  unsigned char  posInc;         // 1 -  ; 0 -   

  //     
  unsigned char  first;          // 1 -   , 0 -    !!!    !!!
  unsigned char  draw;           // 1 -    0 -    (    )
  unsigned char  posNotDraw;     // 0 -     1  
  unsigned char  ispoln;         // 1 -   
};

#ifdef _UNICODE
#define SpcObjParamT  SpcObjParamW
#else
#define SpcObjParamT  SpcObjParam
#endif // !_UNICODE

//-------------------------------------------------------------------------------
//    
// ---
struct RasterParam {
	PlacementParam place;                      //  
  char           fileName[MAX_TEXT_LENGTH];  //    
  unsigned char  embeded;                    // embeded - 1 -    ,
   													                 // 0 -      (  )
};

//-------------------------------------------------------------------------------
//    
// (Unicode)
// ---
struct RasterParamW {
	PlacementParam place;                      //  
  wchar_t        fileName[MAX_TEXT_LENGTH];  //    
  unsigned char  embeded;                    // embeded - 1 -    ,
   													                 // 0 -      (  )
};

#ifdef _UNICODE
#define RasterParamT  RasterParamW
#else
#define RasterParamT  RasterParam
#endif // !_UNICODE


//-------------------------------------------------------------------------------
//     RECORD_ATTR_TYPE
// ---
struct RecordTypeAttrParam {
  char attrLibName[MAX_TEXT_LENGTH];  //     

  int  key1;                          //      
  int  key2;                          //  -   0   
  int  key3;
  int  key4;
};

//-------------------------------------------------------------------------------
//     RECORD_ATTR_TYPE
// (Unicode)
// ---
struct RecordTypeAttrParamW {
  wchar_t attrLibName[MAX_TEXT_LENGTH];  //     

  int     key1;                          //      
  int     key2;                          //  -   0   
  int     key3;
  int     key4;
};

#ifdef _UNICODE
#define RecordTypeAttrParamT  RecordTypeAttrParamW
#else
#define RecordTypeAttrParamT  RecordTypeAttrParam
#endif // !_UNICODE


//     DOUBLE_ATTR_TYPE  LINT_ATTR_TYPE
struct NumberTypeAttrParam {
  double minValue;
  double maxValue;
};

//-------------------------------------------------------------------------------
//      
//       
// ---
struct SpcStyleColumnParam {
  char          nameColumn[MAX_TEXT_LENGTH];  //  
  unsigned int  columnType;         //   SPC_CLM_FORMAT ... SPC_CLM_FACTORY
  unsigned int  ispoln;             //     

  unsigned char edit;               // 1 -     , 0 - 
  unsigned char createSum;          // 1 -     , 0 - 
  unsigned char multiplyToCount;    // 1 -      , 0 - 
  unsigned char useForSectionTitle; // 1 -      , 0 - 
  unsigned char textDn;             // 1 -     , 0 -   
  char          rezerv[10];         //  

  unsigned int  linkId;             //     

  unsigned int  typeVal;            //    : LINT_ATTR_TYPE,
  																	// DOUBLE_ATTR_TYPE, STRING_ATTR_TYPE, RECORD_ATTR_TYPE
  union {
    RecordTypeAttrParam recordType; //     RECORD_ATTR_TYPE
    NumberTypeAttrParam numberType; //     DOUBLE_ATTR_TYPE  LINT_ATTR_TYPE
  };
};

//-------------------------------------------------------------------------------
//      
//       
// (Unicode)
// ---
struct SpcStyleColumnParamW {
  wchar_t       nameColumn[MAX_TEXT_LENGTH];  //  
  unsigned int  columnType;          //   SPC_CLM_FORMAT ... SPC_CLM_FACTORY
  unsigned int  ispoln;              //     

  unsigned char edit;                // 1 -     , 0 - 
  unsigned char createSum;           // 1 -     , 0 - 
  unsigned char multiplyToCount;     // 1 -      , 0 - 
  unsigned char useForSectionTitle;  // 1 -      , 0 - 
  unsigned char textDn;              // 1 -     , 0 -   
  char          rezerv[10];          //  

  unsigned int  linkId;              //     

  unsigned int  typeVal;             //    : LINT_ATTR_TYPE,
  											  				   // DOUBLE_ATTR_TYPE, STRING_ATTR_TYPE, RECORD_ATTR_TYPE
  union {
    RecordTypeAttrParamW recordType; //     RECORD_ATTR_TYPE
    NumberTypeAttrParam  numberType; //     DOUBLE_ATTR_TYPE  LINT_ATTR_TYPE
  };
};

#ifdef _UNICODE
#define SpcStyleColumnParamT  SpcStyleColumnParamW
#else
#define SpcStyleColumnParamT  SpcStyleColumnParam
#endif // !_UNICODE


//-------------------------------------------------------------------------------
// . <ldefin2d.h>  
// SPC_SORT_OFF ...
//    a 
// ---
struct SpcStyleSectionParam {
  char           sectionName[MAX_TEXT_LENGTH]; //  
  unsigned short number;                       //  
  unsigned int   sortColumnType;               //       
  unsigned int   sortIspoln;                   //      

  unsigned char  dataType;                     //   : 0 -   ,
                                               //                        1 -      
  unsigned short sortType;                     //   SPC_SORT_OFF ... SPC_SORT_DOWN
  reference      arrColumn;                    //      SpcStyleColumnParam
  reference      arrAdditionalColumn;          //    
  															               //   SpcStyleColumnParam
  char           rezerv[10];                   //  
};

//-------------------------------------------------------------------------------
// . <ldefin2d.h>  
// SPC_SORT_OFF ...
//    a 
// (Unicode)
// ---
struct SpcStyleSectionParamW {
  wchar_t        sectionName[MAX_TEXT_LENGTH]; //  
  unsigned short number;                       //  
  unsigned int   sortColumnType;               //       
  unsigned int   sortIspoln;                   //      

  unsigned char  dataType;                     //   : 0 -   ,
                                               //                        1 -      
  unsigned short sortType;                     //   SPC_SORT_OFF ... SPC_SORT_DOWN
  reference      arrColumn;                    //      SpcStyleColumnParam
  reference      arrAdditionalColumn;          //    
  															               //   SpcStyleColumnParam
  char           rezerv[10];                   //  
};

#ifdef _UNICODE
#define SpcStyleSectionParamT  SpcStyleSectionParamW
#else
#define SpcStyleSectionParamT  SpcStyleSectionParam
#endif // !_UNICODE


//-------------------------------------------------------------------------------
//    .     
// ---
struct SpcSubSectionParam {
  char           name[MAX_TEXT_LENGTH]; // 
  unsigned short number;                // 
};

//-------------------------------------------------------------------------------
//    .     
// (Unicode)
// ---
struct SpcSubSectionParamW {
  wchar_t        name[MAX_TEXT_LENGTH]; // 
  unsigned short number;                // 
};

#ifdef _UNICODE
#define SpcSubSectionParamT  SpcSubSectionParamW
#else
#define SpcSubSectionParamT  SpcSubSectionParam
#endif // !_UNICODE

//-------------------------------------------------------------------------------
//     
// ---
struct SpcTuningSectionParam {
  unsigned char  subsectionOn;  // 1-   , 0- 
  unsigned char  geometryOn;    // 1-   , 0- 
  unsigned char  positionOn;    // 1-   , 0-  
  unsigned char  sortOn;        // 1- , 0-  
  unsigned char  firstOnSheet;  // 1-     , 0-

  char           rezerv[10];    //  

  unsigned short rezervCount;   //     
  unsigned short number;        //   -   

  reference      arrSubSection; //    SpcSubSectionParam  
};

//-------------------------------------------------------------------------------
//     
// ---
struct SpcTuningStyleParam {
  unsigned char grToSP;                    //   C ->  0-; 1-  ; 2-  ;
  unsigned char zoneCalc;                  // 1-  , 0- 
  unsigned char showSectionName;           // 1-    , 0- 
  unsigned char positionCalc;              // 1-   , 0- 
  unsigned char geometryDel;               // 1-    , 0- 
  unsigned char positionDel;               // 
  unsigned char massCalc;                  // 
  unsigned char disableEmptyStr;           //       
  unsigned char insertNull;                //    1-     0- 
  unsigned char insertDash;                //    1-   0- 
  unsigned char disableEmptyBlockStr;      //       
  unsigned char showInfoByDetBlock;        // 0-    1-  (   > 10 )
  unsigned char ispolnOn;                  // 1-   
  unsigned char ispolnMarkFull;            // 1-    0 -   (-01)
  unsigned char blocOnNewPage;             //     
  unsigned char userTextStyle;             // 1-     

  unsigned char  countIspoln;              //  ;        <= 255   countIspolnEx == 0
  unsigned char  countBlock;               //               <= 255   countBlockEx == 0
  unsigned short countIspolnEx;            //  
  unsigned short countBlockEx;             //  
  unsigned char  delSpcObjOnDelGeometry;   //      
  unsigned char  copySpcObjOnCopyGeometry; //       
  char           rezerv[4];                //  

  TextStyleParam sectionTextStyleFirst;    //     -  
  TextStyleParam sectionTextStyleNext;     //     -  
  TextStyleParam objectTextStyle;          //    

  char           predefinedTextFileName[MAX_TEXT_LENGTH];
  reference      arrSection;             //      SpcTuningSectionParam
};

//-------------------------------------------------------------------------------
//     
// (Unicode)
// ---
struct SpcTuningStyleParamW {
  unsigned char grToSP;                  //   C ->  0-; 1-  ; 2-  ;
  unsigned char zoneCalc;                // 1-  , 0- 
  unsigned char showSectionName;         // 1-    , 0- 
  unsigned char positionCalc;            // 1-   , 0- 
  unsigned char geometryDel;             // 1-    , 0- 
  unsigned char positionDel;             // 
  unsigned char massCalc;                // 
  unsigned char disableEmptyStr;         //       
  unsigned char insertNull;              //    1-     0- 
  unsigned char insertDash;              //    1-   0- 
  unsigned char disableEmptyBlockStr;    //       
  unsigned char showInfoByDetBlock;      // 0-    1-  (   > 10 )
  unsigned char ispolnOn;                // 1-   
  unsigned char ispolnMarkFull;          // 1-    0 -   (-01)
  unsigned char blocOnNewPage;           //     
  unsigned char userTextStyle;           // 1-     

  unsigned char  countIspoln;              //  ;        <= 255   countIspolnEx == 0
  unsigned char  countBlock;               //               <= 255   countBlockEx == 0
  unsigned short countIspolnEx;            //  
  unsigned short countBlockEx;             //  
  unsigned char  delSpcObjOnDelGeometry;   //      
  unsigned char  copySpcObjOnCopyGeometry; //       
  char           rezerv[4];                //  

  TextStyleParamW sectionTextStyleFirst;  //     -  
  TextStyleParamW sectionTextStyleNext;   //     -  
  TextStyleParamW objectTextStyle;        //    

  wchar_t         predefinedTextFileName[MAX_TEXT_LENGTH];
  reference       arrSection;             //      SpcTuningSectionParam
};

#ifdef _UNICODE
#define SpcTuningStyleParamT  SpcTuningStyleParamW
#else
#define SpcTuningStyleParamT  SpcTuningStyleParam
#endif // !_UNICODE


//-------------------------------------------------------------------------------
//    
// ---
struct SpcStyleParam {
  char                layoutName1[MAX_TEXT_LENGTH];  //       
  char                layoutName2[MAX_TEXT_LENGTH];  //       
  unsigned int        shtType1;                      //       
  unsigned int        shtType2;                      //     

  unsigned char       variant;             //     0-, 1-, 2-, 3-, 4-
  unsigned char       sectionOn;           // 1-    , 0- 
  char                rezerv[10];          //  

  SpcTuningStyleParam tuning;              //  ,    

  reference           arrColumn;           //     -  SpcStyleColumnParam
  reference           arrAdditionalColumn; //    SpcStyleColumnParam
  reference           arrSection;          //     SpcStyleSectionParam

  unsigned char       type;                //  a   0- , 1 - 
  union {
    struct StandartSheet stPar;   //    
    struct SheetSize     usPar;   //    
  };
};

//-------------------------------------------------------------------------------
//    
// (Unicode)
// ---
struct SpcStyleParamW {
  wchar_t              layoutName1[MAX_TEXT_LENGTH];  //       
  wchar_t              layoutName2[MAX_TEXT_LENGTH];  //       
  unsigned int         shtType1;                      //       
  unsigned int         shtType2;                      //     

  unsigned char        variant;             //     0-, 1-, 2-, 3-, 4-
  unsigned char        sectionOn;           // 1-    , 0- 
  char                 rezerv[10];          //  

  SpcTuningStyleParamW tuning;              //  ,    

  reference            arrColumn;           //     -  SpcStyleColumnParam
  reference            arrAdditionalColumn; //    SpcStyleColumnParam
  reference            arrSection;          //     SpcStyleSectionParam

  unsigned char        type;                //  a   0- , 1 - 
  union {
    struct StandartSheet stPar;   //    
    struct SheetSize     usPar;   //    
  };
};

#ifdef _UNICODE
#define SpcStyleParamT  SpcStyleParamW
#else
#define SpcStyleParamT  SpcStyleParam
#endif // !_UNICODE


//-------------------------------------------------------------------------------
//    
// ---
struct SpcDescrParam {
  char         layoutName[MAX_TEXT_LENGTH]; //    
  unsigned int styleId;                     //    
  char         spcName   [MAX_TEXT_LENGTH]; //    
};

//-------------------------------------------------------------------------------
//    
// (Unicode)
// ---
struct SpcDescrParamW {
  wchar_t      layoutName[MAX_TEXT_LENGTH]; //    
  unsigned int styleId;                     //    
  wchar_t      spcName   [MAX_TEXT_LENGTH]; //    
};

#ifdef _UNICODE
#define SpcDescrParamT  SpcDescrParamW
#else
#define SpcDescrParamT  SpcDescrParam
#endif // !_UNICODE


//-------------------------------------------------------------------------------
//    
// ---
struct QualityItemParam {
  short  minLimit;     //     
  short  maxLimit;     //     
  double high;         //  
  double low;          //  
};

//-------------------------------------------------------------------------------
// . <ldefin2d.h> LtQualSystem -  
// . <ldefin2d.h> LtQualDir - 
//   
// ---
struct QualityContensParam {
	LtQualSystem systemQuality;         //  
  LtQualDir    kindQuality;           //  
  char         name[MAX_TEXT_LENGTH]; //  
  reference    pQualityItems;         //  
};

//-------------------------------------------------------------------------------
// . <ldefin2d.h> LtQualSystem -  
// . <ldefin2d.h> LtQualDir - 
//   
// (Unicode)
// ---
struct QualityContensParamW {
	LtQualSystem systemQuality;         //  
  LtQualDir    kindQuality;           //  
  wchar_t      name[MAX_TEXT_LENGTH]; //  
  reference    pQualityItems;         //  
};

#ifdef _UNICODE
#define QualityContensParamT  QualityContensParamW
#else
#define QualityContensParamT  QualityContensParam
#endif // !_UNICODE

//-------------------------------------------------------------------------------
// . <ldefin2d.h> LtVariantType -    LtVariant
//      
// ---
struct LtVariant {
	LtVariantType vType;              //   
  short 				colVisible;         //   1 -  , 0 - 
  short 				sortKey;            //     , 0 -  
  short 				wReserved3;         // 
  union {
    char          chVal;                   //               ltv_Char    1
    unsigned char ucVal;                   //                 ltv_UChar   2
    int           iVal;                    //                ltv_Int     3
    unsigned int  uiVal;                   //     ltv_UInt    4
    long          lVal;                    //         ltv_Long    5
    float         fVal;                    //         ltv_Float   6
    double        dVal;                    //              ltv_Double  7
  	char          strVal[MAX_TEXT_LENGTH]; //               ltv_Str     8
    short         shVal;                   //        ltv_Short   10
  };
};

//-------------------------------------------------------------------------------
// . <ldefin2d.h> LtVariantType -    LtVariant
//      
// (Unicode)
// ---
struct LtVariantEx {
	LtVariantType vType;              //   
  short 				colVisible;         //   1 -  , 0 - 
  short 				sortKey;            //     , 0 -  
  short 				wReserved3;         // 
  union {
    char          chVal;                    //               ltv_Char    1
    unsigned char ucVal;                    //                 ltv_UChar   2
    int           iVal;                     //                ltv_Int     3
    unsigned int  uiVal;                    //     ltv_UInt    4
    long          lVal;                     //         ltv_Long    5
    float         fVal;                     //         ltv_Float   6
    double        dVal;                     //              ltv_Double  7
    char          strVal[MAX_TEXT_LENGTH];  //               ltv_Str     8
    short         shVal;                    //        ltv_Short   10
    wchar_t       wstrVal[MAX_TEXT_LENGTH]; //               ltv_WStr    11
  };
};


//-------------------------------------------------------------------------------
//    
// ---
struct HatchLineParam {
  double        x, y;          //  
  double        dx, dy;        //    . dy     !
  double        ang;           //  
  unsigned char typeCurvStyle; // 0 - (style), 1 - (curPar)
  union {
  	unsigned short  style;     //   (1-11)
    CurveStyleParam curPar;    //   , pattern     CurvePattern
  };
};

//-------------------------------------------------------------------------------
//    
// (Unicode)
// ---
struct HatchLineParamW {
  double        x, y;          //  
  double        dx, dy;        //    . dy     !
  double        ang;           //  
  unsigned char typeCurvStyle; // 0 - (style), 1 - (curPar)
  union {
  	unsigned short   style;    //   (1-11)
    CurveStyleParamW curPar;   //   , pattern     CurvePattern
  };
};

#ifdef _UNICODE
#define HatchLineParamT  HatchLineParamW
#else
#define HatchLineParamT  HatchLineParam
#endif // !_UNICODE


//-------------------------------------------------------------------------------
//    
// ---
struct HatchStyleParam {
 	char           name[TEXT_LENGTH]; //  
  double         step;              // 
  double         ang;               //  
  MathPointParam refPoint;          //  
  double         width;             // 
  unsigned long  color;             // ,   FREE_COLOR (0xff000000l)
  unsigned char  mayChangeAngle;    //     
  unsigned char  mayChangeWidth;    //     
  unsigned char  mayChangeSpace;    //    /
  unsigned char  isScalable;        //   (1)  (0)
  reference      arrLineParam;      //    ,    HatchLineParam
};

//-------------------------------------------------------------------------------
//    
// (Unicode)
// ---
struct HatchStyleParamW {
 	wchar_t        name[TEXT_LENGTH]; //  
  double         step;              // 
  double         ang;               //  
  MathPointParam refPoint;          //  
  double         width;             // 
  unsigned long  color;             // ,   FREE_COLOR (0xff000000l)
  unsigned char  mayChangeAngle;    //     
  unsigned char  mayChangeWidth;    //     
  unsigned char  mayChangeSpace;    //    /
  unsigned char  isScalable;        //   (1)  (0)
  reference      arrLineParam;      //    ,    HatchLineParam
};

#ifdef _UNICODE
#define HatchStyleParamT  HatchStyleParamW
#else
#define HatchStyleParamT  HatchStyleParam
#endif // !_UNICODE

// . <ldefin2d.h>      
// FORMAT_BMP ...
// . <ldefin2d.h>      
// BLACKWHITE ...
// . <ldefin2d.h>         
// BPP_COLOR_01 ...
//-----------------------------------------------------------------------------
//       
// ---
struct RasterFormatParam {
  unsigned char          format;                 //   FORMAT_BMP...FORMAT_PCX
  unsigned char          colorBPP;               //   (  ) BPP_COLOR_01...BPP_COLOR_32
  unsigned char          greyScale;              // >0  
  int                    extResolution;          //   : 0 -  
  double                 extScale;               // 
  unsigned char          colorType;              //   BLACKWHITE...COLOROBJECT
  unsigned char          onlyThinLine;           // >0 -   
	char                   pages[MAX_TEXT_LENGTH]; //      "beg1-end1, beg2-end2, beg3-end3,  ..."
  unsigned char          rangeIndex;             // 0 - ,  1-  2- ,                                     
  unsigned char          multiPageOutput;        // >0       (  FORMAT_TIF)
};

// . <ldefin2d.h>      
// FORMAT_BMP ...
// . <ldefin2d.h>      
// BLACKWHITE ...
// . <ldefin2d.h>         
// BPP_COLOR_01 ...
//-----------------------------------------------------------------------------
//       
// (Unicode)
// ---
struct RasterFormatParamW {
  unsigned char          format;                 //   FORMAT_BMP...FORMAT_PCX
  unsigned char          colorBPP;               //   (  ) BPP_COLOR_01...BPP_COLOR_32
  unsigned char          greyScale;              // >0  
  int                    extResolution;          //   : 0 -  
  double                 extScale;               // 
  unsigned char          colorType;              //   BLACKWHITE...COLOROBJECT
  unsigned char          onlyThinLine;           // >0 -   
	wchar_t                pages[MAX_TEXT_LENGTH]; //      "beg1-end1, beg2-end2, beg3-end3,  ..."
  unsigned char          rangeIndex;             // 0 - ,  1-  2- ,                                     
  unsigned char          multiPageOutput;        // >0       (  FORMAT_TIF)
};

#ifdef _UNICODE
#define RasterFormatParamT  RasterFormatParamW
#else
#define RasterFormatParamT  RasterFormatParam
#endif // !_UNICODE


//-------------------------------------------------------------------------------
// . <ldefin2d.h> LtNodeType -       
//    
// ---
struct TreeNodeParam {
  long          type;                  //  : , ,  ( LtNodeType)
  char          name[MAX_TEXT_LENGTH]; //  
  reference     comment;               //  -   CHAR_STR_ARR -    
  reference     nodes;                 //     TreeNodeParam
};

//-------------------------------------------------------------------------------
// . <ldefin2d.h> LtNodeType -       
//    
// (Unicode)
// ---
struct TreeNodeParamW {
  long          type;                  //  : , ,  ( LtNodeType)
  wchar_t       name[MAX_TEXT_LENGTH]; //  
  reference     comment;               //  -   CHAR_STR_ARR_W -    
  reference     nodes;                 //     TreeNodeParam
};

#ifdef _UNICODE
#define TreeNodeParamT  TreeNodeParamW
#else
#define TreeNodeParamT  TreeNodeParam
#endif // !_UNICODE



//-------------------------------------------------------------------------------
//   
// ---
struct ViewColorParam {
  long                   color;        //  ,  -1    ,   Windows
  unsigned char          useGradient;  // 1 -      
                                       // 0 -  . (   3D-)
  long                   topColor;     //    (   3D-)
  long                   bottomColor;  //    (   3D-)
};

//-------------------------------------------------------------------------------
// . <ldefin2d.h> LtViewType -  
//    
// ---
struct AssociationViewParam {
  ViewParam      viewPar;                      //  

  char           fileName[MAX_TEXT_LENGTH];    //   3d 
  char           projectionName[TEXT_LENGTH];  //   (       )

  unsigned char  viewType;                     //    LtViewType (readOnly)
  unsigned char  dimensionLayoutScaling;       //      (  SetObjParam)

  unsigned char  projectionLink;               //  
  unsigned char  disassembly;                  // 

  long           visibleLinesStyle;            //       ,  0 -  
  long           hiddenLinesStyle;             //      ,  0 -    
  long           tangentEdgesStyle;            //      ,  0 -    
  unsigned char  hiddenLinesShow;              //    
  unsigned char  tangentEdgesShow;             //     

  unsigned char  projBodies;                   //   
  unsigned char  projSurfaces;                 //   
  unsigned char  projThreads;                  //   

  unsigned char  reserve[30];                  // 
  HatchParamEx   hatchPar;                     //  ,     \
  unsigned char  sameHatch;                    // o    
  unsigned char  section;                      //  / 
};

//-------------------------------------------------------------------------------
// . <ldefin2d.h> LtViewType -  
//    
// (Unicode)
// ---
struct AssociationViewParamW {
  ViewParamW     viewPar;                      //  

  wchar_t        fileName[MAX_TEXT_LENGTH];    //   3d 
  wchar_t        projectionName[TEXT_LENGTH];  //   (       )

  unsigned char  viewType;                     //    LtViewType (readOnly)
  unsigned char  dimensionLayoutScaling;       //      (  SetObjParam)

  unsigned char  projectionLink;               //  
  unsigned char  disassembly;                  // 

  long           visibleLinesStyle;            //       ,  0 -  
  long           hiddenLinesStyle;             //      ,  0 -    
  long           tangentEdgesStyle;            //      ,  0 -    
  unsigned char  hiddenLinesShow;              //    
  unsigned char  tangentEdgesShow;             //     

  unsigned char  projBodies;                   //   
  unsigned char  projSurfaces;                 //   
  unsigned char  projThreads;                  //   
  
  unsigned char  reserve[30];                  // 
  HatchParamEx   hatchPar;                     //  ,     \
  unsigned char  sameHatch;                    // o    
  unsigned char  section;                      //  / 
};

#ifdef _UNICODE
#define AssociationViewParamT  AssociationViewParamW
#else
#define AssociationViewParamT  AssociationViewParam
#endif // !_UNICODE

//-------------------------------------------------------------------------------
//     
// ---
struct TextDocumentParam {
  unsigned char      regim;                     // 0 -  ,
                                                // 1 -  
  char               fileName[MAX_TEXT_LENGTH]; //    
  char               comment [TEXT_LENGTH];     // 
  char               author  [TEXT_LENGTH];     // 
  LibraryStyleParam  firstSheet;                //   (   ,    )
  LibraryStyleParam  evenSheet;                 //   (   ,    )
  LibraryStyleParam  oddSheet;                  //   (   ,    )
  reference          arrTitleSheet;             //       LIBRARY_STYLE_ARR
  reference          arrTailSheet;              //        LIBRARY_STYLE_ARR
  unsigned char      type;                      //    DocType (lt_DocTxtStandart  lt_DocTxtUser )
  union { 
    struct StandartSheet stPar;                 //   ; multiply  
    struct SheetSize     usPar;                 //    
  };
};

//-------------------------------------------------------------------------------
//     
// (Unicode)
// ---
struct TextDocumentParamW {
  unsigned char       regim;                     // 0 -  ,
                                                 // 1 -  
  wchar_t             fileName [MAX_TEXT_LENGTH];//    
  wchar_t             comment  [TEXT_LENGTH];    // 
  wchar_t             author   [TEXT_LENGTH];    // 
  LibraryStyleParamW  firstSheet;                //   (   ,    )
  LibraryStyleParamW  evenSheet;                 //   (   ,    )
  LibraryStyleParamW  oddSheet;                  //   (   ,    )
  reference           arrTitleSheet;             //       LIBRARY_STYLE_ARR
  reference           arrTailSheet;              //        LIBRARY_STYLE_ARR
  unsigned char       type;                      //    DocType (lt_DocTxtStandart  lt_DocTxtUser )
  union { 
    struct StandartSheet stPar;                  //   ; multiply  
    struct SheetSize     usPar;                  //    
  };
};

#ifdef _UNICODE
#define TextDocumentParamT  TextDocumentParamW
#else
#define TextDocumentParamT  TextDocumentParam
#endif // !_UNICODE


//-------------------------------------------------------------------------------
//   
// ---
struct AxisLineParam {
  MathPointParam begPoint; //     
  MathPointParam endPoint; //     
};

//-------------------------------------------------------------------------------
//   " "
// ---
struct RemoteElementParam {
  unsigned short      style;      //  ,  0 -  ,
                                  //  style = INDICATIN_TEXT_LINE_ARR -> pText-  TEXT_LINE_ARR
  long                signType;   //   LtRemoteElmSignType
  double              x;          //    
  double              y;
  double              width;      //  (    )
  double              height;     //  (    )
  double              smooth;     //   
  double              radius;     //   ( )
  double              shelfX;     //   
  double              shelfY;
  int                 shelfDir;   //    X (1 - -1-, 2-     3-   )
  reference           pText;      //  style = INDICATIN_TEXT_LINE_ARR , TEXT_LINE_ARR -    
                                  // CHAR_STR_ARR  CHAR_STR_ARR_W -      
};

//-----------------------------------------------------------------------------
//      2d 
// ---
struct CopyObjectParam {
  reference p;                    //   , , , 
  double xOld;                    //   
  double yOld;
  double xNew;                    //    
  double yNew;
  double scale;                   // 
  double angle;                   //    
  unsigned char attrCopy;         //   
  unsigned char dimLineScale;     //   
  unsigned char spcObjCopy;       //   
  unsigned char reserv[9];        //  -  
};

//-----------------------------------------------------------------------------
//      \    COM
// ---
struct NotifyConnectionParam {
  reference pContainer; //    ,  . 
                        //   0.    . 
  long      objType;    //  .   , 
                        //    ( ksObject2DNotify).
  int       ifType;     //    ksNotifyType
  LPUNKNOWN iContainer; //    ,  . 
  LPUNKNOWN iObj;       //  .   ( ksObject3DNotify).
                        //   ,  objType  .
};


#pragma pack(pop)
#endif

