Public Member Functions

QwtPolygonClipper Class Reference

List of all members.

Public Member Functions

 QwtPolygonClipper (const QRect &r)
QwtPolygon clipPolygon (const QwtPolygon &) const
 Sutherland-Hodgman polygon clipping.

Detailed Description

Definition at line 53 of file qwt_clipper.cpp.


Constructor & Destructor Documentation

QwtPolygonClipper::QwtPolygonClipper ( const QRect &  r )

Definition at line 99 of file qwt_clipper.cpp.

                                                  : 
    QRect(r) 
{
}

Member Function Documentation

QwtPolygon QwtPolygonClipper::clipPolygon ( const QwtPolygon pa ) const

Sutherland-Hodgman polygon clipping.

Definition at line 114 of file qwt_clipper.cpp.

References NEdges.

Referenced by QwtClipper::clipPolygon().

{
    if ( contains( pa.boundingRect() ) )
        return pa;

    QwtPolygon cpa(pa.size());

    clipEdge((Edge)0, pa, cpa);

    for ( uint edge = 1; edge < NEdges; edge++ ) 
    {
        const QwtPolygon rpa = cpa;
#if QT_VERSION < 0x040000
        cpa.detach();
#endif
        clipEdge((Edge)edge, rpa, cpa);
    }

    return cpa;
}

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines