Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef FR_CIRCLE_H
#define FR_CIRCLE_H
#include "FRVector2.h"
#include "FRArray.h"
#define NDIV_DEFAULT 8
class FRCircleTable {
friend class FRSegmentTable;
public:
FRCircleTable(unsigned div_ = NDIV_DEFAULT) { setDiv(div_); }
void setDiv(unsigned);
unsigned getDiv() const { return div; }
const FRVector2* getTable() const { return table; }
private:
FRArray<FRVector2> table;
unsigned div;
};
#undef NDIV_DEFAULT
class FRSegmentTable /* bug : start = sweep = 0 -> core dump!! */
{
public:
FRSegmentTable(
const FRCircleTable&,
double = 0,
double = M_PI * 2);
const FRVector2* getTable() const { return table; }
unsigned getSize() const { return num; }
protected:
FRArray<FRVector2> buf;
const FRVector2 *table;
unsigned num;
};
#endif