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.
18 #include <GeomToStep_MakeAxis2Placement2d.hxx>
19 #include <GeomToStep_MakeCartesianPoint.hxx>
20 #include <GeomToStep_MakeDirection.hxx>
22 #include <gp_Ax22d.hxx>
23 #include <StdFail_NotDone.hxx>
24 #include <StepGeom_Axis2Placement2d.hxx>
25 #include <StepGeom_CartesianPoint.hxx>
26 #include <StepGeom_Direction.hxx>
27 #include <TCollection_HAsciiString.hxx>
29 //=============================================================================
30 // Creation d' un axis2_placement_2d de prostep a partir d' un Ax2 de gp
31 //=============================================================================
32 GeomToStep_MakeAxis2Placement2d::GeomToStep_MakeAxis2Placement2d
35 Handle(StepGeom_Axis2Placement2d) Axe;
36 Handle(StepGeom_CartesianPoint) P;
37 Handle(StepGeom_Direction) D;
39 GeomToStep_MakeCartesianPoint MkPoint(A.Location());
40 GeomToStep_MakeDirection MkDir(A.Direction());
45 Axe = new StepGeom_Axis2Placement2d;
47 Axe->SetRefDirection(D);
48 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
50 theAxis2Placement2d = Axe;
54 //=============================================================================
55 // Creation d' un axis2_placement_2d de prostep a partir d' un Ax22d de gp
56 //=============================================================================
58 GeomToStep_MakeAxis2Placement2d::GeomToStep_MakeAxis2Placement2d
61 Handle(StepGeom_Axis2Placement2d) Axe;
62 Handle(StepGeom_CartesianPoint) P;
63 Handle(StepGeom_Direction) D1;
65 GeomToStep_MakeCartesianPoint MkPoint(A.Location());
66 GeomToStep_MakeDirection MkDir(A.XDirection());
71 Axe = new StepGeom_Axis2Placement2d;
73 Axe->SetRefDirection(D1);
74 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
76 theAxis2Placement2d = Axe;
80 //=============================================================================
81 // Creation d' un axis2_placement_2d de prostep a partir d' un Axis2Placement
83 //=============================================================================
85 //GeomToStep_MakeAxis2Placement2d::GeomToStep_MakeAxis2Placement2d
86 // ( const Handle(Geom_Axis2Placement)& Axis2)
88 // Handle(StepGeom_Axis2Placement2d) Axe;
89 // Handle(StepGeom_CartesianPoint) P;
90 // Handle(StepGeom_Direction) D1, D2;
94 // P = GeomToStep_MakeCartesianPoint(A.Location());
95 // D1 = GeomToStep_MakeDirection(A.Direction());
96 // D2 = GeomToStep_MakeDirection(A.XDirection());
97 // Axe = new StepGeom_Axis2Placement2d;
98 // Axe->SetLocation(P);
100 // Axe->SetRefDirection(D2);
101 // theAxis2Placement2d = Axe;
102 // done = Standard_True;
105 //=============================================================================
106 // renvoi des valeurs
107 //=============================================================================
109 const Handle(StepGeom_Axis2Placement2d) &
110 GeomToStep_MakeAxis2Placement2d::Value() const
112 StdFail_NotDone_Raise_if (!done, "GeomToStep_MakeAxis2Placement2d::Value() - no result");
113 return theAxis2Placement2d;