nss: upgrade to release 3.73
[LibreOffice.git] / drawinglayer / inc / primitive3d / polygontubeprimitive3d.hxx
blob38372977e1c4dbf046fcf7f9216708f48c99f54a
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 #pragma once
22 #include <drawinglayer/primitive3d/polygonprimitive3d.hxx>
25 namespace drawinglayer::primitive3d
27 /** PolygonStrokePrimitive3D class
29 This 3D primitive extends a 3D hairline to a 3D tube which is
30 e.g. used for fat lines in 3D. It's decomposition will create all
31 3D objects needed for the line tubes and the edge roundings
32 in full 3D.
34 class PolygonTubePrimitive3D final : public PolygonHairlinePrimitive3D
36 /// hold the last decomposition since it's expensive
37 Primitive3DContainer maLast3DDecomposition;
39 /// visualisation parameters
40 double mfRadius;
41 double mfDegreeStepWidth;
42 double mfMiterMinimumAngle;
43 basegfx::B2DLineJoin maLineJoin;
44 css::drawing::LineCap maLineCap;
46 /** access methods to maLast3DDecomposition. The usage of this methods may allow
47 later thread-safe stuff to be added if needed. Only to be used by getDecomposition()
48 implementations for buffering the last decomposition.
50 const Primitive3DContainer& getLast3DDecomposition() const { return maLast3DDecomposition; }
52 /// local decomposition.
53 Primitive3DContainer impCreate3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
55 public:
56 /// constructor
57 PolygonTubePrimitive3D(
58 const basegfx::B3DPolygon& rPolygon,
59 const basegfx::BColor& rBColor,
60 double fRadius,
61 basegfx::B2DLineJoin aLineJoin,
62 css::drawing::LineCap aLineCap,
63 double fDegreeStepWidth = basegfx::deg2rad(10.0),
64 double fMiterMinimumAngle = basegfx::deg2rad(15.0));
66 /// data read access
67 double getRadius() const { return mfRadius; }
68 double getDegreeStepWidth() const { return mfDegreeStepWidth; }
69 double getMiterMinimumAngle() const { return mfMiterMinimumAngle; }
70 basegfx::B2DLineJoin getLineJoin() const { return maLineJoin; }
71 css::drawing::LineCap getLineCap() const { return maLineCap; }
73 /// compare operator
74 virtual bool operator==(const BasePrimitive3D& rPrimitive) const override;
76 /** local decomposition. Use own buffering since we are not derived from
77 BufferedDecompositionPrimitive3D
79 virtual Primitive3DContainer get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const override;
81 /// provide unique ID
82 DeclPrimitive3DIDBlock()
85 } // end of namespace drawinglayer::primitive3d
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */