16#ifndef QGSMESHFORCEBYPOLYLINES_H
17#define QGSMESHFORCEBYPOLYLINES_H
66 bool mNewVertexOnIntersection =
false;
67 double mTolerance = 1e-8;
68 double mDefaultZValue = 0;
69 bool mInterpolateZValueOnMesh =
false;
73 virtual void finish();
77 QList<int> mRemovedFaces;
78 QList<int> mHoleOnLeft;
79 QList<int> mNeighborOnLeft;
80 QList<int> mHoleOnRight;
81 QList<int> mNeighborOnRight;
82 QList<int> mNewVerticesIndexesOnLine;
83 bool mEndOnPoint2 =
false;
84 int mPoint2VertexIndex = -1;
85 int mCurrentSnappedVertex = -1;
88 bool mFirstPointChecked =
false;
89 bool mSecondPointChecked =
false;
91 void interpolateZValueOnMesh(
QgsPoint &point )
const;
92 void interpolateZValueOnMesh(
int faceIndex,
QgsPoint &point )
const;
96 bool buildForcedElements();
98 bool edgeIntersection(
int vertex1,
int vertex2,
int &closestSnappedVertex,
QgsPoint &intersectionPoint,
bool outAllowed );
100 bool searchIntersectionEdgeFromSnappedVertex(
101 int &intersectionFaceIndex,
int &previousSnappedVertex,
int ¤tSnappedVertexIndex,
QgsPoint &intersectionPoint,
int &edgePosition, QSet<int> &treatedFaces
107 bool triangulateHoles(
const QList<int> &holeOnLeft,
const QList<int> &neighborOnLeft,
bool isLeftHole, QList<std::array<int, 2> > &newFacesOnLine, std::array<int, 2> &extremeFaces );
109 bool finishForcingLine();
134 QString
text()
const override;
154 QList<QgsPointSequence> mPolylines;
155 int mCurrentPolyline = 0;
156 int mCurrentSegment = 0;
158 void incrementSegment();
A geometry is the spatial representation of a feature.
friend class QgsMeshEditor
virtual QgsTopologicalMesh::Changes apply(QgsMeshEditor *meshEditor)=0
Apply a change to mesh Editor.
virtual bool isFinished() const
Returns whether the advanced edit is finished, if not, this edit has to be applied again with QgsMesh...
virtual QString text() const
Returns a short text string describing what this advanced edit does. Default implementation return a ...
QgsMeshEditForceByLine()=default
void setAddVertexOnIntersection(bool addVertex)
Sets whether vertices will be added when the lines will intersect internal edges of faces,...
void setInputLine(const QgsPoint &pt1, const QgsPoint &pt2, double tolerance, bool newVertexOnIntersection)
Sets the input forcing line in rendering coordinates.
void setDefaultZValue(double defaultZValue)
Sets the default value of Z coordinate to use for new vertices, this value will be used if the Z valu...
void setTolerance(double tolerance)
Sets the tolerance in redering coordinate system unit.
friend class QgsMeshEditForceByPolylines
void setInterpolateZValueOnMesh(bool interpolateZValueOnMesh)
Sets whether the new created vertices will have their value interpolated from the existing mesh.
friend class TestQgsMeshEditor
void addLinesFromGeometries(const QList< QgsGeometry > geometries)
Adds a list of input forcing lines geometry in rendering coordinates.
void addLineFromGeometry(const QgsGeometry &geom)
Adds a input forcing line geometry in rendering coordinates.
QgsMeshEditForceByPolylines()=default
Point geometry type, with support for z-dimension and m-values.
Contains topological differences between two states of a topological mesh, only accessible from the Q...
QgsPoint QgsMeshVertex
xyz coords of vertex