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:
[legend]

Classes

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

Public Types

enum  FillRule {
  fillNonZero =0 ,
  fillEvenOdd
}
 Type of fill algorithm used. More...
 
enum  FillType {
  fillSolid =0 ,
  fillGradient ,
  fillHatch ,
  fillTexture
}
 Type of filling used. More...
 
enum  HatchType {
  hatchSingle =0 ,
  hatchDouble ,
  hatchTriple
}
 Type of hatching used. More...
 
enum class  GradientType {
  Linear ,
  Radial ,
  Rectangular
}
 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
 

Friends

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.

Enumerator
gradientStepsInfinite 

Definition at line 251 of file graphictools.hxx.

◆ FillRule

Type of fill algorithm used.

Enumerator
fillNonZero 

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.
fillEvenOdd 

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.

Enumerator
fillSolid 

Fill with a specified solid color.

fillGradient 

Fill with the specified gradient.

fillHatch 

Fill with the specified hatch.

fillTexture 

Fill with the specified texture (a Graphic object)

Definition at line 224 of file graphictools.hxx.

◆ GradientType

enum class SvtGraphicFill::GradientType
strong

Type of gradient used.

Enumerator
Linear 
Radial 
Rectangular 

Definition at line 249 of file graphictools.hxx.

◆ HatchType

Type of hatching used.

Enumerator
hatchSingle 

horizontal parallel lines, one unit apart

hatchDouble 

horizontal and vertical orthogonally crossing lines, one unit apart

hatchTriple 

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
inline

Get color used for solid fills.

Definition at line 297 of file graphictools.hxx.

References maFillColor.

◆ getFillRule()

FillRule SvtGraphicFill::getFillRule ( ) const
inline

Get fill rule used.

Definition at line 304 of file graphictools.hxx.

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

◆ getFillType()

FillType SvtGraphicFill::getFillType ( ) const
inline

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
inline

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
inline

Get stroke transparency.

Returns
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
inline

Query state of texture tiling.

Returns
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 
)
friend

Definition at line 258 of file graphictools.cxx.

◆ WriteSvtGraphicFill

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

Definition at line 228 of file graphictools.cxx.

Member Data Documentation

◆ maFillColor

Color SvtGraphicFill::maFillColor
private

Definition at line 352 of file graphictools.hxx.

◆ maFillGraphic

Graphic SvtGraphicFill::maFillGraphic
private

Definition at line 364 of file graphictools.hxx.

Referenced by getGraphic().

◆ maFillRule

FillRule SvtGraphicFill::maFillRule
private

Definition at line 354 of file graphictools.hxx.

◆ maFillTransform

Transform SvtGraphicFill::maFillTransform
private

Definition at line 356 of file graphictools.hxx.

Referenced by getTransform().

◆ maFillType

FillType SvtGraphicFill::maFillType
private

Definition at line 355 of file graphictools.hxx.

◆ maGradient1stColor

Color SvtGraphicFill::maGradient1stColor
private

Definition at line 361 of file graphictools.hxx.

◆ maGradient2ndColor

Color SvtGraphicFill::maGradient2ndColor
private

Definition at line 362 of file graphictools.hxx.

◆ maGradientStepCount

sal_Int32 SvtGraphicFill::maGradientStepCount
private

Definition at line 363 of file graphictools.hxx.

◆ maGradientType

GradientType SvtGraphicFill::maGradientType
private

Definition at line 360 of file graphictools.hxx.

◆ maHatchColor

Color SvtGraphicFill::maHatchColor
private

Definition at line 359 of file graphictools.hxx.

◆ maHatchType

HatchType SvtGraphicFill::maHatchType
private

Definition at line 358 of file graphictools.hxx.

◆ maPath

tools::PolyPolygon SvtGraphicFill::maPath
private

Definition at line 351 of file graphictools.hxx.

Referenced by getPath(), and setPath().

◆ mbTiling

bool SvtGraphicFill::mbTiling
private

Definition at line 357 of file graphictools.hxx.

◆ mfTransparency

double SvtGraphicFill::mfTransparency
private

Definition at line 353 of file graphictools.hxx.


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