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_SDR_PRIMITIVE2D_SDRELLIPSEPRIMITIVE2D_HXX 25 #define INCLUDED_SDR_PRIMITIVE2D_SDRELLIPSEPRIMITIVE2D_HXX 26 27 #include <drawinglayer/primitive2d/baseprimitive2d.hxx> 28 #include <basegfx/matrix/b2dhommatrix.hxx> 29 #include <svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx> 30 31 ////////////////////////////////////////////////////////////////////////////// 32 // predefines 33 34 ////////////////////////////////////////////////////////////////////////////// 35 36 namespace drawinglayer 37 { 38 namespace primitive2d 39 { 40 class SdrEllipsePrimitive2D : public BufferedDecompositionPrimitive2D 41 { 42 private: 43 ::basegfx::B2DHomMatrix maTransform; 44 attribute::SdrLineFillShadowTextAttribute maSdrLFSTAttribute; 45 46 protected: 47 // local decomposition. 48 virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; 49 50 public: 51 SdrEllipsePrimitive2D( 52 const ::basegfx::B2DHomMatrix& rTransform, 53 const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute); 54 55 // data access getTransform() const56 const ::basegfx::B2DHomMatrix& getTransform() const { return maTransform; } getSdrLFSTAttribute() const57 const attribute::SdrLineFillShadowTextAttribute& getSdrLFSTAttribute() const { return maSdrLFSTAttribute; } 58 59 // compare operator 60 virtual bool operator==(const BasePrimitive2D& rPrimitive) const; 61 62 // provide unique ID 63 DeclPrimitrive2DIDBlock() 64 }; 65 } // end of namespace primitive2d 66 } // end of namespace drawinglayer 67 68 ////////////////////////////////////////////////////////////////////////////// 69 70 namespace drawinglayer 71 { 72 namespace primitive2d 73 { 74 class SdrEllipseSegmentPrimitive2D : public SdrEllipsePrimitive2D 75 { 76 private: 77 double mfStartAngle; 78 double mfEndAngle; 79 80 // bitfield 81 unsigned mbCloseSegment : 1; 82 unsigned mbCloseUsingCenter : 1; 83 84 protected: 85 // local decomposition. 86 virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; 87 88 public: 89 SdrEllipseSegmentPrimitive2D( 90 const ::basegfx::B2DHomMatrix& rTransform, 91 const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute, 92 double fStartAngle, 93 double fEndAngle, 94 bool bCloseSegment, 95 bool bCloseUsingCenter); 96 97 // data access getStartAngle() const98 double getStartAngle() const { return mfStartAngle; } getEndAngle() const99 double getEndAngle() const { return mfEndAngle; } getCloseSegment() const100 bool getCloseSegment() const { return mbCloseSegment; } getCloseUsingCenter() const101 bool getCloseUsingCenter() const { return mbCloseUsingCenter; } 102 103 // compare operator 104 virtual bool operator==(const BasePrimitive2D& rPrimitive) const; 105 106 // provide unique ID 107 DeclPrimitrive2DIDBlock() 108 }; 109 } // end of namespace primitive2d 110 } // end of namespace drawinglayer 111 112 ////////////////////////////////////////////////////////////////////////////// 113 114 #endif //INCLUDED_SDR_PRIMITIVE2D_SDRELLIPSEPRIMITIVE2D_HXX 115 116 // eof 117