////////////////////////////////////////////////////////////////////////////////
//
// gayka.h -    Borland C -  
//
////////////////////////////////////////////////////////////////////////////////
#ifndef __GAYKA_H
#define __GAYKA_H

#ifndef __BASE_H
#include "base.h"
#endif

//-------------------------------------------------------------------------------
//     
// ---
struct SimpleBase 
{
  reference bg;              //  
  reference rg1, rg2, rg3;   //   2 
  SimpleBase() : bg(0), rg1(0), rg2(0), rg3(0) {};
};


//-------------------------------------------------------------------------------
//  
// ---
struct GaykaTMP
{
  float dr;
  float p1;
  float p2;
  float s;
  float D;
  float da;
  float h;
  float d2;
  float m;
  float s1;
  float D1;
  float m1;
};


//-------------------------------------------------------------------------------
//  
// ---
struct GAYKA5915
{
  float          dr;
  float          s;
  float          D;
  float          da;
  float          h;
  float          d2;
  float          p;
  unsigned short f;           //   
  short          klass;       //  
  unsigned short gost;        //  
  float          hatchAng;
  float          hatchShag;
  byte           ver;         //  
  float          massa;
  byte           indexMassa;  // 0- 1-   2-
  unsigned short f1;          //   
};


////////////////////////////////////////////////////////////////////////////////
//
//  
//
////////////////////////////////////////////////////////////////////////////////
class Gayka5915 : public CPar
{
  public :
    GAYKA5915 tmp;
    SimpleBase base;

  public :
    Gayka5915( unsigned short gost_ );
    Gayka5915( const Gayka5915  & other );
    void  Assign( const Gayka5915  & other );

    virtual void        GetGroup( reference &gr ); //  
    virtual int         ChoiceMenuId();            //  
    virtual void        SetParam();                //  
    virtual void        SetHatchAngl();            //   
    virtual void        SetHatchShag();            //   
    virtual int         MacroElementParam();       //   
    virtual reference   EditSpcObj( reference *spcObj, reference geom ); //   

// HOT_POINTS ##################################################################
            //   Hot 
            BOOL        GetHotPoints( HotPointDescription* point,  int index );
            int         SetHotPoint ( HotPointDescription* point,  int index );
            BOOL        GetCursorText( int index, char** text );
            int         GetMenu();
            BOOL        ExecuteCommand( int id );                //  
            BOOL        EditComplete( int index, BOOL success ); //     ,    
            BOOL        ChangeHotPointParam( double d );
// HOT_POINTS ##################################################################

    virtual int         Size() { return CPar::Size() + sizeof(tmp); } //  
    virtual bool        IsSpcObjCreate() { return SPCOBJ_CREATE;}     //      

            //   
            void        gayka_sverhu();
            void        gayka_p_k( int j );
  public:
    static  reference   StaticEditSpcObj ( bool flagMode, GAYKA5915 &tmp, reference */*spcObj*/, reference/*geom*/, uint16 );
            int         ChoiceBMP();              //  
            void        CloseGaykaBase();         //   
            bool        OpenGaykaBase();          //   
            bool        ReadGaykaBase( float d ); //     
};


//-------------------------------------------------------------------------------
//  
// ---
//   
extern void gayka_k_side  ( float ls, float s, float D, float d2, float H, int j, int j2 );
//   
extern void gayka_k_y     ( float ls, GAYKA5915 *tmp, int j );
//   
extern void gayka_k       ( float ls, float l, float d1, float s, float D, float l1, float H, short j, int j1, float d2, int j2 );
#endif
