973c2be1 |
1 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
2 | // |
973c2be1 |
3 | // This file is part of Open CASCADE Technology software library. |
b311480e |
4 | // |
d5f74e42 |
5 | // This library is free software; you can redistribute it and/or modify it under |
6 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
7 | // by the Free Software Foundation, with special exception defined in the file |
8 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
9 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
10 | // |
973c2be1 |
11 | // Alternatively, this file may be used under the terms of Open CASCADE |
12 | // commercial license or contractual agreement. |
7fd59977 |
13 | |
14 | // modif du 14/09/95 mjm |
15 | // prise en compte de l'unite choisi par l'utilisateur |
16 | // pour l'ecriture du fichier IGES. |
17 | |
18 | #include <GeomToIGES_GeomPoint.ixx> |
19 | |
20 | #include <gp_Pnt.hxx> |
21 | #include <gp_XYZ.hxx> |
22 | |
23 | #include <Geom_Point.hxx> |
24 | |
25 | #include <IGESGeom_Point.hxx> |
26 | |
27 | #include <Interface_Macros.hxx> |
28 | |
29 | |
30 | //============================================================================= |
31 | // GeomToIGES_GeomPoint |
32 | //============================================================================= |
33 | |
34 | GeomToIGES_GeomPoint::GeomToIGES_GeomPoint |
35 | (const GeomToIGES_GeomEntity& GE) |
36 | :GeomToIGES_GeomEntity(GE) |
37 | { |
38 | } |
39 | |
40 | |
41 | //============================================================================= |
42 | // GeomToIGES_GeomPoint |
43 | //============================================================================= |
44 | |
45 | GeomToIGES_GeomPoint::GeomToIGES_GeomPoint() |
46 | |
47 | :GeomToIGES_GeomEntity() |
48 | { |
49 | } |
50 | |
51 | |
52 | //============================================================================= |
53 | // Transfer de Point de Geom vers IGES |
54 | // TranferPoint |
55 | //============================================================================= |
56 | |
57 | Handle(IGESGeom_Point) GeomToIGES_GeomPoint::TransferPoint |
58 | ( const Handle(Geom_Point)& P) |
59 | { |
60 | Handle(IGESGeom_Point) Piges = new IGESGeom_Point; |
61 | if (P.IsNull()) { |
62 | return Piges; |
63 | } |
64 | |
65 | Standard_Real X,Y,Z; |
66 | P->Coord (X,Y,Z); |
67 | Handle(IGESBasic_SubfigureDef) voidsubdef; |
68 | Piges-> Init(gp_XYZ(X/GetUnit(),Y/GetUnit(),Z/GetUnit()), voidsubdef); |
69 | return Piges; |
70 | } |
71 | |
72 | //============================================================================= |
73 | // Transfer de Point de Geom vers IGES |
74 | // TranferPoint |
75 | //============================================================================= |
76 | |
77 | Handle(IGESGeom_Point) GeomToIGES_GeomPoint::TransferPoint |
78 | ( const Handle(Geom_CartesianPoint)& P) |
79 | { |
80 | |
81 | Handle(IGESGeom_Point) Piges = new IGESGeom_Point; |
82 | if (P.IsNull()) { |
83 | return Piges; |
84 | } |
85 | |
86 | Standard_Real X,Y,Z; |
87 | P->Coord (X,Y,Z); |
88 | Handle(IGESBasic_SubfigureDef) voidsubdef; |
89 | Piges-> Init(gp_XYZ(X/GetUnit(),Y/GetUnit(),Z/GetUnit()), voidsubdef); |
90 | return Piges; |
91 | } |