Qt 4.8
Classes | Functions
qtriangulator_p.h File Reference
#include <QtCore/qvector.h>
#include <QtGui/private/qvectorpath_p.h>

Go to the source code of this file.

Classes

struct  QPolylineSet
 
struct  QTriangleSet
 
class  QVertexIndexVector
 

Functions

QPolylineSet qPolyline (const QVectorPath &path, const QTransform &matrix=QTransform(), qreal lod=1)
 
QPolylineSet qPolyline (const QPainterPath &path, const QTransform &matrix=QTransform(), qreal lod=1)
 
QTriangleSet qTriangulate (const qreal *polygon, int count, uint hint=QVectorPath::PolygonHint|QVectorPath::OddEvenFill, const QTransform &matrix=QTransform())
 
QTriangleSet qTriangulate (const QVectorPath &path, const QTransform &matrix=QTransform(), qreal lod=1)
 
QTriangleSet qTriangulate (const QPainterPath &path, const QTransform &matrix=QTransform(), qreal lod=1)
 

Function Documentation

◆ qPolyline() [1/2]

QPolylineSet qPolyline ( const QVectorPath path,
const QTransform matrix = QTransform(),
qreal  lod = 1 
)

Definition at line 3077 of file qtriangulator.cpp.

3079 {
3080  QPolylineSet polyLineSet;
3082  QTriangulator<quint32> triangulator;
3083  triangulator.initialize(path, matrix, lod);
3084  QVertexSet<quint32> vertexSet = triangulator.polyline();
3085  polyLineSet.vertices = vertexSet.vertices;
3086  polyLineSet.indices.setDataUint(vertexSet.indices);
3087  } else {
3088  QTriangulator<quint16> triangulator;
3089  triangulator.initialize(path, matrix, lod);
3090  QVertexSet<quint16> vertexSet = triangulator.triangulate();
3091  polyLineSet.vertices = vertexSet.vertices;
3092  polyLineSet.indices.setDataUshort(vertexSet.indices);
3093  }
3094  return polyLineSet;
3095 }
QVertexSet< T > triangulate()
void setDataUint(const QVector< quint32 > &data)
QVector< qreal > vertices
QVertexIndexVector indices
void setDataUshort(const QVector< quint16 > &data)
QVertexSet< T > polyline()
QVector< qreal > vertices
void initialize(const qreal *polygon, int count, uint hint, const QTransform &matrix)
static Extensions glExtensions()
Definition: qgl.cpp:5781
QVector< T > indices

◆ qPolyline() [2/2]

QPolylineSet qPolyline ( const QPainterPath path,
const QTransform matrix = QTransform(),
qreal  lod = 1 
)

Definition at line 3097 of file qtriangulator.cpp.

3099 {
3100  QPolylineSet polyLineSet;
3102  QTriangulator<quint32> triangulator;
3103  triangulator.initialize(path, matrix, lod);
3104  QVertexSet<quint32> vertexSet = triangulator.polyline();
3105  polyLineSet.vertices = vertexSet.vertices;
3106  polyLineSet.indices.setDataUint(vertexSet.indices);
3107  } else {
3108  QTriangulator<quint16> triangulator;
3109  triangulator.initialize(path, matrix, lod);
3110  QVertexSet<quint16> vertexSet = triangulator.triangulate();
3111  polyLineSet.vertices = vertexSet.vertices;
3112  polyLineSet.indices.setDataUshort(vertexSet.indices);
3113  }
3114  return polyLineSet;
3115 }
QVertexSet< T > triangulate()
void setDataUint(const QVector< quint32 > &data)
QVector< qreal > vertices
QVertexIndexVector indices
void setDataUshort(const QVector< quint16 > &data)
QVertexSet< T > polyline()
QVector< qreal > vertices
void initialize(const qreal *polygon, int count, uint hint, const QTransform &matrix)
static Extensions glExtensions()
Definition: qgl.cpp:5781
QVector< T > indices

◆ qTriangulate() [1/3]

QTriangleSet qTriangulate ( const qreal polygon,
int  count,
uint  hint = QVectorPath::PolygonHint|QVectorPath::OddEvenFill,
const QTransform matrix = QTransform() 
)

Definition at line 3016 of file qtriangulator.cpp.

Referenced by QGL2PaintEngineExPrivate::fill().

3018 {
3019  QTriangleSet triangleSet;
3021  QTriangulator<quint32> triangulator;
3022  triangulator.initialize(polygon, count, hint, matrix);
3023  QVertexSet<quint32> vertexSet = triangulator.triangulate();
3024  triangleSet.vertices = vertexSet.vertices;
3025  triangleSet.indices.setDataUint(vertexSet.indices);
3026 
3027  } else {
3028  QTriangulator<quint16> triangulator;
3029  triangulator.initialize(polygon, count, hint, matrix);
3030  QVertexSet<quint16> vertexSet = triangulator.triangulate();
3031  triangleSet.vertices = vertexSet.vertices;
3032  triangleSet.indices.setDataUshort(vertexSet.indices);
3033  }
3034  return triangleSet;
3035 }
QVertexSet< T > triangulate()
QVertexIndexVector indices
void setDataUint(const QVector< quint32 > &data)
QVector< qreal > vertices
void setDataUshort(const QVector< quint16 > &data)
QVector< qreal > vertices
void initialize(const qreal *polygon, int count, uint hint, const QTransform &matrix)
static Extensions glExtensions()
Definition: qgl.cpp:5781
QVector< T > indices

◆ qTriangulate() [2/3]

QTriangleSet qTriangulate ( const QVectorPath path,
const QTransform matrix = QTransform(),
qreal  lod = 1 
)

Definition at line 3037 of file qtriangulator.cpp.

3039 {
3040  QTriangleSet triangleSet;
3042  QTriangulator<quint32> triangulator;
3043  triangulator.initialize(path, matrix, lod);
3044  QVertexSet<quint32> vertexSet = triangulator.triangulate();
3045  triangleSet.vertices = vertexSet.vertices;
3046  triangleSet.indices.setDataUint(vertexSet.indices);
3047  } else {
3048  QTriangulator<quint16> triangulator;
3049  triangulator.initialize(path, matrix, lod);
3050  QVertexSet<quint16> vertexSet = triangulator.triangulate();
3051  triangleSet.vertices = vertexSet.vertices;
3052  triangleSet.indices.setDataUshort(vertexSet.indices);
3053  }
3054  return triangleSet;
3055 }
QVertexSet< T > triangulate()
QVertexIndexVector indices
void setDataUint(const QVector< quint32 > &data)
QVector< qreal > vertices
void setDataUshort(const QVector< quint16 > &data)
QVector< qreal > vertices
void initialize(const qreal *polygon, int count, uint hint, const QTransform &matrix)
static Extensions glExtensions()
Definition: qgl.cpp:5781
QVector< T > indices

◆ qTriangulate() [3/3]

QTriangleSet qTriangulate ( const QPainterPath path,
const QTransform matrix = QTransform(),
qreal  lod = 1 
)

Definition at line 3057 of file qtriangulator.cpp.

3059 {
3060  QTriangleSet triangleSet;
3062  QTriangulator<quint32> triangulator;
3063  triangulator.initialize(path, matrix, lod);
3064  QVertexSet<quint32> vertexSet = triangulator.triangulate();
3065  triangleSet.vertices = vertexSet.vertices;
3066  triangleSet.indices.setDataUint(vertexSet.indices);
3067  } else {
3068  QTriangulator<quint16> triangulator;
3069  triangulator.initialize(path, matrix, lod);
3070  QVertexSet<quint16> vertexSet = triangulator.triangulate();
3071  triangleSet.vertices = vertexSet.vertices;
3072  triangleSet.indices.setDataUshort(vertexSet.indices);
3073  }
3074  return triangleSet;
3075 }
QVertexSet< T > triangulate()
QVertexIndexVector indices
void setDataUint(const QVector< quint32 > &data)
QVector< qreal > vertices
void setDataUshort(const QVector< quint16 > &data)
QVector< qreal > vertices
void initialize(const qreal *polygon, int count, uint hint, const QTransform &matrix)
static Extensions glExtensions()
Definition: qgl.cpp:5781
QVector< T > indices