mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Coons patch meshing
This commit is contained in:
@ -77,7 +77,7 @@ struct PDFMeshQualitySettings
|
||||
PDFReal tolerance = 0.01;
|
||||
|
||||
/// Test points to determine maximal curvature of the tensor product patch meshes
|
||||
PDFInteger patchTestPoints = 256;
|
||||
PDFInteger patchTestPoints = 64;
|
||||
|
||||
/// Lower value of the surface curvature meshing resolution mapping. When ratio between
|
||||
/// current curvature at the center of meshed triangle and maximal curvature is below
|
||||
@ -149,6 +149,12 @@ public:
|
||||
/// \param triangles New triangle array
|
||||
void setTriangles(std::vector<Triangle>&& triangles) { m_triangles = qMove(triangles); }
|
||||
|
||||
/// Merges the vertices/triangles (renumbers triangle indices) to this mesh.
|
||||
/// Algorithm assumes that vertices/triangles are numbered from zero.
|
||||
/// \param vertices Added vertex array
|
||||
/// \param triangles Added triangle array
|
||||
void addMesh(std::vector<QPointF>&& vertices, std::vector<Triangle>&& triangles);
|
||||
|
||||
/// Returns vertex at given index
|
||||
/// \param index Index of the vertex
|
||||
const QPointF& getVertex(size_t index) const { return m_vertices[index]; }
|
||||
@ -167,6 +173,9 @@ public:
|
||||
/// \param backgroundColor Background color
|
||||
void setBackgroundColor(QColor backgroundColor) { m_backgroundColor = backgroundColor; }
|
||||
|
||||
/// Returns true, if mesh is empty
|
||||
bool isEmpty() const { return m_vertices.empty(); }
|
||||
|
||||
private:
|
||||
std::vector<QPointF> m_vertices;
|
||||
std::vector<Triangle> m_triangles;
|
||||
@ -518,6 +527,18 @@ private:
|
||||
friend class PDFPattern;
|
||||
};
|
||||
|
||||
class PDFCoonsPatchShading : public PDFTensorProductPatchShadingBase
|
||||
{
|
||||
public:
|
||||
explicit PDFCoonsPatchShading() = default;
|
||||
|
||||
virtual ShadingType getShadingType() const override;
|
||||
virtual PDFMesh createMesh(const PDFMeshQualitySettings& settings) const override;
|
||||
|
||||
private:
|
||||
friend class PDFPattern;
|
||||
};
|
||||
|
||||
class PDFTensorProductPatchShading : public PDFTensorProductPatchShadingBase
|
||||
{
|
||||
public:
|
||||
|
Reference in New Issue
Block a user