home *** CD-ROM | disk | FTP | other *** search
/ AI Game Programming Wisdom / AIGameProgrammingWisdom.iso / SourceCode / 02 Useful Techniques / 08 Zarozinski / src / ffllapi / MemberFuncTrap.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-10-16  |  1.7 KB  |  63 lines

  1. //
  2. // File:    MemberFuncTrap.h
  3. //
  4. // Purpose:    This class is for the trapezoid shaped member function
  5. //
  6. // Copyright ⌐ 1999-2001 Louder Than A Bomb! Software
  7. //
  8. // This file is part of the FFLL (Free Fuzzy Logic Library) project (http://ffll.sourceforge.net)
  9. // It is released under the BSD license, see http://ffll.sourceforge.net/license.txt for the full text.
  10. //
  11.  
  12. #if !defined(AFX_MemberFuncTrap_H__DE3C07E3_650E_11D3_B77F_906F59C10001__INCLUDED_)
  13. #define AFX_MemberFuncTrap_H__DE3C07E3_650E_11D3_B77F_906F59C10001__INCLUDED_
  14.  
  15. #include "MemberFuncBase.h"
  16.  
  17. // 
  18. // Class:    MemberFuncTrap
  19. //
  20. // This is the trapezoid shaped membership function. It consists of 4 points.
  21. // 
  22.  
  23. class FFLL_API  MemberFuncTrap :  virtual public MemberFuncBase  
  24. {
  25.      ////////////////////////////////////////
  26.     ////////// Member Functions ////////////
  27.     ////////////////////////////////////////
  28.  
  29.     public:
  30.  
  31.         // constructor/destructor funcs
  32.         MemberFuncTrap(); // No function body for this. Explicitly disallow auto-creation of it by the compiler
  33.         MemberFuncTrap(FuzzySetBase* _parent);
  34.          virtual ~MemberFuncTrap();
  35.  
  36.         // get functions
  37.           virtual int get_center_x(void) const;
  38.          int get_func_type()  const;
  39.          int get_node_count() const;
  40.  
  41.         // set functions
  42.          void set_node(int idx, int x, int y, bool validate = true);
  43.          void set_ramp(int hi_lo_ind, int left_right_ind);
  44.  
  45.         // misc functions
  46.         void calc();
  47.          virtual void expand(int x_delta );
  48.          virtual void shrink(int x_delta );
  49.  
  50.  
  51.     protected:
  52.  
  53.         // misc functions
  54.         void init_nodes(int start_x, int term_width);
  55.  
  56. }; // end class MemberFuncTrap
  57.  
  58. #else
  59.  
  60. class MemberFuncTrap; // already defined
  61.  
  62. #endif // !defined(AFX_MemberFuncTrap_H__DE3C07E3_650E_11D3_B77F_906F59C10001__INCLUDED_)
  63.