Function_def.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* Function_def.h
  2. *
  3. * Copyright (C) 1992-2011,2015,2017 Paul Boersma
  4. *
  5. * This code is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * This code is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. * See the GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this work. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #define ooSTRUCT Function
  19. oo_DEFINE_CLASS (Function, Daata)
  20. oo_DOUBLE (xmin)
  21. oo_DOUBLE (xmax)
  22. #if oo_READING
  23. if (xmin > xmax)
  24. Melder_throw (U"Wrong xmin ", xmin, U" and xmax ", xmax, U".");
  25. #endif
  26. #if oo_DECLARING
  27. void v_info ()
  28. override;
  29. bool v_hasGetXmin ()
  30. override { return true; }
  31. double v_getXmin ()
  32. override { return xmin; }
  33. bool v_hasGetXmax ()
  34. override { return true; }
  35. double v_getXmax ()
  36. override { return xmax; }
  37. virtual int v_domainQuantity () { return 0; }
  38. virtual int v_getMinimumUnit (integer /* level */) { return 0; }
  39. virtual int v_getMaximumUnit (integer /* level */) { return 0; }
  40. virtual conststring32 v_getUnitText (integer /* level */, int /* unit */, uint32 /* flags */)
  41. { return U""; }
  42. virtual bool v_isUnitLogarithmic (integer /* level */, int /* unit */)
  43. { return false; }
  44. virtual double v_convertStandardToSpecialUnit (double value, integer /* level */, int /* unit */)
  45. { return value; }
  46. virtual double v_convertSpecialToStandardUnit (double value, integer /* level */, int /* unit */)
  47. { return value; }
  48. virtual void v_shiftX (double xfrom, double xto);
  49. virtual void v_scaleX (double xminfrom, double xmaxfrom, double xminto, double xmaxto);
  50. #endif
  51. oo_END_CLASS (Function)
  52. #undef ooSTRUCT
  53. /* End of file Function_def.h */