Update ooo320-m1
[ooovba.git] / filter / source / svg / b2dellipse.cxx
bloba93beb2194e579e7a95f5ce021eb5a4accd141e7
1 /*************************************************************************
3 * OpenOffice.org - a multi-platform office productivity suite
5 * Author:
6 * Fridrich Strba <fridrich.strba@bluewin.ch>
7 * Thorsten Behrens <tbehrens@novell.com>
9 * Copyright (C) 2008, Novell Inc.
11 * The Contents of this file are made available subject to
12 * the terms of GNU Lesser General Public License Version 2.1.
14 ************************************************************************/
16 #include "b2dellipse.hxx"
18 #include <osl/diagnose.h>
20 #include <basegfx/point/b2dpoint.hxx>
22 #include <basegfx/matrix/b2dhommatrix.hxx>
24 #include <rtl/instance.hxx>
26 #include <boost/scoped_ptr.hpp>
27 #include <vector>
28 #include <algorithm>
30 class ImplB2DEllipse
32 basegfx::B2DPoint maCenter;
33 basegfx::B2DTuple maRadius;
35 public:
36 ImplB2DEllipse()
37 : maCenter(0.0f, 0.0f),
38 maRadius(0.0f, 0.0f)
41 ImplB2DEllipse(const ImplB2DEllipse& rToBeCopied)
42 : maCenter(rToBeCopied.maCenter),
43 maRadius(rToBeCopied.maRadius)
46 ImplB2DEllipse& operator=( const ImplB2DEllipse& rToBeCopied )
48 maCenter = rToBeCopied.maCenter;
49 maRadius = rToBeCopied.maRadius;
51 return *this;
54 bool isEqual(const ImplB2DEllipse& rCandidate) const
56 return (maCenter == rCandidate.maCenter)
57 && (maRadius == rCandidate.maRadius);
60 basegfx::B2DPoint getCenter() const
62 return maCenter;
65 void setCenter(const basegfx::B2DPoint& rCenter)
67 maCenter = rCenter;
70 basegfx::B2DTuple getRadius() const
72 return maRadius;
75 void setRadius(const basegfx::B2DTuple& rRadius)
77 maRadius = rRadius;
81 void transform(const basegfx::B2DHomMatrix& /* rMatrix */)
86 //////////////////////////////////////////////////////////////////////////////
88 namespace basegfx
91 B2DEllipse::B2DEllipse()
94 B2DEllipse::B2DEllipse(const basegfx::B2DPoint& rCenter, const basegfx::B2DTuple& rRadius)
95 : maCenter(rCenter), maRadius(rRadius)
99 B2DEllipse::~B2DEllipse()
103 bool B2DEllipse::operator==(const B2DEllipse& rEllipse) const
105 return (maCenter == rEllipse.maCenter) && (maRadius == rEllipse.maRadius);
108 bool B2DEllipse::operator!=(const B2DEllipse& rEllipse) const
110 return !(*this == rEllipse);
113 basegfx::B2DPoint B2DEllipse::getB2DEllipseCenter() const
115 return maCenter;
118 void B2DEllipse::setB2DEllipseCenter(const basegfx::B2DPoint& rCenter)
120 maCenter = rCenter;
123 basegfx::B2DTuple B2DEllipse::getB2DEllipseRadius() const
125 return maRadius;
128 void B2DEllipse::setB2DEllipseRadius(const basegfx::B2DTuple& rRadius)
130 maRadius = rRadius;
133 void B2DEllipse::transform(const basegfx::B2DHomMatrix& /* rMatrix */)
136 } // end of namespace basegfx
138 //////////////////////////////////////////////////////////////////////////////
139 // eof