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 _BGFX_CURVE_B2DQUADRATICBEZIER_HXX
25 #define _BGFX_CURVE_B2DQUADRATICBEZIER_HXX
26 
27 #include <basegfx/point/b2dpoint.hxx>
28 
29 //////////////////////////////////////////////////////////////////////////////
30 
31 namespace basegfx
32 {
33 	class B2DQuadraticBezier
34 	{
35 		::basegfx::B2DPoint							maStartPoint;
36 		::basegfx::B2DPoint							maEndPoint;
37 		::basegfx::B2DPoint							maControlPoint;
38 
39 	public:
40 		B2DQuadraticBezier();
41 		B2DQuadraticBezier(const B2DQuadraticBezier& rBezier);
42 		B2DQuadraticBezier(const ::basegfx::B2DPoint& rStart, const ::basegfx::B2DPoint& rEnd);
43 		B2DQuadraticBezier(const ::basegfx::B2DPoint& rStart,
44 			const ::basegfx::B2DPoint& rControlPoint, const ::basegfx::B2DPoint& rEnd);
45 		~B2DQuadraticBezier();
46 
47 		// assignment operator
48 		B2DQuadraticBezier& operator=(const B2DQuadraticBezier& rBezier);
49 
50 		// compare operators
51 		bool operator==(const B2DQuadraticBezier& rBezier) const;
52 		bool operator!=(const B2DQuadraticBezier& rBezier) const;
53 
54 		// test if control point is placed on the edge
55 		bool isBezier() const;
56 
57 		// data interface
getStartPoint() const58 		::basegfx::B2DPoint getStartPoint() const { return maStartPoint; }
setStartPoint(const::basegfx::B2DPoint & rValue)59 		void setStartPoint(const ::basegfx::B2DPoint& rValue) { maStartPoint = rValue; }
60 
getEndPoint() const61 		::basegfx::B2DPoint getEndPoint() const { return maEndPoint; }
setEndPoint(const::basegfx::B2DPoint & rValue)62 		void setEndPoint(const ::basegfx::B2DPoint& rValue) { maEndPoint = rValue; }
63 
getControlPoint() const64 		::basegfx::B2DPoint getControlPoint() const { return maControlPoint; }
setControlPoint(const::basegfx::B2DPoint & rValue)65 		void setControlPoint(const ::basegfx::B2DPoint& rValue) { maControlPoint = rValue; }
66 	};
67 } // end of namespace basegfx
68 
69 #endif /* _BGFX_CURVE_B2DQUADRATICBEZIER_HXX */
70