/src/libreoffice/include/drawinglayer/primitive3d/sdrprimitive3d.hxx
Line | Count | Source |
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 | | |
22 | | #include <drawinglayer/drawinglayerdllapi.h> |
23 | | |
24 | | #include <drawinglayer/primitive3d/baseprimitive3d.hxx> |
25 | | #include <basegfx/matrix/b3dhommatrix.hxx> |
26 | | #include <basegfx/vector/b2dvector.hxx> |
27 | | #include <drawinglayer/attribute/sdrallattribute3d.hxx> |
28 | | #include <drawinglayer/primitive3d/sdrextrudelathetools3d.hxx> |
29 | | #include <drawinglayer/attribute/sdrobjectattribute3d.hxx> |
30 | | |
31 | | |
32 | | namespace drawinglayer |
33 | | { |
34 | | /** SdrPrimitive3D class |
35 | | |
36 | | Base class for the more complicated geometric primitives, so |
37 | | derive from buffered primitive to allow overriding of |
38 | | create3DDecomposition there. |
39 | | */ |
40 | | namespace primitive3d |
41 | | { |
42 | | class DRAWINGLAYER_DLLPUBLIC SdrPrimitive3D : public BufferedDecompositionPrimitive3D |
43 | | { |
44 | | private: |
45 | | /// object surface attributes |
46 | | basegfx::B3DHomMatrix maTransform; |
47 | | basegfx::B2DVector maTextureSize; |
48 | | attribute::SdrLineFillShadowAttribute3D maSdrLFSAttribute; |
49 | | attribute::Sdr3DObjectAttribute maSdr3DObjectAttribute; |
50 | | |
51 | | protected: |
52 | | /** Standard implementation for primitive3D which |
53 | | will use maTransform as range and expand by evtl. line width / 2 |
54 | | */ |
55 | | basegfx::B3DRange getStandard3DRange() const; |
56 | | |
57 | | /** implementation for primitive3D which |
58 | | will use given Slice3Ds and expand by evtl. line width / 2 |
59 | | */ |
60 | | basegfx::B3DRange get3DRangeFromSlices(const Slice3DVector& rSlices) const; |
61 | | |
62 | | public: |
63 | | /// constructor |
64 | | SdrPrimitive3D( |
65 | | basegfx::B3DHomMatrix aTransform, |
66 | | const basegfx::B2DVector& rTextureSize, |
67 | | attribute::SdrLineFillShadowAttribute3D aSdrLFSAttribute, |
68 | | const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute); |
69 | | |
70 | | /// data read access |
71 | 0 | const basegfx::B3DHomMatrix& getTransform() const { return maTransform; } |
72 | 0 | const basegfx::B2DVector& getTextureSize() const { return maTextureSize; } |
73 | 0 | const attribute::SdrLineFillShadowAttribute3D& getSdrLFSAttribute() const { return maSdrLFSAttribute; } |
74 | 0 | const attribute::Sdr3DObjectAttribute& getSdr3DObjectAttribute() const { return maSdr3DObjectAttribute; } |
75 | | |
76 | | /// compare operator |
77 | | virtual bool operator==(const BasePrimitive3D& rPrimitive) const override; |
78 | | }; |
79 | | } // end of namespace primitive3d |
80 | | } // end of namespace drawinglayer |
81 | | |
82 | | |
83 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |