/***************************************************************************
 *                          Zanoza Modeler v2.x                            *
 *      This is unpublished propietary source code of Zanoza Software.     *
 *      The copyright notice does not evidence any actual or intended      *
 *                    publication of such source code.                     *
 *                                                                         *
 *                   Copyright (c) 2003 Zanoza Software.                   *
 *                                                                         *
 *                        All rights reserved.                             *
 ***************************************************************************
 *--------------------------------------------------------------------------
 * @author:   Oleg M.
 *--------------------------------------------------------------------------
 * @purpose:  ZModeler's native angular data
 *--------------------------------------------------------------------------
 * @histroy: 08.03.2003. Created
 */
#ifndef zangle_h_included
#define zangle_h_included

#ifndef zsequence_h_included
# include "zsequence.h"
#endif

//------------------------------------------------------
//  ZAngle - ZModeler's native angular data
//------------------------------------------------------
class DLL_LINKAGE ZAngle
{
public:
  //
  // constructors/destructors
  //
  ZAngle();
  ZAngle(const ZAngle& a);
  ZAngle(const float rad);
  ZAngle(const long  deg);
  ~ZAngle();

public:
  //
  // access grants
  //
  operator const float() const;   //radians
  operator const long() const;    //degreese

public:
  //
  // assignment operators
  //
  ZAngle& operator =  ( const ZAngle a);
  ZAngle& operator += ( const ZAngle a);
  ZAngle& operator -= ( const ZAngle a);
  ZAngle& operator *= ( const ZAngle a);
  ZAngle& operator /= ( const ZAngle a);

public:
  //
  // unary operators
  //
  ZAngle  operator + () const;
  ZAngle  operator - () const;

public:
  //
  // binary operators
  //
  ZAngle operator + ( const ZAngle& ) const;
  ZAngle operator - ( const ZAngle& ) const;
  ZAngle operator * ( float ) const;
  ZAngle operator / ( float ) const;

public:
  //
  // compare operators
  //
  bool operator == ( const ZAngle& a) const;
  bool operator != ( const ZAngle& a) const;
  bool operator < ( const ZAngle& a) const;
  bool operator <= ( const ZAngle& a) const;

public:
  //
  // operations
  //
  void    rad(const float value);
  float   rad() const;
  void    deg(const long value);
  long    deg() const;
  //value in [-180, +180) range
  float   rad180() const;
  long    deg180() const;
  //value in [0, 360) range
  float   rad360() const;
  long    deg360() const;
  bool    equal( const ZAngle a, float epsilon = 1E-6f) const; // compares as [0, 360]
  bool    less( const ZAngle a, float epsilon = 1E-6f) const;  // compares as [0, 360]

private:
  //
  // data members
  //
  float m_rad;
};

typedef ZSequence<ZAngle>  ZAngleSeq;


#endif //zangle_h_included

