karbon

#include <vstar.h>

Inheritance diagram for VStar:
VPath VObject

Public Types

enum  VStarType {
  star_outline , spoke , wheel , polygon ,
  framed_star , star , gear
}
Public Types inherited from VObject
enum  VState {
  normal = 0 , normal_locked = 1 , hidden = 2 , hidden_locked = 3 ,
  deleted = 4 , selected = 5 , edit = 6
}

Public Member Functions

 VStar (VObject *parent, VState state=edit)
 VStar (VObject *parent, const KoPoint &center, double outerRadius, double innerRadius, uint edges, double angle=0.0, uint innerAngle=0, double roundness=0.0, VStarType type=star_outline)
virtual TQString name () const
virtual void save (TQDomElement &element) const
virtual void load (const TQDomElement &element)
virtual VPath * clone () const
Public Member Functions inherited from VPath
 VPath (VObject *parent, VState state=normal)
 VPath (const VPath &path)
virtual DCOPObject * dcopObject ()
const KoPoint & currentPoint () const
bool moveTo (const KoPoint &p)
bool lineTo (const KoPoint &p)
bool curveTo (const KoPoint &p1, const KoPoint &p2, const KoPoint &p3)
bool curve1To (const KoPoint &p2, const KoPoint &p3)
bool curve2To (const KoPoint &p1, const KoPoint &p3)
bool arcTo (const KoPoint &p1, const KoPoint &p2, double r)
void close ()
bool isClosed () const
void combine (const VPath &path)
void combinePath (const VSubpath &path)
bool pointIsInside (const KoPoint &p) const
bool intersects (const VSegment &segment) const
const VSubpathList & paths () const
virtual const KoRect & boundingBox () const
VFillRule fillMode () const
VFillRule fillRule () const
void setFillRule (VFillRule fillRule)
virtual void draw (VPainter *painter, const KoRect *rect=0L) const
bool drawCenterNode () const
void setDrawCenterNode (bool drawCenterNode=true)
virtual void saveOasis (KoStore *store, KoXmlWriter *docWriter, KoGenStyles &mainStyles, int &index) const
virtual bool loadOasis (const TQDomElement &element, KoOasisLoadingContext &context)
virtual void accept (VVisitor &visitor)
void transform (const TQString &transform)
void transformOasis (const TQString &transform)
void transform (const TQWMatrix &mat)
void loadSvgPath (const TQString &)
void saveSvgPath (TQString &) const
Public Member Functions inherited from VObject
 VObject (VObject *parent, VState state=edit)
 VObject (const VObject &obj)
virtual ~VObject ()
bool boundingBoxIsInvalid () const
void invalidateBoundingBox ()
void setParent (VObject *parent)
VObject * parent () const
VState state () const
virtual void setState (const VState state)
virtual VStroke * stroke () const
virtual VFill * fill () const
virtual void setStroke (const VStroke &stroke)
virtual void setFill (const VFill &fill)
virtual void insertInfrontOf (VObject *newObject, VObject *oldObject)
void setName (const TQString &s)
VDocument * document () const

Static Public Member Functions

static double getOptimalInnerRadius (uint edges, double outerRadius, uint innerAngle)
Static Public Member Functions inherited from VPath
static TQWMatrix parseTransform (const TQString &transform)

Protected Member Functions

void init ()
Protected Member Functions inherited from VPath
TQString buildSvgTransform () const
TQString buildSvgTransform (const TQWMatrix &mat) const
TQString buildOasisTransform () const
TQString buildOasisTransform (const TQWMatrix &mat) const
void transformByViewbox (const TQDomElement &element, TQString viewbox)
virtual void svgMoveTo (double x1, double y1, bool abs=true)
virtual void svgLineTo (double x1, double y1, bool abs=true)
virtual void svgCurveToCubic (double x1, double y1, double x2, double y2, double x, double y, bool abs=true)
virtual void svgClosePath ()
virtual void saveOasisFill (KoGenStyles &mainStyles, KoGenStyle &stylesojectauto) const
TQWMatrix parseOasisTransform (const TQString &transform)
Protected Member Functions inherited from VObject
void addStyles (const TQDomElement *style, KoOasisLoadingContext &context)

Additional Inherited Members

Protected Attributes inherited from VPath
TQWMatrix m_matrix
Protected Attributes inherited from VObject
KoRect m_boundingBox
VState m_state: 8
bool m_boundingBoxIsInvalid: 1
VStroke * m_stroke
VFill * m_fill
DCOPObject * m_dcop

Detailed Description

This shape offers star-like shapes with a lot of parameters :

Types :

Star - fully connected star shape. Star outline - like star but without the cross connections. Framed star - like star outline but with an enclosing path. Spoke - basically a star outline with inner radius of zero. Wheel - like spoke but with enclosing path. Polygon - like VPolygon. Gear - variant on star outline, resembling the KDE gear.

Parameters :

Edges - number of edges, which must be greater or equal to 3. Outer radius - radius amount of circumcircle of the star. Inner radius - inner radius where star has to connect to. This value doesn't apply to polygon, spoke and wheel. Inner angle - extra radius amount for inner radius. Roundness - uses curves instead of lines for the star shape.

Definition at line 47 of file vstar.h.

Member Enumeration Documentation

◆ VStarType

enum VStar::VStarType

Definition at line 50 of file vstar.h.

Constructor & Destructor Documentation

◆ VStar() [1/2]

VStar::VStar ( VObject * parent,
VState state = edit )

Definition at line 33 of file vstar.cpp.

◆ VStar() [2/2]

VStar::VStar ( VObject * parent,
const KoPoint & center,
double outerRadius,
double innerRadius,
uint edges,
double angle = 0.0,
uint innerAngle = 0,
double roundness = 0.0,
VStarType type = star_outline )

Definition at line 38 of file vstar.cpp.

Member Function Documentation

◆ clone()

VPath * VStar::clone ( ) const
virtual

Create an exact copy of this object.

Returns
the exact object copy

Reimplemented from VPath.

Definition at line 345 of file vstar.cpp.

◆ getOptimalInnerRadius()

double VStar::getOptimalInnerRadius ( uint edges,
double outerRadius,
uint innerAngle )
static

Definition at line 236 of file vstar.cpp.

◆ init()

void VStar::init ( )
protected

Definition at line 47 of file vstar.cpp.

◆ load()

void VStar::load ( const TQDomElement & element)
virtual

Load this object's state from xml and initialize this object accordingly.

Parameters
elementthe DOM element from which the attributes are read

Reimplemented from VPath.

Definition at line 314 of file vstar.cpp.

◆ name()

TQString VStar::name ( ) const
virtual

Returns the name of the object.

Returns
the object's name

Reimplemented from VObject.

Definition at line 265 of file vstar.cpp.

◆ save()

void VStar::save ( TQDomElement & element) const
virtual

Save this object's state to xml.

Parameters
elementthe DOM element to which the attributes are saved

Reimplemented from VPath.

Definition at line 272 of file vstar.cpp.


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