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  GradientType {
  GradientType::Linear,
  GradientType::Radial,
  GradientType::Rectangular
}
 Type of gradient used. More...
 
enum  { gradientStepsInfinite =0 }
 Special values for gradient step count. More...
 

Public Member Functions

 SvtGraphicFill ()
 
 SvtGraphicFill (const tools::PolyPolygon &rPath, 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, const 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
 deprecated 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:
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

Special values for gradient step count.

Enumerator
gradientStepsInfinite 

Definition at line 251 of file graphictools.hxx.

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.

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.

Type of gradient used.

Enumerator
Linear 
Radial 
Rectangular 

Definition at line 249 of file graphictools.hxx.

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::SvtGraphicFill ( )

Definition at line 164 of file graphictools.cxx.

References COL_BLACK(), and maFillColor.

SvtGraphicFill::SvtGraphicFill ( const tools::PolyPolygon rPath,
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,
const Graphic aFillGraphic 
)

All in one constructor.

See accessor method descriptions for argument description

Definition at line 182 of file graphictools.cxx.

References maFillColor.

Member Function Documentation

const Color& SvtGraphicFill::getFillColor ( ) const
inline

Get color used for solid fills.

Definition at line 297 of file graphictools.hxx.

References maFillColor.

FillRule SvtGraphicFill::getFillRule ( ) const
inline

Get fill rule used.

Definition at line 304 of file graphictools.hxx.

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

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().

GradientType SvtGraphicFill::getGradientType ( ) const
inline

Get type of gradient used.

Definition at line 332 of file graphictools.hxx.

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 225 of file graphictools.cxx.

References maFillGraphic.

void SvtGraphicFill::getPath ( tools::PolyPolygon rPath) const
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 219 of file graphictools.cxx.

References maFillTransform.

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().

bool SvtGraphicFill::IsTiling ( ) const
inline

deprecated

Definition at line 325 of file graphictools.hxx.

bool SvtGraphicFill::isTiling ( ) const
inline

Query state of texture tiling.

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

Definition at line 330 of file graphictools.hxx.

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

Friends And Related Function Documentation

VCL_DLLPUBLIC friend SvStream& ReadSvtGraphicFill ( SvStream rIStm,
SvtGraphicFill rClass 
)
friend

Definition at line 265 of file graphictools.cxx.

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

Definition at line 235 of file graphictools.cxx.

Member Data Documentation

Color SvtGraphicFill::maFillColor
private

Definition at line 353 of file graphictools.hxx.

Referenced by ReadSvtGraphicFill(), and WriteSvtGraphicFill().

Graphic SvtGraphicFill::maFillGraphic
private

Definition at line 365 of file graphictools.hxx.

Referenced by getGraphic(), ReadSvtGraphicFill(), and WriteSvtGraphicFill().

FillRule SvtGraphicFill::maFillRule
private

Definition at line 355 of file graphictools.hxx.

Referenced by ReadSvtGraphicFill(), and WriteSvtGraphicFill().

Transform SvtGraphicFill::maFillTransform
private

Definition at line 357 of file graphictools.hxx.

Referenced by getTransform(), ReadSvtGraphicFill(), and WriteSvtGraphicFill().

FillType SvtGraphicFill::maFillType
private

Definition at line 356 of file graphictools.hxx.

Referenced by ReadSvtGraphicFill(), and WriteSvtGraphicFill().

Color SvtGraphicFill::maGradient1stColor
private

Definition at line 362 of file graphictools.hxx.

Referenced by ReadSvtGraphicFill(), and WriteSvtGraphicFill().

Color SvtGraphicFill::maGradient2ndColor
private

Definition at line 363 of file graphictools.hxx.

Referenced by ReadSvtGraphicFill(), and WriteSvtGraphicFill().

sal_Int32 SvtGraphicFill::maGradientStepCount
private

Definition at line 364 of file graphictools.hxx.

Referenced by ReadSvtGraphicFill(), and WriteSvtGraphicFill().

GradientType SvtGraphicFill::maGradientType
private

Definition at line 361 of file graphictools.hxx.

Referenced by ReadSvtGraphicFill(), and WriteSvtGraphicFill().

Color SvtGraphicFill::maHatchColor
private

Definition at line 360 of file graphictools.hxx.

Referenced by ReadSvtGraphicFill(), and WriteSvtGraphicFill().

HatchType SvtGraphicFill::maHatchType
private

Definition at line 359 of file graphictools.hxx.

Referenced by ReadSvtGraphicFill(), and WriteSvtGraphicFill().

tools::PolyPolygon SvtGraphicFill::maPath
private

Definition at line 352 of file graphictools.hxx.

Referenced by getPath(), ReadSvtGraphicFill(), setPath(), and WriteSvtGraphicFill().

bool SvtGraphicFill::mbTiling
private

Definition at line 358 of file graphictools.hxx.

Referenced by ReadSvtGraphicFill(), and WriteSvtGraphicFill().

double SvtGraphicFill::mfTransparency
private

Definition at line 354 of file graphictools.hxx.

Referenced by ReadSvtGraphicFill(), and WriteSvtGraphicFill().


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