1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 // JCV 08/01/91 Modifs introduction des classes XY, Mat2d dans le package gp
17 #define No_Standard_OutOfRange
20 #include <gp_Ax2d.hxx>
21 #include <gp_Pnt2d.hxx>
22 #include <gp_Trsf2d.hxx>
23 #include <gp_Vec2d.hxx>
25 #include <Standard_Dump.hxx>
26 #include <Standard_OutOfRange.hxx>
28 void gp_Pnt2d::Transform (const gp_Trsf2d& T)
30 if (T.Form () == gp_Identity) { }
31 else if (T.Form () == gp_Translation)
32 { coord.Add (T.TranslationPart ()); }
33 else if (T.Form () == gp_Scale) {
34 coord.Multiply (T.ScaleFactor ());
35 coord.Add (T.TranslationPart ());
37 else if (T.Form () == gp_PntMirror) {
39 coord.Add (T.TranslationPart ());
41 else { T.Transforms(coord); }
44 void gp_Pnt2d::Mirror (const gp_Pnt2d& P)
52 gp_Pnt2d gp_Pnt2d::Mirrored (const gp_Pnt2d& P) const
54 gp_Pnt2d Pres = *this;
59 void gp_Pnt2d::Mirror (const gp_Ax2d& A)
66 gp_Pnt2d gp_Pnt2d::Mirrored (const gp_Ax2d& A) const
73 void gp_Pnt2d::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
75 OCCT_DUMP_VECTOR_CLASS (theOStream, "gp_Pnt2d", 2, coord.X(), coord.Y())