16#ifndef QGSMESHFORCEBYPOLYLINES_H
17#define QGSMESHFORCEBYPOLYLINES_H
67 bool mNewVertexOnIntersection =
false;
68 double mTolerance = 1e-8;
69 double mDefaultZValue = 0;
70 bool mInterpolateZValueOnMesh =
false;
74 virtual void finish();
78 QList<int> mRemovedFaces;
79 QList<int> mHoleOnLeft;
80 QList<int> mNeighborOnLeft;
81 QList<int> mHoleOnRight;
82 QList<int> mNeighborOnRight;
83 QList<int> mNewVerticesIndexesOnLine;
84 bool mEndOnPoint2 =
false;
85 int mPoint2VertexIndex = -1;
86 int mCurrentSnappedVertex = -1;
89 bool mFirstPointChecked =
false;
90 bool mSecondPointChecked =
false;
92 void interpolateZValueOnMesh(
QgsPoint &point )
const;
93 void interpolateZValueOnMesh(
int faceIndex,
QgsPoint &point )
const;
97 bool buildForcedElements();
99 bool edgeIntersection(
int vertex1,
101 int &closestSnappedVertex,
105 bool searchIntersectionEdgeFromSnappedVertex(
106 int &intersectionFaceIndex,
107 int &previousSnappedVertex,
108 int ¤tSnappedVertexIndex,
111 QSet<int> &treatedFaces );
116 bool triangulateHoles(
const QList<int> &holeOnLeft,
117 const QList<int> &neighborOnLeft,
119 QList<std::array<int, 2> > &newFacesOnLine,
120 std::array<int, 2> &extremeFaces );
122 bool finishForcingLine();
149 QString
text()
const override;
169 QList<QgsPointSequence> mPolylines;
170 int mCurrentPolyline = 0;
171 int mCurrentSegment = 0;
173 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