bump product version to 4.1.6.2
[LibreOffice.git] / include / drawinglayer / primitive3d / sdrextrudelathetools3d.hxx
blobd741b4c1b2236ac921556ad41546937f261b6426
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>
29 //////////////////////////////////////////////////////////////////////////////
30 // predefines
32 namespace drawinglayer { namespace geometry {
33 class ViewInformation3D;
36 //////////////////////////////////////////////////////////////////////////////
38 namespace drawinglayer
40 namespace primitive3d
42 /** SliceType3D definition */
43 enum SliceType3D
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
53 protected:
54 basegfx::B3DPolyPolygon maPolyPolygon;
55 SliceType3D maSliceType;
57 public:
58 Slice3D(
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);
68 explicit Slice3D(
69 const basegfx::B3DPolyPolygon& rPolyPolygon,
70 SliceType3D aSliceType = SLICETYPE3D_REGULAR)
71 : maPolyPolygon(rPolyPolygon),
72 maSliceType(aSliceType)
76 // data access
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,
88 double fBackScale,
89 double fDiagonal,
90 double fRotation,
91 sal_uInt32 nSteps,
92 bool bCharacterMode,
93 bool bCloseFront,
94 bool bCloseBack);
96 void DRAWINGLAYER_DLLPUBLIC createExtrudeSlices(
97 Slice3DVector& rSliceVector,
98 const basegfx::B2DPolyPolygon& rSource,
99 double fBackScale,
100 double fDiagonal,
101 double fDepth,
102 bool bCharacterMode,
103 bool bCloseFront,
104 bool bCloseBack);
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,
113 bool bCreateNormals,
114 bool bSmoothHorizontalNormals,
115 bool bSmoothNormals,
116 bool bSmoothLids,
117 bool bClosed,
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: */