1 // Created on: 1994-08-26
2 // Created by: Frederic MAUPAS
3 // Copyright (c) 1994-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #include <GeomToStep_MakeAxis2Placement2d.ixx>
18 #include <StepGeom_Direction.hxx>
19 #include <GeomToStep_MakeDirection.hxx>
20 #include <StepGeom_CartesianPoint.hxx>
21 #include <GeomToStep_MakeCartesianPoint.hxx>
22 #include <StdFail_NotDone.hxx>
24 #include <gp_Ax22d.hxx>
26 #include <StepGeom_Axis2Placement2d.hxx>
27 #include <TCollection_HAsciiString.hxx>
29 //=============================================================================
30 // Creation d' un axis2_placement_2d de prostep a partir d' un Ax2 de gp
31 //=============================================================================
33 GeomToStep_MakeAxis2Placement2d::GeomToStep_MakeAxis2Placement2d
36 Handle(StepGeom_Axis2Placement2d) Axe;
37 Handle(StepGeom_CartesianPoint) P;
38 Handle(StepGeom_Direction) D;
40 GeomToStep_MakeCartesianPoint MkPoint(A.Location());
41 GeomToStep_MakeDirection MkDir(A.Direction());
46 Axe = new StepGeom_Axis2Placement2d;
48 Axe->SetRefDirection(D);
49 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
51 theAxis2Placement2d = Axe;
55 //=============================================================================
56 // Creation d' un axis2_placement_2d de prostep a partir d' un Ax22d de gp
57 //=============================================================================
59 GeomToStep_MakeAxis2Placement2d::GeomToStep_MakeAxis2Placement2d
62 Handle(StepGeom_Axis2Placement2d) Axe;
63 Handle(StepGeom_CartesianPoint) P;
64 Handle(StepGeom_Direction) D1;
66 GeomToStep_MakeCartesianPoint MkPoint(A.Location());
67 GeomToStep_MakeDirection MkDir(A.XDirection());
72 Axe = new StepGeom_Axis2Placement2d;
74 Axe->SetRefDirection(D1);
75 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
77 theAxis2Placement2d = Axe;
81 //=============================================================================
82 // Creation d' un axis2_placement_2d de prostep a partir d' un Axis2Placement
84 //=============================================================================
86 //GeomToStep_MakeAxis2Placement2d::GeomToStep_MakeAxis2Placement2d
87 // ( const Handle(Geom_Axis2Placement)& Axis2)
89 // Handle(StepGeom_Axis2Placement2d) Axe;
90 // Handle(StepGeom_CartesianPoint) P;
91 // Handle(StepGeom_Direction) D1, D2;
95 // P = GeomToStep_MakeCartesianPoint(A.Location());
96 // D1 = GeomToStep_MakeDirection(A.Direction());
97 // D2 = GeomToStep_MakeDirection(A.XDirection());
98 // Axe = new StepGeom_Axis2Placement2d;
99 // Axe->SetLocation(P);
101 // Axe->SetRefDirection(D2);
102 // theAxis2Placement2d = Axe;
103 // done = Standard_True;
106 //=============================================================================
107 // renvoi des valeurs
108 //=============================================================================
110 const Handle(StepGeom_Axis2Placement2d) &
111 GeomToStep_MakeAxis2Placement2d::Value() const
113 StdFail_NotDone_Raise_if(!done, "");
114 return theAxis2Placement2d;