1 /*************************************************************************
3 * OpenOffice.org - a multi-platform office productivity suite
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>
32 basegfx::B2DPoint maCenter
;
33 basegfx::B2DTuple maRadius
;
37 : maCenter(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
;
54 bool isEqual(const ImplB2DEllipse
& rCandidate
) const
56 return (maCenter
== rCandidate
.maCenter
)
57 && (maRadius
== rCandidate
.maRadius
);
60 basegfx::B2DPoint
getCenter() const
65 void setCenter(const basegfx::B2DPoint
& rCenter
)
70 basegfx::B2DTuple
getRadius() const
75 void setRadius(const basegfx::B2DTuple
& rRadius
)
81 void transform(const basegfx::B2DHomMatrix
& /* rMatrix */)
86 //////////////////////////////////////////////////////////////////////////////
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
118 void B2DEllipse::setB2DEllipseCenter(const basegfx::B2DPoint
& rCenter
)
123 basegfx::B2DTuple
B2DEllipse::getB2DEllipseRadius() const
128 void B2DEllipse::setB2DEllipseRadius(const basegfx::B2DTuple
& rRadius
)
133 void B2DEllipse::transform(const basegfx::B2DHomMatrix
& /* rMatrix */)
136 } // end of namespace basegfx
138 //////////////////////////////////////////////////////////////////////////////