0024166: Unable to create file with "Save" menu of voxeldemo Qt sample
[occt.git] / src / Geom2d / Geom2d_AxisPlacement.cxx
CommitLineData
b311480e 1// Created on: 1993-03-24
2// Created by: JCV
3// Copyright (c) 1993-1999 Matra Datavision
4// Copyright (c) 1999-2012 OPEN CASCADE SAS
5//
6// The content of this file is subject to the Open CASCADE Technology Public
7// License Version 6.5 (the "License"). You may not use the content of this file
8// except in compliance with the License. Please obtain a copy of the License
9// at http://www.opencascade.org and read it completely before using this file.
10//
11// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13//
14// The Original Code and all software distributed under the License is
15// distributed on an "AS IS" basis, without warranty of any kind, and the
16// Initial Developer hereby disclaims all such warranties, including without
17// limitation, any warranties of merchantability, fitness for a particular
18// purpose or non-infringement. Please see the License for the specific terms
19// and conditions governing the rights and limitations under the License.
20
7fd59977 21
7fd59977 22
23#include <Geom2d_AxisPlacement.ixx>
24
25
26
27typedef Geom2d_AxisPlacement AxisPlacement;
28typedef Handle(Geom2d_AxisPlacement) Handle(AxisPlacement);
29typedef gp_Dir2d Dir2d;
30typedef gp_Pnt2d Pnt2d;
31typedef gp_Trsf2d Trsf2d;
32typedef gp_Vec2d Vec2d;
33
34
35
36
37Handle(Geom2d_Geometry) Geom2d_AxisPlacement::Copy() const {
38
39 Handle(AxisPlacement) A;
40 A = new AxisPlacement (axis);
41 return A;
42}
43
44
45
46
47
48
49Geom2d_AxisPlacement::Geom2d_AxisPlacement (const gp_Ax2d& A) { axis = A; }
50
51
52Geom2d_AxisPlacement::Geom2d_AxisPlacement (const Pnt2d& P, const Dir2d& V) {
53
54 axis = gp_Ax2d (P, V);
55}
56
57gp_Ax2d Geom2d_AxisPlacement::Ax2d () const { return axis; }
58
59Dir2d Geom2d_AxisPlacement::Direction () const { return axis.Direction(); }
60
61Pnt2d Geom2d_AxisPlacement::Location () const { return axis.Location(); }
62
63void Geom2d_AxisPlacement::Reverse() { axis.Reverse(); }
64
65Handle(AxisPlacement) Geom2d_AxisPlacement::Reversed() const {
66
67 gp_Ax2d A = axis;
68 A.Reverse();
69 Handle(AxisPlacement) Temp = new AxisPlacement (A);
70 return Temp;
71}
72
73void Geom2d_AxisPlacement::Transform (const Trsf2d& T) { axis.Transform (T); }
74
75
76void Geom2d_AxisPlacement::SetAxis (const gp_Ax2d& A) { axis = A; }
77
78void Geom2d_AxisPlacement::SetLocation (const Pnt2d& P) {axis.SetLocation (P);}
79
80void Geom2d_AxisPlacement::SetDirection (const Dir2d& V) {
81
82 axis.SetDirection(V);
83}
84
85Standard_Real Geom2d_AxisPlacement::Angle (const Handle(AxisPlacement)& Other) const {
86
87 return axis.Angle (Other->Ax2d());
88}