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 | |
42cf5bc1 |
18 | #include <Geom_CartesianPoint.hxx> |
19 | #include <Geom_Point.hxx> |
20 | #include <GeomToIGES_GeomEntity.hxx> |
21 | #include <GeomToIGES_GeomPoint.hxx> |
7fd59977 |
22 | #include <gp_Pnt.hxx> |
23 | #include <gp_XYZ.hxx> |
7fd59977 |
24 | #include <IGESGeom_Point.hxx> |
7fd59977 |
25 | #include <Interface_Macros.hxx> |
26 | |
7fd59977 |
27 | //============================================================================= |
28 | // GeomToIGES_GeomPoint |
29 | //============================================================================= |
7fd59977 |
30 | GeomToIGES_GeomPoint::GeomToIGES_GeomPoint |
31 | (const GeomToIGES_GeomEntity& GE) |
32 | :GeomToIGES_GeomEntity(GE) |
33 | { |
34 | } |
35 | |
36 | |
37 | //============================================================================= |
38 | // GeomToIGES_GeomPoint |
39 | //============================================================================= |
40 | |
41 | GeomToIGES_GeomPoint::GeomToIGES_GeomPoint() |
42 | |
43 | :GeomToIGES_GeomEntity() |
44 | { |
45 | } |
46 | |
47 | |
48 | //============================================================================= |
49 | // Transfer de Point de Geom vers IGES |
50 | // TranferPoint |
51 | //============================================================================= |
52 | |
53 | Handle(IGESGeom_Point) GeomToIGES_GeomPoint::TransferPoint |
54 | ( const Handle(Geom_Point)& P) |
55 | { |
56 | Handle(IGESGeom_Point) Piges = new IGESGeom_Point; |
57 | if (P.IsNull()) { |
58 | return Piges; |
59 | } |
60 | |
61 | Standard_Real X,Y,Z; |
62 | P->Coord (X,Y,Z); |
63 | Handle(IGESBasic_SubfigureDef) voidsubdef; |
64 | Piges-> Init(gp_XYZ(X/GetUnit(),Y/GetUnit(),Z/GetUnit()), voidsubdef); |
65 | return Piges; |
66 | } |
67 | |
68 | //============================================================================= |
69 | // Transfer de Point de Geom vers IGES |
70 | // TranferPoint |
71 | //============================================================================= |
72 | |
73 | Handle(IGESGeom_Point) GeomToIGES_GeomPoint::TransferPoint |
74 | ( const Handle(Geom_CartesianPoint)& P) |
75 | { |
76 | |
77 | Handle(IGESGeom_Point) Piges = new IGESGeom_Point; |
78 | if (P.IsNull()) { |
79 | return Piges; |
80 | } |
81 | |
82 | Standard_Real X,Y,Z; |
83 | P->Coord (X,Y,Z); |
84 | Handle(IGESBasic_SubfigureDef) voidsubdef; |
85 | Piges-> Init(gp_XYZ(X/GetUnit(),Y/GetUnit(),Z/GetUnit()), voidsubdef); |
86 | return Piges; |
87 | } |