1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
22 #include <basegfx/polygon/b2dpolygon.hxx>
23 #include <basegfx/point/b2dpoint.hxx>
24 #include <basegfx/basegfxdllapi.h>
28 namespace basegfx
{ class B2DPolyPolygon
; }
30 namespace basegfx::triangulator
32 // Simple B2D-based triangle. Main reason is to
33 // keep the data types separated (before a B2DPolygon
34 // was used with the convention that three points in
35 // a row define a triangle)
36 class BASEGFX_DLLPUBLIC B2DTriangle
39 basegfx::B2DPoint maA
;
40 basegfx::B2DPoint maB
;
41 basegfx::B2DPoint maC
;
45 const basegfx::B2DPoint
& rA
,
46 const basegfx::B2DPoint
& rB
,
47 const basegfx::B2DPoint
& rC
)
55 const basegfx::B2DPoint
& getA() const { return maA
; }
56 const basegfx::B2DPoint
& getB() const { return maB
; }
57 const basegfx::B2DPoint
& getC() const { return maC
; }
60 // typedef for a vector of B2DTriangle
61 typedef ::std::vector
< B2DTriangle
> B2DTriangleVector
;
63 // triangulate given polygon
64 BASEGFX_DLLPUBLIC B2DTriangleVector
triangulate(const ::basegfx::B2DPolygon
& rCandidate
);
66 // triangulate given PolyPolygon
67 BASEGFX_DLLPUBLIC B2DTriangleVector
triangulate(const ::basegfx::B2DPolyPolygon
& rCandidate
);
69 } // end of namespace basegfx::triangulator
71 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */