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 .
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>
29 //////////////////////////////////////////////////////////////////////////////
32 namespace drawinglayer
{ namespace geometry
{
33 class ViewInformation3D
;
36 //////////////////////////////////////////////////////////////////////////////
38 namespace drawinglayer
42 /** SliceType3D definition */
45 SLICETYPE3D_REGULAR
, // normal geoemtry Slice3D
46 SLICETYPE3D_FRONTCAP
, // front cap
47 SLICETYPE3D_BACKCAP
// back cap
50 /// class to hold one Slice3D
51 class DRAWINGLAYER_DLLPUBLIC Slice3D
54 basegfx::B3DPolyPolygon maPolyPolygon
;
55 SliceType3D maSliceType
;
59 const basegfx::B2DPolyPolygon
& rPolyPolygon
,
60 const basegfx::B3DHomMatrix
& aTransform
,
61 SliceType3D aSliceType
= SLICETYPE3D_REGULAR
)
62 : maPolyPolygon(basegfx::tools::createB3DPolyPolygonFromB2DPolyPolygon(rPolyPolygon
)),
63 maSliceType(aSliceType
)
65 maPolyPolygon
.transform(aTransform
);
69 const basegfx::B3DPolyPolygon
& rPolyPolygon
,
70 SliceType3D aSliceType
= SLICETYPE3D_REGULAR
)
71 : maPolyPolygon(rPolyPolygon
),
72 maSliceType(aSliceType
)
77 const basegfx::B3DPolyPolygon
& getB3DPolyPolygon() const { return maPolyPolygon
; }
78 SliceType3D
getSliceType() const { return maSliceType
; }
81 /// typedef for a group of Slice3Ds
82 typedef ::std::vector
< Slice3D
> Slice3DVector
;
84 /// helpers for creation
85 void DRAWINGLAYER_DLLPUBLIC
createLatheSlices(
86 Slice3DVector
& rSliceVector
,
87 const basegfx::B2DPolyPolygon
& rSource
,
96 void DRAWINGLAYER_DLLPUBLIC
createExtrudeSlices(
97 Slice3DVector
& rSliceVector
,
98 const basegfx::B2DPolyPolygon
& rSource
,
106 /// helpers for geometry extraction
107 basegfx::B3DPolyPolygon DRAWINGLAYER_DLLPUBLIC
extractHorizontalLinesFromSlice(const Slice3DVector
& rSliceVector
, bool bCloseHorLines
);
108 basegfx::B3DPolyPolygon DRAWINGLAYER_DLLPUBLIC
extractVerticalLinesFromSlice(const Slice3DVector
& rSliceVector
);
110 void DRAWINGLAYER_DLLPUBLIC
extractPlanesFromSlice(
111 ::std::vector
< basegfx::B3DPolyPolygon
>& rFill
,
112 const Slice3DVector
& rSliceVector
,
114 bool bSmoothHorizontalNormals
,
118 double fSmoothNormalsMix
,
119 double fSmoothLidsMix
,
120 bool bCreateTextureCoordinates
,
121 const basegfx::B2DHomMatrix
& rTexTransform
);
123 void DRAWINGLAYER_DLLPUBLIC
createReducedOutlines(
124 const geometry::ViewInformation3D
& rViewInformation
,
125 const basegfx::B3DHomMatrix
& rObjectTransform
,
126 const basegfx::B3DPolygon
& rLoopA
,
127 const basegfx::B3DPolygon
& rLoopB
,
128 basegfx::B3DPolyPolygon
& rTarget
);
130 } // end of namespace overlay
131 } // end of namespace drawinglayer
133 //////////////////////////////////////////////////////////////////////////////
135 #endif //_DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDELATHETOOLS3D_HXX
137 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */