xref: /trunk/main/basegfx/inc/basegfx/curve/b2dquadraticbezier.hxx (revision 914d351e5f5b84e4342a86d6ab8d4aca7308b9bd)
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 #include <basegfx/basegfxdllapi.h>
29 
30 //////////////////////////////////////////////////////////////////////////////
31 
32 namespace basegfx
33 {
34     class BASEGFX_DLLPUBLIC B2DQuadraticBezier
35     {
36         ::basegfx::B2DPoint                         maStartPoint;
37         ::basegfx::B2DPoint                         maEndPoint;
38         ::basegfx::B2DPoint                         maControlPoint;
39 
40     public:
41         B2DQuadraticBezier();
42         B2DQuadraticBezier(const B2DQuadraticBezier& rBezier);
43         B2DQuadraticBezier(const ::basegfx::B2DPoint& rStart, const ::basegfx::B2DPoint& rEnd);
44         B2DQuadraticBezier(const ::basegfx::B2DPoint& rStart,
45             const ::basegfx::B2DPoint& rControlPoint, const ::basegfx::B2DPoint& rEnd);
46         ~B2DQuadraticBezier();
47 
48         // assignment operator
49         B2DQuadraticBezier& operator=(const B2DQuadraticBezier& rBezier);
50 
51         // compare operators
52         bool operator==(const B2DQuadraticBezier& rBezier) const;
53         bool operator!=(const B2DQuadraticBezier& rBezier) const;
54 
55         // test if control point is placed on the edge
56         bool isBezier() const;
57 
58         // data interface
getStartPoint() const59         ::basegfx::B2DPoint getStartPoint() const { return maStartPoint; }
setStartPoint(const::basegfx::B2DPoint & rValue)60         void setStartPoint(const ::basegfx::B2DPoint& rValue) { maStartPoint = rValue; }
61 
getEndPoint() const62         ::basegfx::B2DPoint getEndPoint() const { return maEndPoint; }
setEndPoint(const::basegfx::B2DPoint & rValue)63         void setEndPoint(const ::basegfx::B2DPoint& rValue) { maEndPoint = rValue; }
64 
getControlPoint() const65         ::basegfx::B2DPoint getControlPoint() const { return maControlPoint; }
setControlPoint(const::basegfx::B2DPoint & rValue)66         void setControlPoint(const ::basegfx::B2DPoint& rValue) { maControlPoint = rValue; }
67     };
68 } // end of namespace basegfx
69 
70 #endif /* _BGFX_CURVE_B2DQUADRATICBEZIER_HXX */
71