1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 16:57:16 +01:00
SqMod/source/Base/Circle.hpp

124 lines
6.1 KiB
C++
Raw Normal View History

2015-09-30 02:56:11 +02:00
#ifndef _BASE_CIRCLE_HPP_
#define _BASE_CIRCLE_HPP_
// ------------------------------------------------------------------------------------------------
#include "Config.hpp"
#include "Base/Vector2f.hpp"
// ------------------------------------------------------------------------------------------------
namespace SqMod {
/* ------------------------------------------------------------------------------------------------
* ...
*/
struct Circle
{
// --------------------------------------------------------------------------------------------
typedef SQFloat Value;
// --------------------------------------------------------------------------------------------
static const Circle NIL;
static const Circle MIN;
static const Circle MAX;
// --------------------------------------------------------------------------------------------
static SQChar Delim;
// --------------------------------------------------------------------------------------------
Vector2f pos;
Value rad;
// --------------------------------------------------------------------------------------------
Circle();
Circle(Value r);
Circle(const Vector2f & p);
Circle(const Vector2f & p, Value r);
Circle(Value x, Value y, Value r);
2015-09-30 02:56:11 +02:00
// --------------------------------------------------------------------------------------------
Circle(const Circle & c);
Circle(Circle && c);
2015-09-30 02:56:11 +02:00
// --------------------------------------------------------------------------------------------
~Circle();
// --------------------------------------------------------------------------------------------
Circle & operator = (const Circle & c);
Circle & operator = (Circle && c);
2015-09-30 02:56:11 +02:00
// --------------------------------------------------------------------------------------------
Circle & operator = (Value r);
Circle & operator = (const Vector2f & p);
2015-09-30 02:56:11 +02:00
// --------------------------------------------------------------------------------------------
Circle & operator += (const Circle & c);
Circle & operator -= (const Circle & c);
Circle & operator *= (const Circle & c);
Circle & operator /= (const Circle & c);
Circle & operator %= (const Circle & c);
2015-09-30 02:56:11 +02:00
// --------------------------------------------------------------------------------------------
Circle & operator += (Value r);
Circle & operator -= (Value r);
Circle & operator *= (Value r);
Circle & operator /= (Value r);
Circle & operator %= (Value r);
2015-09-30 02:56:11 +02:00
// --------------------------------------------------------------------------------------------
Circle & operator += (const Vector2f & p);
Circle & operator -= (const Vector2f & p);
Circle & operator *= (const Vector2f & p);
Circle & operator /= (const Vector2f & p);
Circle & operator %= (const Vector2f & p);
2015-09-30 02:56:11 +02:00
// --------------------------------------------------------------------------------------------
Circle & operator ++ ();
Circle & operator -- ();
2015-09-30 02:56:11 +02:00
// --------------------------------------------------------------------------------------------
Circle operator ++ (int);
Circle operator -- (int);
2015-09-30 02:56:11 +02:00
// --------------------------------------------------------------------------------------------
Circle operator + (const Circle & c) const;
Circle operator - (const Circle & c) const;
Circle operator * (const Circle & c) const;
Circle operator / (const Circle & c) const;
Circle operator % (const Circle & c) const;
2015-09-30 02:56:11 +02:00
// --------------------------------------------------------------------------------------------
Circle operator + (Value r) const;
Circle operator - (Value r) const;
Circle operator * (Value r) const;
Circle operator / (Value r) const;
Circle operator % (Value r) const;
2015-09-30 02:56:11 +02:00
// --------------------------------------------------------------------------------------------
Circle operator + (const Vector2f & p) const;
Circle operator - (const Vector2f & p) const;
Circle operator * (const Vector2f & p) const;
Circle operator / (const Vector2f & p) const;
Circle operator % (const Vector2f & p) const;
2015-09-30 02:56:11 +02:00
// --------------------------------------------------------------------------------------------
Circle operator + () const;
Circle operator - () const;
2015-09-30 02:56:11 +02:00
// --------------------------------------------------------------------------------------------
bool operator == (const Circle & c) const;
bool operator != (const Circle & c) const;
bool operator < (const Circle & c) const;
bool operator > (const Circle & c) const;
bool operator <= (const Circle & c) const;
bool operator >= (const Circle & c) const;
2015-09-30 02:56:11 +02:00
// --------------------------------------------------------------------------------------------
SQInteger Cmp(const Circle & c) const;
2015-09-30 02:56:11 +02:00
// --------------------------------------------------------------------------------------------
const SQChar * ToString() const;
2015-09-30 02:56:11 +02:00
// --------------------------------------------------------------------------------------------
void Set(Value nr);
void Set(const Circle & nc);
void Set(const Vector2f & np);
void Set(const Vector2f & np, Value nr);
2015-09-30 02:56:11 +02:00
// --------------------------------------------------------------------------------------------
void Set(Value nx, Value ny);
void Set(Value nx, Value ny, Value nr);
2015-09-30 02:56:11 +02:00
// --------------------------------------------------------------------------------------------
void Set(const SQChar * values, SQChar delim);
2015-09-30 02:56:11 +02:00
// --------------------------------------------------------------------------------------------
void Generate();
void Generate(Value min, Value max, bool r);
void Generate(Value xmin, Value xmax, Value ymin, Value ymax);
void Generate(Value xmin, Value xmax, Value ymin, Value ymax, Value rmin, Value rmax);
2015-09-30 02:56:11 +02:00
// --------------------------------------------------------------------------------------------
void Clear() { pos.Clear(); rad = 0.0; }
2015-09-30 02:56:11 +02:00
// --------------------------------------------------------------------------------------------
Circle Abs() const;
2015-09-30 02:56:11 +02:00
};
} // Namespace:: SqMod
#endif // _BASE_CIRCLE_HPP_