1 #ifndef MERKAARTOR_FEATUREMANIPULATIONS_H_ 2 #define MERKAARTOR_FEATUREMANIPULATIONS_H_ 3 4 class CommandList; 5 class Document; 6 class Layer; 7 class PropertiesDock; 8 class Way; 9 class Projection; 10 11 #include <QList> 12 #include "Coord.h" 13 #include "Node.h" 14 15 void joinRoads(Document* theDocument, CommandList* theList, PropertiesDock* theDock); 16 void splitRoads(Document* theDocument, CommandList* theList, PropertiesDock* theDock); 17 Way *cutoutRoad(Document* theDocument, CommandList* theList, PropertiesDock* thedock, Node *N1, Node *N2); 18 void breakRoads(Document* theDocument, CommandList* theList, PropertiesDock* theDock); 19 bool canCreateJunction(PropertiesDock* theDock); 20 int createJunction(Document* theDocument, CommandList* theList, PropertiesDock* theDock, bool doIt=true); 21 void addStreetNumbers(Document* theDocument, CommandList* theList, PropertiesDock* theDock); 22 void reversePoints(Document* theDocument, CommandList* theList, Way* R); 23 void simplifyRoads(Document* theDocument, CommandList* theList, PropertiesDock* theDock, qreal threshold); 24 void alignNodes(Document* theDocument, CommandList* theList, PropertiesDock* theDock); 25 void bingExtract(Document* theDocument, CommandList* theList, PropertiesDock* theDock, CoordBox vp); 26 void spreadNodes(Document* theDocument, CommandList* theList, PropertiesDock* theDock); 27 void mergeNodes(Document* theDocument, CommandList* theList, PropertiesDock* theDock); 28 void detachNode(Document* theDocument, CommandList* theList, PropertiesDock* theDock); 29 void commitFeatures(Document* theDocument, CommandList* theList, PropertiesDock* theDock); 30 bool canJoinRoads(PropertiesDock* theDock); 31 bool canBreakRoads(PropertiesDock* theDock); 32 bool canDetachNodes(PropertiesDock* theDock); 33 void addRelationMember(Document* theDocument, CommandList* theList, PropertiesDock* theDock); 34 void removeRelationMember(Document* theDocument, CommandList* theList, PropertiesDock* theDock); 35 void addToMultipolygon(Document* theDocument, CommandList* theList, PropertiesDock* theDock); 36 bool canSubdivideRoad(PropertiesDock* theDock, Way** theRoad = 0, unsigned int* edge = 0); 37 void subdivideRoad(Document* theDocument, CommandList* theList, PropertiesDock* theDock, unsigned int divisions); 38 void joinAreas(Document* theDocument, CommandList* theList, PropertiesDock* theDock); 39 bool canSplitArea(PropertiesDock* theDock, Way** outTheArea = 0, unsigned int outNodes[2] = 0); 40 void splitArea(Document* theDocument, CommandList* theList, PropertiesDock* theDock); 41 bool canTerraceArea(PropertiesDock* theDock, Way** outTheArea = 0, int* startNode = 0); 42 void terraceArea(Document* theDocument, CommandList* theList, PropertiesDock* theDock, unsigned int divisions); 43 44 enum AxisAlignResult { 45 AxisAlignSuccess, 46 // failures: 47 AxisAlignSharpAngles, 48 AxisAlignFail // no convergence 49 }; 50 bool canAxisAlignRoads(PropertiesDock* theDock); 51 unsigned int axisAlignGuessAxes(PropertiesDock* theDock, const Projection &proj, unsigned int max_axes); 52 AxisAlignResult axisAlignRoads(Document* theDocument, CommandList* theList, PropertiesDock* theDock, const Projection &proj, unsigned int axes); 53 54 55 #endif 56 57