/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ #ifndef INCLUDED_TOOLS_POLY_HXX #define INCLUDED_TOOLS_POLY_HXX
enumclass PolyFlags : sal_uInt8
{
Normal, // start-/endpoint of a curve or a line
Smooth, // smooth transition between curves
Control, // control handles of a Bezier curve
Symmetric // smooth and symmetrical transition between curves
};
class SvStream; class ImplPolygon; struct ImplPolyPolygon;
namespace basegfx
{ class B2DPolygon; class B2DPolyPolygon;
}
This method adaptively subdivides bezier arcs within the polygon to straight line segments and returns the resulting polygon.
@param rResult The resulting subdivided polygon
@param d This parameter controls the amount of subdivision. The original curve is guaranteed to not differ by more than this amount per bezier segment from the subdivided lines. Concretely, if the polygon is in device coordinates and d equals 1.0, then the difference between the subdivided and the original polygon is guaranteed to be smaller than one pixel.
*/ void AdaptiveSubdivide( tools::Polygon& rResult, constdouble d = 1.0 ) const; static Polygon SubdivideBezier( const Polygon& rPoly );
// streaming a Polygon does ignore PolyFlags, so use the Write Or Read // method to take care of PolyFlags
TOOLS_DLLPUBLIC friend SvStream& ReadPolygon( SvStream& rIStream, tools::Polygon& rPoly );
TOOLS_DLLPUBLIC friend SvStream& WritePolygon( SvStream& rOStream, const tools::Polygon& rPoly );
This method adaptively subdivides bezier arcs within the polygon to straight line segments and returns the resulting polygon.
@param rResult The resulting subdivided polygon
If the polygon is in device coordinates, then the difference between the subdivided and the original polygon is guaranteed to be smaller than one pixel.
*/ void AdaptiveSubdivide( tools::PolyPolygon& rResult ) const; static tools::PolyPolygon SubdivideBezier( const tools::PolyPolygon& rPolyPoly );
// convert to ::basegfx::B2DPolyPolygon and return
::basegfx::B2DPolyPolygon getB2DPolyPolygon() const;
// constructor to convert from ::basegfx::B2DPolyPolygon // #i76339# made explicit explicit PolyPolygon(const ::basegfx::B2DPolyPolygon& rPolyPolygon);
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 ist noch experimentell.