Hot Door CORE  0.7.1
Adobe® Illustrator® Plug-in Library
hdicoreAngle.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_ANGLE__
8 #define __HDI_CORE_ANGLE__
9 
10 #include "hdicoreConstants.h"
11 #include "hdicoreTypes.h"
12 
13 namespace hdi
14 {
15  namespace geo
16  {
17  class Angle;
18  }
19 
20  namespace core
21  {
25  class Angle
26  {
27  public:
31  enum Units
32  {
33  Radians = 1,
34  Degrees = 2,
35  Gradians = 3,
36  Turns = 4
37  };
38 
44  Angle();
45 
54  Angle(const double value_, const Units units_ = Radians);
55 
63  Angle(const Angle& angle_);
64 
70  virtual ~Angle();
71 
81  virtual bool equalWithinTol(const Angle& compare_, const Angle& tol_) const;
82 
91  virtual bool operator==(const Angle& rhs_) const;
92 
101  virtual bool operator!=(const Angle& rhs_) const;
102 
112  virtual bool operator<(const Angle& rhs_) const;
113 
123  virtual bool operator<=(const Angle& rhs_) const;
124 
134  virtual bool operator>(const Angle& rhs_) const;
135 
145  virtual bool operator>=(const Angle& rhs_) const;
146 
154  virtual Angle operator-() const;
155 
164  virtual Angle operator+(const Angle& rhs_) const;
165 
174  virtual Angle operator-(const Angle& rhs_) const;
175 
184  virtual Angle operator*(const Angle& rhs_) const;
185 
194  virtual Angle operator/(const Angle& rhs_) const;
195 
204  virtual Angle& operator=(const Angle& rhs_);
205 
215  virtual Angle& operator+=(const Angle& rhs_);
216 
226  virtual Angle& operator-=(const Angle& rhs_);
227 
237  virtual Angle& operator*=(const Angle& rhs_);
238 
248  virtual Angle& operator/=(const Angle& rhs_);
249 
258  virtual Angle operator*(const double rhs_) const;
259 
268  virtual Angle operator/(const double rhs_) const;
269 
278  virtual Angle& operator*=(const double rhs_);
279 
288  virtual Angle& operator/=(const double rhs_);
289 
297  virtual double asRadians() const;
298 
306  virtual double asDegrees() const;
307 
315  virtual double asGradians() const;
316 
324  virtual double asTurns() const;
325 
334  virtual double valueInUnits(const Units units_ = Radians) const;
335 
344  virtual void setValueInUnits(const double value_, const Units units_ = Radians);
345 
353  virtual Angle range0To2Pi() const;
354 
362  virtual Angle rangeNegPiToPi() const;
363 
371  virtual Angle nearest45() const;
372 
383  virtual Angle constrain0ToPi() const;
384 
395  virtual Angle constrainPiOver2To3PiOver2() const;
396 
407  virtual Angle constrainPiTo2Pi() const;
408 
419  virtual Angle constrainNegPiOver2ToPiOver2() const;
420 
429  virtual Angle bisect(const Angle& angle2_) const;
430 
442  virtual Angle delta(const Angle& angle2_) const;
443 
451  virtual bool firstQuadrant() const;
452 
460  virtual bool secondQuadrant() const;
461 
469  virtual bool thirdQuadrant() const;
470 
478  virtual bool fourthQuadrant() const;
479 
487  virtual int16_t quadrantNumber() const;
488 
502  virtual double sin(const double tol_ = 10000.0 * maxDoublePrecision) const;
503 
517  virtual double cos(const double tol_ = 10000.0 * maxDoublePrecision) const;
518 
532  virtual double tan(const double tol_ = 10000.0 * maxDoublePrecision) const;
533 
548  static Angle asin(const double val_, const double tol_ = 10000.0 * maxDoublePrecision);
549 
564  static Angle acos(const double val_, const double tol_ = 10000.0 * maxDoublePrecision);
565 
580  static Angle atan(const double val_, const double tol_ = 10000.0 * maxDoublePrecision);
581 
589  static Angle Zero();
590 
598  static Angle Pi();
599 
607  static Angle TwoPi();
608 
609 
610  private:
611  friend geo::Angle* __accessImpl(const Angle&);
612  friend Angle __accessCtor(const geo::Angle&);
613 
617  geo::Angle* __impl;
618 
624  Angle(const geo::Angle&);
625  };
626 
627  typedef std::auto_ptr<Angle> AngleAP;
628 
629  extern geo::Angle* __accessImpl(const Angle&);
630  extern Angle __accessCtor(const geo::Angle&);
631  }
632 }
633 
643 hdi::core::Angle operator*(const double lhs_, const hdi::core::Angle& rhs_);
644 
645 #endif
646 // __HDI_CORE_ANGLE__
Units
Units supported for angle calculations.
Definition: hdicoreAngle.h:31
hdi::core::Date operator+(const hdi::core::Duration &lhs_, const hdi::core::Date &rhs_)
Adds a duration to a date.
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
const double maxDoublePrecision
Maximum double type precision.
Definition: hdicoreConstants.h:31
Definition: hdicoreaiArray.h:12
Header file for defining various Illustrator plugin constants.
hdi::core::Angle operator*(const double lhs_, const hdi::core::Angle &rhs_)
Allows a constant to be multipled by an Angle object.
Describes an angle, and allows for easy conversion between various units.
Definition: hdicoreAngle.h:25