QCAD
Open Source 2D CAD
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RPainterPath Class Reference

Extended painter path with a z-level and a pen. More...

#include <RPainterPath.h>

List of all members.

Public Types

enum  Mode {
  NoModes = 0x00, Selected = 0x01, Highlighted = 0x02, Invalid = 0x04,
  FixedPenColor = 0x08, FixedBrushColor = 0x10, AutoRegen = 0x20, AlwaysRegen = 0x40,
  InheritPen = 0x80
}

Public Member Functions

void addArc (const RArc &arc)
void addBox (const RBox &box)
void addPath (const RPainterPath &path)
void addPoint (const RVector &position)
void addRect (double x1, double y1, double x2, double y2)
void addRect (const QRectF &rect)
 Fixes crashing QPainterPath::addRect.
void addShape (QSharedPointer< RShape > shape)
void addSpline (const RSpline &spline)
void closeSubpath ()
bool containsPoint (const RVector &v) const
void cubicTo (const RVector &cp1, const RVector &cp2, const RVector &v)
void cubicTo (qreal ctrlPt1x, qreal ctrlPt1y, qreal ctrlPt2x, qreal ctrlPt2y, qreal endPtx, qreal endPty)
bool getAlwaysRegen () const
bool getAutoRegen () const
RBox getBoundingBox () const
QBrush getBrush () const
double getDistanceTo (const RVector &point) const
int getElementCount () const
RVector getEndPoint () const
double getFeatureSize () const
bool getInheritPen () const
bool getMode (RPainterPath::Mode mode) const
QPen getPen () const
double getPixelSizeHint () const
QList< RVectorgetPoints () const
QList< QSharedPointer< RShape > > getShapes () const
RVector getStartPoint () const
QPainterPath::ElementType getTypeAt (int i) const
double getXAt (int i) const
double getYAt (int i) const
int getZLevel () const
bool hasPoints ()
bool isEmpty () const
bool isFixedBrushColor () const
bool isFixedPenColor () const
bool isHighlighted () const
bool isSelected () const
bool isValid ()
void lineTo (const RVector &v)
void lineTo (qreal x, qreal y)
void lineTo (const QPointF &p)
void moveTo (const RVector &v)
void moveTo (qreal x, qreal y)
void moveTo (const QPointF &p)
void quadTo (const RVector &cp, const RVector &v)
void quadTo (qreal ctrlPtx, qreal ctrlPty, qreal endPtx, qreal endPty)
 RPainterPath ()
 Copyright (c) 2011-2014 by Andrew Mustun.
 RPainterPath (const QPainterPath &path)
void setAlwaysRegen (bool on)
void setAutoRegen (bool on)
void setBrush (const QBrush &b)
void setFeatureSize (double s)
void setFixedBrushColor (bool on)
void setFixedPenColor (bool on)
void setHighlighted (bool on)
void setInheritPen (bool on)
void setMode (RPainterPath::Mode mode, bool on=true)
void setPen (const QPen &p)
 Sets the pen of this painter path.
void setPixelSizeHint (double s)
void setPoints (const QList< RVector > &p)
void setSelected (bool on)
void setValid (bool on)
void setZLevel (int zl)
 Sets the z-level of the painter path.
void transform (const QTransform &t)
virtual ~RPainterPath ()

Private Attributes

QBrush brush
double featureSize
Modes modes
QPen pen
double pixelSizeHint
QList< RVectorpoints
int zLevel

Detailed Description

Extended painter path with a z-level and a pen.

Scriptable:
This class is wrapped for script environments.
Copyable:
Script wrappers of this class should pass objects by reference.

Member Enumeration Documentation

Enumerator:
NoModes 
Selected 
Highlighted 
Invalid 
FixedPenColor 
FixedBrushColor 
AutoRegen 
AlwaysRegen 
InheritPen 

Constructor & Destructor Documentation

RPainterPath::RPainterPath ( )

Copyright (c) 2011-2014 by Andrew Mustun.

All rights reserved.

This file is part of the QCAD project.

QCAD is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

QCAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with QCAD.

RPainterPath::RPainterPath ( const QPainterPath &  path)
RPainterPath::~RPainterPath ( )
virtual

Member Function Documentation

void RPainterPath::addArc ( const RArc arc)
void RPainterPath::addBox ( const RBox box)
void RPainterPath::addPath ( const RPainterPath path)
void RPainterPath::addPoint ( const RVector position)
void RPainterPath::addRect ( double  x1,
double  y1,
double  x2,
double  y2 
)
void RPainterPath::addRect ( const QRectF &  rect)

Fixes crashing QPainterPath::addRect.

void RPainterPath::addShape ( QSharedPointer< RShape shape)
void RPainterPath::addSpline ( const RSpline spline)
void RPainterPath::closeSubpath ( )
inline
bool RPainterPath::containsPoint ( const RVector v) const
inline
void RPainterPath::cubicTo ( const RVector cp1,
const RVector cp2,
const RVector v 
)
inline
void RPainterPath::cubicTo ( qreal  ctrlPt1x,
qreal  ctrlPt1y,
qreal  ctrlPt2x,
qreal  ctrlPt2y,
qreal  endPtx,
qreal  endPty 
)
inline
bool RPainterPath::getAlwaysRegen ( ) const
bool RPainterPath::getAutoRegen ( ) const
RBox RPainterPath::getBoundingBox ( ) const
QBrush RPainterPath::getBrush ( ) const
double RPainterPath::getDistanceTo ( const RVector point) const
Returns:
Distance from this painter path to the given point.

This can be used for example to find out how close the visual representation of an entity is to the mouse cursor on the screen.

int RPainterPath::getElementCount ( ) const
RVector RPainterPath::getEndPoint ( ) const
double RPainterPath::getFeatureSize ( ) const
bool RPainterPath::getInheritPen ( ) const
bool RPainterPath::getMode ( RPainterPath::Mode  mode) const
QPen RPainterPath::getPen ( ) const
Returns:
Pen of this painter path.
double RPainterPath::getPixelSizeHint ( ) const
QList< RVector > RPainterPath::getPoints ( ) const
QList< QSharedPointer< RShape > > RPainterPath::getShapes ( ) const
RVector RPainterPath::getStartPoint ( ) const
QPainterPath::ElementType RPainterPath::getTypeAt ( int  i) const
double RPainterPath::getXAt ( int  i) const
double RPainterPath::getYAt ( int  i) const
int RPainterPath::getZLevel ( ) const
Returns:
Z-level of the painter path.
bool RPainterPath::hasPoints ( )
bool RPainterPath::isEmpty ( ) const
bool RPainterPath::isFixedBrushColor ( ) const
bool RPainterPath::isFixedPenColor ( ) const
bool RPainterPath::isHighlighted ( ) const
bool RPainterPath::isSelected ( ) const
bool RPainterPath::isValid ( )
void RPainterPath::lineTo ( const RVector v)
inline
void RPainterPath::lineTo ( qreal  x,
qreal  y 
)
inline
void RPainterPath::lineTo ( const QPointF &  p)
inline
   \par Non-Scriptable:

This function is not available in script environments.

void RPainterPath::moveTo ( const RVector v)
inline
void RPainterPath::moveTo ( qreal  x,
qreal  y 
)
inline
void RPainterPath::moveTo ( const QPointF &  p)
inline
   \par Non-Scriptable:

This function is not available in script environments.

void RPainterPath::quadTo ( const RVector cp,
const RVector v 
)
inline
void RPainterPath::quadTo ( qreal  ctrlPtx,
qreal  ctrlPty,
qreal  endPtx,
qreal  endPty 
)
inline
void RPainterPath::setAlwaysRegen ( bool  on)
void RPainterPath::setAutoRegen ( bool  on)
void RPainterPath::setBrush ( const QBrush &  b)
void RPainterPath::setFeatureSize ( double  s)
void RPainterPath::setFixedBrushColor ( bool  on)
void RPainterPath::setFixedPenColor ( bool  on)
void RPainterPath::setHighlighted ( bool  on)
void RPainterPath::setInheritPen ( bool  on)
void RPainterPath::setMode ( RPainterPath::Mode  mode,
bool  on = true 
)
void RPainterPath::setPen ( const QPen &  p)

Sets the pen of this painter path.

The pen may be set before painting the path but this is up to the caller.

void RPainterPath::setPixelSizeHint ( double  s)
void RPainterPath::setPoints ( const QList< RVector > &  p)
void RPainterPath::setSelected ( bool  on)
void RPainterPath::setValid ( bool  on)
void RPainterPath::setZLevel ( int  zl)

Sets the z-level of the painter path.

Painter paths may be ordered by z-level when drawn.

void RPainterPath::transform ( const QTransform &  t)

Member Data Documentation

QBrush RPainterPath::brush
private
double RPainterPath::featureSize
private
Modes RPainterPath::modes
private
QPen RPainterPath::pen
private
double RPainterPath::pixelSizeHint
private
QList<RVector> RPainterPath::points
private
int RPainterPath::zLevel
private

The documentation for this class was generated from the following files: