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