bump product version to 6.3.0.0.beta1
[LibreOffice.git] / include / basegfx / polygon / b2dpolygontriangulator.hxx
blob40bd8117e4236695e80c736d8e7f94a46a27da1b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #ifndef INCLUDED_BASEGFX_POLYGON_B2DPOLYGONTRIANGULATOR_HXX
21 #define INCLUDED_BASEGFX_POLYGON_B2DPOLYGONTRIANGULATOR_HXX
23 #include <basegfx/polygon/b2dpolygon.hxx>
24 #include <basegfx/point/b2dpoint.hxx>
25 #include <basegfx/basegfxdllapi.h>
27 #include <vector>
29 namespace basegfx { class B2DPolyPolygon; }
31 namespace basegfx
33 namespace triangulator
35 // Simple B2D-based triangle. Main reason is to
36 // keep the data types separated (before a B2DPolygon
37 // was used with the convention that three points in
38 // a row define a triangle)
39 class BASEGFX_DLLPUBLIC B2DTriangle
41 // positions
42 basegfx::B2DPoint maA;
43 basegfx::B2DPoint maB;
44 basegfx::B2DPoint maC;
46 public:
47 B2DTriangle(
48 const basegfx::B2DPoint& rA,
49 const basegfx::B2DPoint& rB,
50 const basegfx::B2DPoint& rC)
51 : maA(rA),
52 maB(rB),
53 maC(rC)
57 // get positions
58 const basegfx::B2DPoint& getA() const { return maA; }
59 const basegfx::B2DPoint& getB() const { return maB; }
60 const basegfx::B2DPoint& getC() const { return maC; }
63 // typedef for a vector of B2DTriangle
64 typedef ::std::vector< B2DTriangle > B2DTriangleVector;
66 // triangulate given polygon
67 BASEGFX_DLLPUBLIC B2DTriangleVector triangulate(const ::basegfx::B2DPolygon& rCandidate);
69 // triangulate given PolyPolygon
70 BASEGFX_DLLPUBLIC B2DTriangleVector triangulate(const ::basegfx::B2DPolyPolygon& rCandidate);
72 } // end of namespace triangulator
73 } // end of namespace basegfx
75 #endif // INCLUDED_BASEGFX_POLYGON_B2DPOLYGONTRIANGULATOR_HXX
77 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */