1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRPRIMITIVE3D_HXX 25 #define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRPRIMITIVE3D_HXX 26 27 #include <drawinglayer/drawinglayerdllapi.h> 28 #include <drawinglayer/primitive3d/baseprimitive3d.hxx> 29 #include <basegfx/matrix/b3dhommatrix.hxx> 30 #include <basegfx/vector/b2dvector.hxx> 31 #include <drawinglayer/attribute/sdrallattribute3d.hxx> 32 #include <drawinglayer/primitive3d/sdrextrudelathetools3d.hxx> 33 #include <drawinglayer/attribute/sdrobjectattribute3d.hxx> 34 35 ////////////////////////////////////////////////////////////////////////////// 36 37 namespace drawinglayer 38 { 39 /** SdrPrimitive3D class 40 41 Base class for the more complicated geometric primitives, so 42 derive from buffered primitive to allow overloading of 43 create3DDecomposition there. 44 */ 45 namespace primitive3d 46 { 47 class DRAWINGLAYER_DLLPUBLIC SdrPrimitive3D : public BufferedDecompositionPrimitive3D 48 { 49 private: 50 /// object surface attributes 51 basegfx::B3DHomMatrix maTransform; 52 basegfx::B2DVector maTextureSize; 53 attribute::SdrLineFillShadowAttribute3D maSdrLFSAttribute; 54 attribute::Sdr3DObjectAttribute maSdr3DObjectAttribute; 55 56 protected: 57 /** Standard implementation for primitive3D which 58 will use maTransform as range and expand by evtl. line width / 2 59 */ 60 basegfx::B3DRange getStandard3DRange() const; 61 62 /** implementation for primitive3D which 63 will use given Slice3Ds and expand by evtl. line width / 2 64 */ 65 basegfx::B3DRange get3DRangeFromSlices(const Slice3DVector& rSlices) const; 66 67 public: 68 /// constructor 69 SdrPrimitive3D( 70 const basegfx::B3DHomMatrix& rTransform, 71 const basegfx::B2DVector& rTextureSize, 72 const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute, 73 const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute); 74 75 /// data read access getTransform() const76 const basegfx::B3DHomMatrix& getTransform() const { return maTransform; } getTextureSize() const77 const basegfx::B2DVector& getTextureSize() const { return maTextureSize; } getSdrLFSAttribute() const78 const attribute::SdrLineFillShadowAttribute3D& getSdrLFSAttribute() const { return maSdrLFSAttribute; } getSdr3DObjectAttribute() const79 const attribute::Sdr3DObjectAttribute getSdr3DObjectAttribute() const { return maSdr3DObjectAttribute; } 80 81 /// compare operator 82 virtual bool operator==(const BasePrimitive3D& rPrimitive) const; 83 }; 84 } // end of namespace primitive3d 85 } // end of namespace drawinglayer 86 87 ////////////////////////////////////////////////////////////////////////////// 88 89 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRPRIMITIVE3D_HXX 90 91 ////////////////////////////////////////////////////////////////////////////// 92 // eof 93