LibreOffice Module vcl (master) 1
graphictools.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#ifndef INCLUDED_VCL_GRAPHICTOOLS_HXX
21#define INCLUDED_VCL_GRAPHICTOOLS_HXX
22
23#include <vcl/dllapi.h>
24#include <sal/types.h>
25#include <tools/color.hxx>
26#include <tools/poly.hxx>
27#include <vcl/graph.hxx>
28
29#include <vector>
30
31class SvStream;
32
48{
49public:
52 {
54 capButt=0,
58 capSquare
59 };
62 {
64 joinMiter=0,
70 joinNone
71 };
72 typedef ::std::vector< double > DashArray;
73
80 tools::PolyPolygon aStartArrow,
81 tools::PolyPolygon aEndArrow,
82 double fTransparency,
83 double fStrokeWidth,
84 CapType aCap,
85 JoinType aJoin,
86 double fMiterLimit,
87 DashArray&& rDashArray ); // TODO: Dash array offset (position where to start, see PS)
88
89 // accessors
91 void getPath ( tools::Polygon& ) const;
105 void getStartArrow ( tools::PolyPolygon& ) const;
119 void getEndArrow ( tools::PolyPolygon& ) const;
124 double getTransparency () const { return mfTransparency;}
126 double getStrokeWidth () const { return mfStrokeWidth;}
128 CapType getCapType () const { return maCapType;}
130 JoinType getJoinType () const { return maJoinType;}
132 double getMiterLimit () const { return mfMiterLimit;}
134 void getDashArray ( DashArray& ) const;
135
136 // mutators
138 void setPath ( const tools::Polygon& );
152 void setStartArrow ( const tools::PolyPolygon& );
166 void setEndArrow ( const tools::PolyPolygon& );
168 void scale ( double fScaleX, double fScaleY );
169
170private:
171 // friends
174
184};
185
200{
201public:
204 {
214 fillNonZero=0,
221 fillEvenOdd
222 };
225 {
227 fillSolid=0,
233 fillTexture
234 };
237 {
239 hatchSingle=0,
246 hatchTriple
247 };
249 enum class GradientType {Linear, Radial, Rectangular};
251 enum { gradientStepsInfinite=0 };
267 {
268 enum { MatrixSize=6 };
269 Transform();
271 };
272
279 Color aFillColor,
280 double fTransparency,
281 FillRule aFillRule,
282 FillType aFillType, // TODO: Multitexturing
283 const Transform& aFillTransform,
284 bool bTiling,
285 HatchType aHatchType, // TODO: vector of directions and start points
286 Color aHatchColor,
287 GradientType aGradientType, // TODO: Transparent gradients (orthogonal to normal ones)
288 Color aGradient1stColor, // TODO: vector of colors and offsets
289 Color aGradient2ndColor,
290 sal_Int32 aGradientStepCount, // numbers of steps to render the gradient. gradientStepsInfinite means infinitely many.
291 Graphic aFillGraphic );
292
293 // accessors
295 void getPath ( tools::PolyPolygon& ) const;
297 const Color& getFillColor () const { return maFillColor;}
302 double getTransparency () const { return mfTransparency;}
304 FillRule getFillRule () const { return maFillRule;}
311 FillType getFillType () const { return maFillType;}
323 void getTransform ( Transform& ) const;
324
329 bool isTiling () const { return mbTiling;}
331 GradientType getGradientType () const { return maGradientType;}
332
340 void getGraphic ( Graphic& ) const;
341
342 // mutators
344 void setPath ( const tools::PolyPolygon& rPath );
345
346private:
347 // friends
348 VCL_DLLPUBLIC friend SvStream& WriteSvtGraphicFill( SvStream& rOStm, const SvtGraphicFill& rClass );
350
365};
366
367#endif // INCLUDED_VCL_GRAPHICTOOLS_HXX
368
369/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Encapsulates geometry and associated attributes of a filled area.
HatchType
Type of hatching used.
@ hatchDouble
horizontal and vertical orthogonally crossing lines, one unit apart
Color maGradient1stColor
Transform maFillTransform
tools::PolyPolygon maPath
FillRule getFillRule() const
Get fill rule used.
FillRule
Type of fill algorithm used.
GradientType
Type of gradient used.
double getTransparency() const
Get stroke transparency.
Color maGradient2ndColor
sal_Int32 maGradientStepCount
FillType getFillType() const
Get fill type used.
FillType maFillType
bool isTiling() const
Query state of texture tiling.
Graphic maFillGraphic
GradientType maGradientType
GradientType getGradientType() const
Get type of gradient used.
HatchType maHatchType
FillRule maFillRule
const Color & getFillColor() const
Get color used for solid fills.
FillType
Type of filling used.
@ fillHatch
Fill with the specified hatch.
@ fillGradient
Fill with the specified gradient.
Encapsulates geometry and associated attributes of a graphical 'pen stroke'.
double getMiterLimit() const
Get the maximum length of mitered joins.
JoinType getJoinType() const
Get the style in which the stroke segments are joined.
tools::PolyPolygon maEndArrow
CapType
Style for open stroke ends.
@ capRound
Half-round cap at the line end, the center lying at the end point.
double getTransparency() const
Get stroke transparency.
CapType getCapType() const
Get the style in which open stroke ends are drawn.
tools::Polygon maPath
tools::PolyPolygon maStartArrow
double getStrokeWidth() const
Get width of the stroke.
::std::vector< double > DashArray
DashArray maDashArray
JoinType
Style for joins of individual stroke segments.
@ joinBevel
Connect segments by a direct straight line.
@ joinRound
Connect segments by a filled round arc.
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
SvStream & WriteSvtGraphicFill(SvStream &rOStm, const SvtGraphicFill &rClass)
SvStream & ReadSvtGraphicStroke(SvStream &rIStm, SvtGraphicStroke &rClass)
SvStream & ReadSvtGraphicFill(SvStream &rIStm, SvtGraphicFill &rClass)
SvStream & WriteSvtGraphicStroke(SvStream &rOStm, const SvtGraphicStroke &rClass)
double matrix[4][4]
uno::Sequence< double > maFillColor
sal_Int32 scale
Homogeneous 2D transformation matrix.