Usethisclasstostoregeometryandattributesofagraphical 'penstroke',suchaspenwidth,dashingetc.Thegeometryisthe so-called'path'alongwhichthestrokeistraced,withthegiven penwidth.Thecaptypedetermineshowtheopenendsofthepath shouldbedrawn.Ifthegeometryconsistsofmorethanone segment,thejointypedeterminesinwhichwaythesegmentsare joined.
*/ class VCL_DLLPUBLIC SvtGraphicStroke
{ public: /// Style for open stroke ends enum CapType
{ /// No additional cap
capButt=0, /// Half-round cap at the line end, the center lying at the end point
capRound, /// Half-square cap at the line end, the center lying at the end point
capSquare
}; /// Style for joins of individual stroke segments enum JoinType
{ /// Extend segment edges, until they cross
joinMiter=0, /// Connect segments by a filled round arc
joinRound, /// Connect segments by a direct straight line
joinBevel, /// Perform no join, leads to visible gaps between thick line segments
joinNone
}; typedef ::std::vector< double > DashArray;
// accessors /// Query path to stroke void getPath ( tools::Polygon& ) const; /** Get the polygon that is put at the start of the line
Thepolygonisinaspecialnormalizedposition:thecenterof thestrokedpathwillmeetthegivenpolygonat(0,0)from negativeyvalues.Thus,anarrowwouldhaveitsbaselineon thexaxis,goingupwardstopositiveyvalues.Furthermore, thepolygonisalsoscaledinaspecialway:thewidthofthe joiningstrokeisdefinedtobe SvtGraphicStroke::normalizedArrowWidth(0x10000),i.e.ranging fromx=-0x8000tox=0x8000.So,ifthearrowdoeshavethis width,ithastofiteverystrokewitheverystrokewidth exactly.
*/ void getStartArrow ( tools::PolyPolygon& ) const; /** Get the polygon that is put at the end of the line
@returnthetransparency,rangingfrom0.0(opaque)to1.0(fullytranslucent)
*/ double getTransparency () const { return mfTransparency;} /// Get width of the stroke double getStrokeWidth () const { return mfStrokeWidth;} /// Get the style in which open stroke ends are drawn
CapType getCapType () const { return maCapType;} /// Get the style in which the stroke segments are joined
JoinType getJoinType () const { return maJoinType;} /// Get the maximum length of mitered joins double getMiterLimit () const { return mfMiterLimit;} /// Get an array of "on" and "off" lengths for stroke dashing void getDashArray ( DashArray& ) const;
// mutators /// Set path to stroke void setPath ( const tools::Polygon& ); /** Set the polygon that is put at the start of the line
Thepolygonhastobeinaspecialnormalizedposition,and alreadyscaledtothedesiredsize:thecenterofthestroked pathwillmeetthegivenpolygonat(0,0)fromnegativey values.Thus,anarrowwouldhaveitsbaselineonthexaxis, goingupwardstopositiveyvalues.Furthermore,thepolygon alsohastobescaledappropriately:thewidthofthejoining strokeisdefinedtobeSvtGraphicStroke::normalizedArrowWidth (0x10000),i.e.rangingfromx=-0x8000tox=0x8000.Ifyour arrowdoeshavethiswidth,itwillfiteverystrokewith everystrokewidthexactly.
*/ void setStartArrow ( const tools::PolyPolygon& ); /** Set the polygon that is put at the end of the line
Thepolygonhastobeinaspecialnormalizedposition,and alreadyscaledtothedesiredsize:thecenterofthestroked pathwillmeetthegivenpolygonat(0,0)fromnegativey values.Thus,anarrowwouldhaveitsbaselineonthexaxis, goingupwardstopositiveyvalues.Furthermore,thepolygon alsohastobescaledappropriately:thewidthofthejoining strokeisdefinedtobeSvtGraphicStroke::normalizedArrowWidth (0x10000),i.e.rangingfromx=-0x8000tox=0x8000.Ifyour arrowdoeshavethiswidth,itwillfiteverystrokewith everystrokewidthexactly.
*/ void setEndArrow ( const tools::PolyPolygon& ); /// Affine scaling in both X and Y dimensions void scale ( double fScaleX, double fScaleY );
Usethisclasstostoregeometryandattributesofafilledarea, suchasfillcolor,transparency,textureorhatch.Thegeometry istheso-called'path',whoseinnerareawillgetfilled accordingtotheattributesset.Ifthepathisintersecting,or onepartofthepathislyingfullywithinanotherpart,thenthe fillruledetermineswhichpartsarefilledandwhicharenot.
*/ class VCL_DLLPUBLIC SvtGraphicFill
{ public: /// Type of fill algorithm used enum FillRule
{ /** Non-zero winding rule
Fillshapescanline-wise.Startingattheleft,countthe numberofsegmentscrossed.Ifthisnumberisodd,the partofthescanlineisfilled,otherwisenot.
*/
fillEvenOdd
}; /// Type of filling used enum FillType
{ /// Fill with a specified solid color
fillSolid=0, /// Fill with the specified gradient
fillGradient, /// Fill with the specified hatch
fillHatch, /// Fill with the specified texture (a Graphic object)
fillTexture
}; /// Type of hatching used enum HatchType
{ /// horizontal parallel lines, one unit apart
hatchSingle=0, /// horizontal and vertical orthogonally crossing lines, one unit apart
hatchDouble, /// three crossing lines, like HatchType::hatchDouble, but /// with an additional diagonal line, rising to the upper /// right corner. The first diagonal line goes through the /// upper left corner, the other are each spaced a unit apart.
hatchTriple
}; /// Type of gradient used enumclass GradientType {Linear, Radial, Rectangular}; /// Special values for gradient step count enum { gradientStepsInfinite=0 }; /** Homogeneous 2D transformation matrix
Seeaccessormethoddescriptionsforargumentdescription
*/
SvtGraphicFill( tools::PolyPolygon aPath,
Color aFillColor, double fTransparency,
FillRule aFillRule,
FillType aFillType, // TODO: Multitexturing const Transform& aFillTransform, bool bTiling,
HatchType aHatchType, // TODO: vector of directions and start points
Color aHatchColor,
GradientType aGradientType, // TODO: Transparent gradients (orthogonal to normal ones)
Color aGradient1stColor, // TODO: vector of colors and offsets
Color aGradient2ndColor,
sal_Int32 aGradientStepCount, // numbers of steps to render the gradient. gradientStepsInfinite means infinitely many.
Graphic aFillGraphic );
// accessors /// Query path to fill void getPath ( tools::PolyPolygon& ) const; /// Get color used for solid fills const Color& getFillColor () const { return maFillColor;} /** Get stroke transparency
@returnthetransparency,rangingfrom0.0(opaque)to1.0(fullytranslucent)
*/ double getTransparency () const { return mfTransparency;} /// Get fill rule used
FillRule getFillRule () const { return maFillRule;} /** Get fill type used
Currently,onlyoneofthefilltypescanbeused simultaneously.Ifyouspecifye.g.FillRule::fillGradient, hatching,textureandsolidfillcolorareignored.
*/
FillType getFillType () const { return maFillType;} /** Get transformation applied to hatch, gradient or texture during fill
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.