-
Notifications
You must be signed in to change notification settings - Fork 141
Expand file tree
/
Copy pathClipperConverter.h
More file actions
27 lines (23 loc) · 1.15 KB
/
ClipperConverter.h
File metadata and controls
27 lines (23 loc) · 1.15 KB
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
#pragma once
#include "clipper.h"
class ClipperConverter
{
public:
// coordinates for clipper are multiplied in case of geographic coordinate systems
double conversionFactor;
ClipperConverter() : conversionFactor(1.0){ }
ClipperConverter(IShapefile* sf) {
this->SetConversionFactor(sf);
}
void SetConversionFactor(IShapefile* sf);
// Old Clipper lib:
// ClipperLib::Polygons* Shape2ClipperPolygon(IShape* shp);
// IShape* ClipperPolygon2Shape(ClipperLib::Polygons* polygon);
// static ClipperLib::Polygons* ClipPolygon(ClipperLib::Polygons* polyClip, ClipperLib::Polygons* polySubject, ClipperLib::ClipType operation);
// Clipper lib v6+ uses paths instead of polygons:
ClipperLib::Paths * Shape2ClipperPolygon(IShape* shp);
IShape* ClipperPolygon2Shape(ClipperLib::Paths* polygon);
static ClipperLib::Paths* ClipPolygon(ClipperLib::Paths* polyClip, ClipperLib::Paths* polySubject, ClipperLib::ClipType operation);
static IShape* ClipPolygon(IShape* shapeClip, IShape* shapeSubject, PolygonOperation operation);
static void AddPolygons(IShapefile* sf, ClipperLib::Clipper& clp, ClipperLib::PolyType clipType, bool selectedOnly);
};