LibreOffice Module vcl (master) 1
Classes | Public Types | Public Member Functions | Private Attributes | Friends | List of all members
SvtGraphicFill Class Reference

Encapsulates geometry and associated attributes of a filled area. More...

#include <graphictools.hxx>

Collaboration diagram for SvtGraphicFill:


struct  Transform
 Homogeneous 2D transformation matrix. More...

Public Types

enum  FillRule {
  fillNonZero =0 ,
 Type of fill algorithm used. More...
enum  FillType {
  fillSolid =0 ,
  fillGradient ,
  fillHatch ,
 Type of filling used. More...
enum  HatchType {
  hatchSingle =0 ,
  hatchDouble ,
 Type of hatching used. More...
enum class  GradientType {
  Linear ,
  Radial ,
 Type of gradient used. More...
enum  { gradientStepsInfinite =0 }
 Special values for gradient step count. More...

Public Member Functions

 SvtGraphicFill ()
 SvtGraphicFill (tools::PolyPolygon aPath, Color aFillColor, double fTransparency, FillRule aFillRule, FillType aFillType, const Transform &aFillTransform, bool bTiling, HatchType aHatchType, Color aHatchColor, GradientType aGradientType, Color aGradient1stColor, Color aGradient2ndColor, sal_Int32 aGradientStepCount, Graphic aFillGraphic)
 All in one constructor. More...
void getPath (tools::PolyPolygon &) const
 Query path to fill. More...
const ColorgetFillColor () const
 Get color used for solid fills. More...
double getTransparency () const
 Get stroke transparency. More...
FillRule getFillRule () const
 Get fill rule used. More...
FillType getFillType () const
 Get fill type used. More...
void getTransform (Transform &) const
 Get transformation applied to hatch, gradient or texture during fill. More...
bool isTiling () const
 Query state of texture tiling. More...
GradientType getGradientType () const
 Get type of gradient used. More...
void getGraphic (Graphic &) const
 Get the texture graphic used. More...
void setPath (const tools::PolyPolygon &rPath)
 Set path to fill. More...

Private Attributes

tools::PolyPolygon maPath
Color maFillColor
double mfTransparency
FillRule maFillRule
FillType maFillType
Transform maFillTransform
bool mbTiling
HatchType maHatchType
Color maHatchColor
GradientType maGradientType
Color maGradient1stColor
Color maGradient2ndColor
sal_Int32 maGradientStepCount
Graphic maFillGraphic


VCL_DLLPUBLIC friend SvStreamWriteSvtGraphicFill (SvStream &rOStm, const SvtGraphicFill &rClass)
VCL_DLLPUBLIC friend SvStreamReadSvtGraphicFill (SvStream &rIStm, SvtGraphicFill &rClass)

Detailed Description

Encapsulates geometry and associated attributes of a filled area.

Attention: \n Widespread use is deprecated. See declarations above
for the way to go. Especially the copied enums from svx/xenum.hxx is troublesome.

Use this class to store geometry and attributes of a filled area, such as fill color, transparency, texture or hatch. The geometry is the so-called 'path', whose inner area will get filled according to the attributes set. If the path is intersecting, or one part of the path is lying fully within another part, then the fill rule determines which parts are filled and which are not.

Definition at line 199 of file graphictools.hxx.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Special values for gradient step count.


Definition at line 251 of file graphictools.hxx.

◆ FillRule

Type of fill algorithm used.


Non-zero winding rule.

    Fill shape scanline-wise. Starting at the left, determine
    the winding number as follows: every segment crossed that
    runs counter-clockwise adds one to the winding number,
    every segment crossed that runs clockwise subtracts
    one. The part of the scanline where the winding number is
    non-zero gets filled.

Even-odd fill rule.

    Fill shape scanline-wise. Starting at the left, count the
    number of segments crossed. If this number is odd, the
    part of the scanline is filled, otherwise not.

Definition at line 203 of file graphictools.hxx.

◆ FillType

Type of filling used.


Fill with a specified solid color.


Fill with the specified gradient.


Fill with the specified hatch.


Fill with the specified texture (a Graphic object)

Definition at line 224 of file graphictools.hxx.

◆ GradientType

enum class SvtGraphicFill::GradientType

Type of gradient used.


Definition at line 249 of file graphictools.hxx.

◆ HatchType

Type of hatching used.


horizontal parallel lines, one unit apart


horizontal and vertical orthogonally crossing lines, one unit apart


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.

Definition at line 236 of file graphictools.hxx.

Constructor & Destructor Documentation

◆ SvtGraphicFill() [1/2]

SvtGraphicFill::SvtGraphicFill ( )

Definition at line 160 of file graphictools.cxx.

References COL_BLACK(), and maFillColor.

◆ SvtGraphicFill() [2/2]

SvtGraphicFill::SvtGraphicFill ( tools::PolyPolygon  aPath,
Color  aFillColor,
double  fTransparency,
FillRule  aFillRule,
FillType  aFillType,
const Transform aFillTransform,
bool  bTiling,
HatchType  aHatchType,
Color  aHatchColor,
GradientType  aGradientType,
Color  aGradient1stColor,
Color  aGradient2ndColor,
sal_Int32  aGradientStepCount,
Graphic  aFillGraphic 

All in one constructor.

See accessor method descriptions for argument description

Definition at line 175 of file graphictools.cxx.

References maFillColor, and maPath.

Member Function Documentation

◆ getFillColor()

const Color & SvtGraphicFill::getFillColor ( ) const

Get color used for solid fills.

Definition at line 297 of file graphictools.hxx.

References maFillColor.

◆ getFillRule()

FillRule SvtGraphicFill::getFillRule ( ) const

Get fill rule used.

Definition at line 304 of file graphictools.hxx.

Referenced by vcl::PDFWriterImpl::playMetafile().

◆ getFillType()

FillType SvtGraphicFill::getFillType ( ) const

Get fill type used.

Currently, only one of the fill types can be used simultaneously. If you specify e.g. FillRule::fillGradient, hatching, texture and solid fill color are ignored.

Definition at line 311 of file graphictools.hxx.

Referenced by vcl::PDFWriterImpl::playMetafile().

◆ getGradientType()

GradientType SvtGraphicFill::getGradientType ( ) const

Get type of gradient used.

Definition at line 331 of file graphictools.hxx.

◆ getGraphic()

void SvtGraphicFill::getGraphic ( Graphic rGraphic) const

Get the texture graphic used.

The Graphic object returned is used to fill the geometry, if the FillType is fillTexture. The Graphic object is always assumed to be of size 1x1, the transformation is used to scale it to the appropriate size.

Definition at line 218 of file graphictools.cxx.

References maFillGraphic.

◆ getPath()

void SvtGraphicFill::getPath ( tools::PolyPolygon rPath) const

◆ getTransform()

void SvtGraphicFill::getTransform ( Transform rTrans) const

Get transformation applied to hatch, gradient or texture during fill.

A fill operation generally starts at the top left position of the object's bounding box. At that position (if tiling is on, also all successive positions), the specified fill graphic is rendered, after applying the fill transformation to it. For example, if the fill transformation contains a translation, the fill graphic is rendered at the object's bounding box's top left corner plus the translation components.

Definition at line 212 of file graphictools.cxx.

References maFillTransform.

◆ getTransparency()

double SvtGraphicFill::getTransparency ( ) const

Get stroke transparency.

the transparency, ranging from 0.0 (opaque) to 1.0 (fully translucent)

Definition at line 302 of file graphictools.hxx.

Referenced by vcl::PDFWriterImpl::playMetafile().

◆ isTiling()

bool SvtGraphicFill::isTiling ( ) const

Query state of texture tiling.

true, if texture is tiled, false, if output only once.

Definition at line 329 of file graphictools.hxx.

◆ setPath()

void SvtGraphicFill::setPath ( const tools::PolyPolygon rPath)

Friends And Related Function Documentation

◆ ReadSvtGraphicFill

VCL_DLLPUBLIC friend SvStream & ReadSvtGraphicFill ( SvStream rIStm,
SvtGraphicFill rClass 

Definition at line 258 of file graphictools.cxx.

◆ WriteSvtGraphicFill

VCL_DLLPUBLIC friend SvStream & WriteSvtGraphicFill ( SvStream rOStm,
const SvtGraphicFill rClass 

Definition at line 228 of file graphictools.cxx.

Member Data Documentation

◆ maFillColor

Color SvtGraphicFill::maFillColor

Definition at line 352 of file graphictools.hxx.

◆ maFillGraphic

Graphic SvtGraphicFill::maFillGraphic

Definition at line 364 of file graphictools.hxx.

Referenced by getGraphic().

◆ maFillRule

FillRule SvtGraphicFill::maFillRule

Definition at line 354 of file graphictools.hxx.

◆ maFillTransform

Transform SvtGraphicFill::maFillTransform

Definition at line 356 of file graphictools.hxx.

Referenced by getTransform().

◆ maFillType

FillType SvtGraphicFill::maFillType

Definition at line 355 of file graphictools.hxx.

◆ maGradient1stColor

Color SvtGraphicFill::maGradient1stColor

Definition at line 361 of file graphictools.hxx.

◆ maGradient2ndColor

Color SvtGraphicFill::maGradient2ndColor

Definition at line 362 of file graphictools.hxx.

◆ maGradientStepCount

sal_Int32 SvtGraphicFill::maGradientStepCount

Definition at line 363 of file graphictools.hxx.

◆ maGradientType

GradientType SvtGraphicFill::maGradientType

Definition at line 360 of file graphictools.hxx.

◆ maHatchColor

Color SvtGraphicFill::maHatchColor

Definition at line 359 of file graphictools.hxx.

◆ maHatchType

HatchType SvtGraphicFill::maHatchType

Definition at line 358 of file graphictools.hxx.

◆ maPath

tools::PolyPolygon SvtGraphicFill::maPath

Definition at line 351 of file graphictools.hxx.

Referenced by getPath(), and setPath().

◆ mbTiling

bool SvtGraphicFill::mbTiling

Definition at line 357 of file graphictools.hxx.

◆ mfTransparency

double SvtGraphicFill::mfTransparency

Definition at line 353 of file graphictools.hxx.

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