The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
3.1KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library - "Jules' Utility Class Extensions"
  4. Copyright 2004-11 by Raw Material Software Ltd.
  5. ------------------------------------------------------------------------------
  6. JUCE can be redistributed and/or modified under the terms of the GNU General
  7. Public License (Version 2), as published by the Free Software Foundation.
  8. A copy of the license is included in the JUCE distribution, or can be found
  9. online at www.gnu.org/licenses.
  10. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  11. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  13. ------------------------------------------------------------------------------
  14. To release a closed-source product which uses JUCE, commercial licenses are
  15. available: visit www.rawmaterialsoftware.com/juce for more information.
  16. ==============================================================================
  17. */
  18. #ifndef __JUCE_RELATIVEPARALLELOGRAM_JUCEHEADER__
  19. #define __JUCE_RELATIVEPARALLELOGRAM_JUCEHEADER__
  20. #include "juce_RelativePoint.h"
  21. //==============================================================================
  22. /**
  23. A parallelogram defined by three RelativePoint positions.
  24. @see RelativePoint, RelativeCoordinate
  25. */
  26. class JUCE_API RelativeParallelogram
  27. {
  28. public:
  29. //==============================================================================
  30. RelativeParallelogram();
  31. RelativeParallelogram (const Rectangle<float>& simpleRectangle);
  32. RelativeParallelogram (const RelativePoint& topLeft, const RelativePoint& topRight, const RelativePoint& bottomLeft);
  33. RelativeParallelogram (const String& topLeft, const String& topRight, const String& bottomLeft);
  34. ~RelativeParallelogram();
  35. //==============================================================================
  36. void resolveThreePoints (Point<float>* points, Expression::Scope* scope) const;
  37. void resolveFourCorners (Point<float>* points, Expression::Scope* scope) const;
  38. const Rectangle<float> getBounds (Expression::Scope* scope) const;
  39. void getPath (Path& path, Expression::Scope* scope) const;
  40. const AffineTransform resetToPerpendicular (Expression::Scope* scope);
  41. bool isDynamic() const;
  42. bool operator== (const RelativeParallelogram& other) const noexcept;
  43. bool operator!= (const RelativeParallelogram& other) const noexcept;
  44. static const Point<float> getInternalCoordForPoint (const Point<float>* parallelogramCorners, Point<float> point) noexcept;
  45. static const Point<float> getPointForInternalCoord (const Point<float>* parallelogramCorners, const Point<float>& internalPoint) noexcept;
  46. static const Rectangle<float> getBoundingBox (const Point<float>* parallelogramCorners) noexcept;
  47. //==============================================================================
  48. RelativePoint topLeft, topRight, bottomLeft;
  49. };
  50. #endif // __JUCE_RELATIVEPARALLELOGRAM_JUCEHEADER__