nss: upgrade to release 3.73
[LibreOffice.git] / include / drawinglayer / primitive3d / sdrextrudelathetools3d.hxx
blob4caa0c819631e85a903c4fdb8de2030d89eafe2e
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_DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDELATHETOOLS3D_HXX
21 #define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDELATHETOOLS3D_HXX
23 #include <drawinglayer/drawinglayerdllapi.h>
25 #include <basegfx/polygon/b3dpolypolygon.hxx>
26 #include <basegfx/polygon/b2dpolypolygontools.hxx>
27 #include <vector>
30 // predefines
32 namespace drawinglayer::geometry {
33 class ViewInformation3D;
37 namespace drawinglayer::primitive3d
39 /** SliceType3D definition */
40 enum SliceType3D
42 SLICETYPE3D_REGULAR, // normal geometry Slice3D
43 SLICETYPE3D_FRONTCAP, // front cap
44 SLICETYPE3D_BACKCAP // back cap
47 /// class to hold one Slice3D
48 class DRAWINGLAYER_DLLPUBLIC Slice3D final
50 basegfx::B3DPolyPolygon maPolyPolygon;
51 SliceType3D maSliceType;
53 public:
54 Slice3D(
55 const basegfx::B2DPolyPolygon& rPolyPolygon,
56 const basegfx::B3DHomMatrix& aTransform,
57 SliceType3D aSliceType = SLICETYPE3D_REGULAR)
58 : maPolyPolygon(basegfx::utils::createB3DPolyPolygonFromB2DPolyPolygon(rPolyPolygon)),
59 maSliceType(aSliceType)
61 maPolyPolygon.transform(aTransform);
64 // data access
65 const basegfx::B3DPolyPolygon& getB3DPolyPolygon() const { return maPolyPolygon; }
66 SliceType3D getSliceType() const { return maSliceType; }
69 /// typedef for a group of Slice3Ds
70 typedef ::std::vector< Slice3D > Slice3DVector;
72 /// helpers for creation
73 void DRAWINGLAYER_DLLPUBLIC createLatheSlices(
74 Slice3DVector& rSliceVector,
75 const basegfx::B2DPolyPolygon& rSource,
76 double fBackScale,
77 double fDiagonal,
78 double fRotation,
79 sal_uInt32 nSteps,
80 bool bCharacterMode,
81 bool bCloseFront,
82 bool bCloseBack);
84 void DRAWINGLAYER_DLLPUBLIC createExtrudeSlices(
85 Slice3DVector& rSliceVector,
86 const basegfx::B2DPolyPolygon& rSource,
87 double fBackScale,
88 double fDiagonal,
89 double fDepth,
90 bool bCharacterMode,
91 bool bCloseFront,
92 bool bCloseBack);
94 /// helpers for geometry extraction
95 basegfx::B3DPolyPolygon DRAWINGLAYER_DLLPUBLIC extractHorizontalLinesFromSlice(const Slice3DVector& rSliceVector, bool bCloseHorLines);
96 basegfx::B3DPolyPolygon DRAWINGLAYER_DLLPUBLIC extractVerticalLinesFromSlice(const Slice3DVector& rSliceVector);
98 void DRAWINGLAYER_DLLPUBLIC extractPlanesFromSlice(
99 ::std::vector< basegfx::B3DPolyPolygon >& rFill,
100 const Slice3DVector& rSliceVector,
101 bool bCreateNormals,
102 bool bSmoothNormals,
103 bool bSmoothLids,
104 bool bClosed,
105 double fSmoothNormalsMix,
106 double fSmoothLidsMix,
107 bool bCreateTextureCoordinates,
108 const basegfx::B2DHomMatrix& rTexTransform);
110 void DRAWINGLAYER_DLLPUBLIC createReducedOutlines(
111 const geometry::ViewInformation3D& rViewInformation,
112 const basegfx::B3DHomMatrix& rObjectTransform,
113 const basegfx::B3DPolygon& rLoopA,
114 const basegfx::B3DPolygon& rLoopB,
115 basegfx::B3DPolyPolygon& rTarget);
117 } // end of namespace drawinglayer::overlay
120 #endif //_DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDELATHETOOLS3D_HXX
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */