root/lang/ruby/RubyESRIShape/Shape_int.h @ 2015

Revision 2015, 1.1 kB (checked in by gyuque, 5 years ago)

/lang/ruby/RubyESRIShape: getter of polygon parts

Line 
1// types and functions for internal use
2#ifndef SHAPE_INT_H
3#define SHAPE_INT_H
4#include "ruby_min.h"
5
6#include <vector>
7typedef std::vector<VALUE> RValueList;
8
9typedef struct _ShpReadContext {
10        size_t readSize;
11        size_t readRecordContentSize;
12} ShpReadContext;
13
14/*interface*/
15class ShpRecordObject
16{
17public:
18        virtual ~ShpRecordObject(){};
19        virtual VALUE toRubyObject() = 0;
20};
21
22#define SHPPOLYGON_Z 0x1
23#define SHPPOLYGON_M 0x2
24
25class ShpPolygon : public ShpRecordObject
26{
27public:
28        ShpPolygon(int option);
29        virtual ~ShpPolygon();
30        virtual VALUE toRubyObject();
31        VALUE getPartAt(int index);
32        int getPartsLength();
33
34        void markRubyGC();
35
36        es_error_t readFromMainFile(FILE* fp, ShpReadContext& rctx);
37private:
38        void allocBuffers();
39        void freeBuffers();
40
41        ESInt32 mType;
42        ESDouble mBounds[4];
43        ESInt32 mNParts;
44        ESInt32 mNPoints;
45
46        ESInt32* mPartIndexes;
47        ESPointEx* mPoints;
48
49        ESDouble mZRange[2];
50        ESDouble mMRange[2];
51
52        int mOption;
53};
54
55class ShpPoint : public ShpRecordObject
56{
57public:
58        ShpPoint();
59        virtual ~ShpPoint();
60        virtual VALUE toRubyObject();
61};
62
63#endif
Note: See TracBrowser for help on using the browser.