-
Notifications
You must be signed in to change notification settings - Fork 142
Expand file tree
/
Copy pathEditorBase.h
More file actions
63 lines (60 loc) · 2.3 KB
/
Copy pathEditorBase.h
File metadata and controls
63 lines (60 loc) · 2.3 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#pragma once
#include "ActiveShape.h"
class EditorBase: public ActiveShape
{
private:
ShpfileType _shpType;
bool _creationMode;
public:
EditorBase(void) {
_shpType = SHP_NULLSHAPE;
_creationMode = false;
};
virtual ~EditorBase(void) {};
public:
ShpfileType GetShapeType2D() { return ShapeUtility::Convert2D(_shpType); }
ShpfileType GetShapeType() { return _shpType; }
bool DrawAccumalatedLength() { return false; }
bool CloseOnPreviousVertex() { return false; }
void UpdatePolyCloseState(bool close, int pointIndex = -1) {}
void SetShapeType(ShpfileType mode) { _shpType = mode; }
void SetCreationMode(bool mode) { _creationMode = mode; }
bool GetCreationMode() { return _creationMode; }
bool ShapeCreated() { return _shpType != SHP_NULLSHAPE; };
bool HasSelectedVertex() { return _selectedVertex != -1; }
bool HasSelectedPart() { return _selectedPart != -1; }
void ClearIfStopped() { }
bool IsDynamic() {return _creationMode; }
bool SnapToPreviousVertex(int& vertexIndex, double screenX, double screenY);
bool HasPolygon(bool dynamicBuffer);
bool HasPolygon();
bool HasLine(bool dynamicBuffer);
void Clear();
bool SetHighlightedPart(int part);
bool SetSelectedPart(int index);
bool SetHighlightedVertex(int index);
bool SetSelectedVertex(int index);
bool ClearHighlightedPart();
bool ClearHighlightedVertex();
void SetSnapPoint(double x, double y);
void ClearSnapPoint();
int SelectPart(double xProj, double yProj);
int GetClosestVertex(double projX, double projY, double tolerance);
bool HasClosedPolygon();
bool RemovePart();
bool RemoveSelectedVertex() {return RemoveVertex(_selectedVertex);}
bool RemoveVertex(int vertexIndex);
void Move(double offsetXProj, double offsetYProj);
void MovePart(double offsetXProj, double offsetYProj);
void MoveVertex(double xProj, double yProj);
bool TryInsertVertex(double xProj, double yProj);
bool UpdatePoint(int pointIndex, double projX, double ProjY);
tkDeleteTarget GetDeleteTarget();
bool CanDeleteVertex(int vertexIndex);
bool PartIsWithin(int outerRing, int innerRing);
bool GetPart(int partIndex, int& startIndex, int& endIndex);
IShape* GetPartAsShape(int partIndex);
void SelectRelatedParts(int outerRing);
bool CanDeletePart(int partIndex);
bool GetShowArea() { return ShowArea; }
};