AnyTier.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef _AnyTier_h_
  2. #define _AnyTier_h_
  3. /* AnyTier.h
  4. *
  5. * Copyright (C) 1992-2011,2015,2017 Paul Boersma
  6. *
  7. * This code is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or (at
  10. * your option) any later version.
  11. *
  12. * This code is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. * See the GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this work. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #include "Collection.h"
  21. #include "PointProcess.h"
  22. Thing_define (AnyPoint, SimpleDouble) {
  23. };
  24. Thing_define (AnyTier, Function) {
  25. SortedSetOfDoubleOf <structAnyPoint> points;
  26. void v_shiftX (double xfrom, double xto)
  27. override;
  28. void v_scaleX (double xminfrom, double xmaxfrom, double xminto, double xmaxto)
  29. override;
  30. };
  31. integer AnyTier_timeToLowIndex (AnyTier me, double time);
  32. integer AnyTier_timeToHighIndex (AnyTier me, double time);
  33. integer AnyTier_getWindowPoints (AnyTier me, double tmin, double tmax, integer *imin, integer *imax);
  34. integer AnyTier_timeToNearestIndex (AnyTier me, double time);
  35. integer AnyTier_hasPoint (AnyTier me, double t);
  36. void AnyTier_addPoint_move (AnyTier me, autoAnyPoint point);
  37. void AnyTier_removePoint (AnyTier me, integer i);
  38. void AnyTier_removePointNear (AnyTier me, double time);
  39. void AnyTier_removePointsBetween (AnyTier me, double tmin, double tmax);
  40. autoPointProcess AnyTier_downto_PointProcess (AnyTier me);
  41. #define AnyTier_METHODS \
  42. AnyTier asAnyTier () { return reinterpret_cast <AnyTier> (this); } \
  43. void v_shiftX (double xfrom, double xto) \
  44. override { ((AnyTier) this) -> structAnyTier::v_shiftX (xfrom, xto); } \
  45. void v_scaleX (double xminfrom, double xmaxfrom, double xminto, double xmaxto) \
  46. override { ((AnyTier) this) -> structAnyTier::v_scaleX (xminfrom, xmaxfrom, xminto, xmaxto); };
  47. #endif
  48. /* End of file AnyTier.h */