xref: /trunk/main/basegfx/source/vector/b3ivector.cxx (revision 18e39f1b61b4f1cbad5dde1ff548849e2cddffe7)
109dbbe93SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
309dbbe93SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
409dbbe93SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
509dbbe93SAndrew Rist  * distributed with this work for additional information
609dbbe93SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
709dbbe93SAndrew Rist  * to you under the Apache License, Version 2.0 (the
809dbbe93SAndrew Rist  * "License"); you may not use this file except in compliance
909dbbe93SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
1109dbbe93SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
1309dbbe93SAndrew Rist  * Unless required by applicable law or agreed to in writing,
1409dbbe93SAndrew Rist  * software distributed under the License is distributed on an
1509dbbe93SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1609dbbe93SAndrew Rist  * KIND, either express or implied.  See the License for the
1709dbbe93SAndrew Rist  * specific language governing permissions and limitations
1809dbbe93SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
2009dbbe93SAndrew Rist  *************************************************************/
2109dbbe93SAndrew Rist 
22cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
23cdf0e10cSrcweir #include "precompiled_basegfx.hxx"
24cdf0e10cSrcweir #include <basegfx/vector/b3ivector.hxx>
25cdf0e10cSrcweir #include <basegfx/matrix/b3dhommatrix.hxx>
26cdf0e10cSrcweir 
27cdf0e10cSrcweir namespace basegfx
28cdf0e10cSrcweir {
operator *=(const B3DHomMatrix & rMat)29cdf0e10cSrcweir     B3IVector& B3IVector::operator*=( const B3DHomMatrix& rMat )
30cdf0e10cSrcweir     {
31cdf0e10cSrcweir         mnX = fround( rMat.get(0,0)*mnX + rMat.get(0,1)*mnY + rMat.get(0,2)*mnZ );
32cdf0e10cSrcweir         mnY = fround( rMat.get(1,0)*mnX + rMat.get(1,1)*mnY + rMat.get(1,2)*mnZ );
33cdf0e10cSrcweir         mnZ = fround( rMat.get(2,0)*mnX + rMat.get(2,1)*mnY + rMat.get(2,2)*mnZ );
34cdf0e10cSrcweir 
35cdf0e10cSrcweir         return *this;
36cdf0e10cSrcweir     }
37cdf0e10cSrcweir 
operator *(const B3DHomMatrix & rMat,const B3IVector & rVec)38cdf0e10cSrcweir     B3IVector operator*( const B3DHomMatrix& rMat, const B3IVector& rVec )
39cdf0e10cSrcweir     {
40cdf0e10cSrcweir         B3IVector aRes( rVec );
41cdf0e10cSrcweir         return aRes*=rMat;
42cdf0e10cSrcweir     }
43cdf0e10cSrcweir } // end of namespace basegfx
44cdf0e10cSrcweir 
45*18e39f1bSmseidel /* vim: set noet sw=4 ts=4: */
46