summaryrefslogtreecommitdiff
path: root/basegfx/source/point
diff options
context:
space:
mode:
authorThorsten Behrens <thb@openoffice.org>2004-01-16 09:39:11 +0000
committerThorsten Behrens <thb@openoffice.org>2004-01-16 09:39:11 +0000
commite1ee37accf3973cae1c373a6be84273d96401c39 (patch)
treec69076ac2ad6a84ddc62c452913f1692ffd8834c /basegfx/source/point
parentfb6fefbd9482f6fa26447be417286ae1935c0702 (diff)
Initial revision
Diffstat (limited to 'basegfx/source/point')
-rw-r--r--basegfx/source/point/b2ipoint.cxx96
-rw-r--r--basegfx/source/point/b3ipoint.cxx93
2 files changed, 189 insertions, 0 deletions
diff --git a/basegfx/source/point/b2ipoint.cxx b/basegfx/source/point/b2ipoint.cxx
new file mode 100644
index 000000000000..9451aeb0b818
--- /dev/null
+++ b/basegfx/source/point/b2ipoint.cxx
@@ -0,0 +1,96 @@
+/*************************************************************************
+ *
+ * $RCSfile: b2ipoint.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: thb $ $Date: 2004-01-16 10:36:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _BGFX_POINT_B2IPOINT_HXX
+#include <basegfx/point/b2ipoint.hxx>
+#endif
+
+#ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#endif
+
+#include <basegfx/numeric/ftools.hxx>
+
+
+namespace basegfx
+{
+ B2IPoint& B2IPoint::operator=( const ::basegfx::B2ITuple& rPoint )
+ {
+ mnX = rPoint.getX();
+ mnY = rPoint.getY();
+ return *this;
+ }
+
+ B2IPoint& B2IPoint::operator*=( const ::basegfx::B2DHomMatrix& rMat )
+ {
+ mnX = fround( rMat.get(0,0)*mnX +
+ rMat.get(0,1)*mnY +
+ rMat.get(0,2) );
+
+ mnY = fround( rMat.get(1,0)*mnX +
+ rMat.get(1,1)*mnY +
+ rMat.get(1,2) );
+
+ return *this;
+ }
+} // end of namespace basegfx
+
+// eof
diff --git a/basegfx/source/point/b3ipoint.cxx b/basegfx/source/point/b3ipoint.cxx
new file mode 100644
index 000000000000..1ed45b79f546
--- /dev/null
+++ b/basegfx/source/point/b3ipoint.cxx
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * $RCSfile: b3ipoint.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: thb $ $Date: 2004-01-16 10:36:23 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _BGFX_POINT_B3IPOINT_HXX
+#include <basegfx/point/b3ipoint.hxx>
+#endif
+
+#ifndef _BGFX_MATRIX_B3DHOMMATRIX_HXX
+#include <basegfx/matrix/b3dhommatrix.hxx>
+#endif
+
+#include <basegfx/numeric/ftools.hxx>
+
+namespace basegfx
+{
+ B3IPoint& B3IPoint::operator*=( const ::basegfx::B3DHomMatrix& rMat )
+ {
+ mnX = fround(rMat.get(0,0)*mnX +
+ rMat.get(0,1)*mnY +
+ rMat.get(0,2)*mnZ +
+ rMat.get(0,3));
+ mnY = fround(rMat.get(1,0)*mnX +
+ rMat.get(1,1)*mnY +
+ rMat.get(1,2)*mnZ +
+ rMat.get(1,3));
+ mnZ = fround(rMat.get(2,0)*mnX +
+ rMat.get(2,1)*mnY +
+ rMat.get(2,2)*mnZ +
+ rMat.get(2,3));
+
+ return *this;
+ }
+} // end of namespace basegfx
+
+// eof