LibreOffice Module basegfx (master) 1
b2dpolygontriangulator.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#pragma once
21
25
26#include <vector>
27
28namespace basegfx { class B2DPolyPolygon; }
29
31{
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)
37 {
38 // positions
42
43 public:
45 const basegfx::B2DPoint& rA,
46 const basegfx::B2DPoint& rB,
47 const basegfx::B2DPoint& rC)
48 : maA(rA),
49 maB(rB),
50 maC(rC)
51 {
52 }
53
54 // get positions
55 const basegfx::B2DPoint& getA() const { return maA; }
56 const basegfx::B2DPoint& getB() const { return maB; }
57 const basegfx::B2DPoint& getC() const { return maC; }
58 };
59
60 // typedef for a vector of B2DTriangle
61 typedef ::std::vector< B2DTriangle > B2DTriangleVector;
62
63 // triangulate given polygon
64 BASEGFX_DLLPUBLIC B2DTriangleVector triangulate(const ::basegfx::B2DPolygon& rCandidate);
65
66 // triangulate given PolyPolygon
67 BASEGFX_DLLPUBLIC B2DTriangleVector triangulate(const ::basegfx::B2DPolyPolygon& rCandidate);
68
69} // end of namespace basegfx::triangulator
70
71/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define BASEGFX_DLLPUBLIC
Definition: basegfxdllapi.h:35
Base Point class with two double values.
Definition: b2dpoint.hxx:42
const basegfx::B2DPoint & getA() const
const basegfx::B2DPoint & getB() const
B2DTriangle(const basegfx::B2DPoint &rA, const basegfx::B2DPoint &rB, const basegfx::B2DPoint &rC)
const basegfx::B2DPoint & getC() const
::std::vector< B2DTriangle > B2DTriangleVector
B2DTriangleVector triangulate(const B2DPolygon &rCandidate)