nss: upgrade to release 3.73
[LibreOffice.git] / include / basegfx / point / b2ipoint.hxx
blob4c0802b572aee51b25a6c062fe803c1072e54568
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #pragma once
22 #include <basegfx/tuple/b2ituple.hxx>
24 namespace basegfx
26 class B2DHomMatrix;
28 /** Base Point class with two sal_Int32 values
30 This class derives all operators and common handling for
31 a 2D data class from B2ITuple. All necessary extensions
32 which are special for points will be added here.
34 @see B2ITuple
36 class SAL_WARN_UNUSED B2IPoint : public ::basegfx::B2ITuple
38 public:
39 /** Create a 2D Point
41 The point is initialized to (0, 0)
43 B2IPoint()
44 : B2ITuple()
47 /** Create a 2D Point
49 @param nX
50 This parameter is used to initialize the X-coordinate
51 of the 2D Point.
53 @param nY
54 This parameter is used to initialize the Y-coordinate
55 of the 2D Point.
57 B2IPoint(sal_Int32 nX, sal_Int32 nY)
58 : B2ITuple(nX, nY)
61 /** constructor with tuple to allow copy-constructing
62 from B2ITuple-based classes
64 B2IPoint(const ::basegfx::B2ITuple& rTuple)
65 : B2ITuple(rTuple)
68 /** *=operator to allow usage from B2IPoint, too
70 B2IPoint& operator*=( const B2IPoint& rPnt )
72 mnX *= rPnt.mnX;
73 mnY *= rPnt.mnY;
74 return *this;
77 /** *=operator to allow usage from B2IPoint, too
79 B2IPoint& operator*=(sal_Int32 t)
81 mnX *= t;
82 mnY *= t;
83 return *this;
86 /** assignment operator to allow assigning the results
87 of B2ITuple calculations
89 B2IPoint& operator=( const ::basegfx::B2ITuple& rPoint );
91 /** Transform point by given transformation matrix.
93 The translational components of the matrix are, in
94 contrast to B2DVector, applied.
96 B2IPoint& operator*=( const ::basegfx::B2DHomMatrix& rMat );
98 } // end of namespace basegfx
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */