1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
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
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.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
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.
18 #include <Geom_Direction.hxx>
19 #include <Geom_Vector.hxx>
20 #include <Geom_VectorWithMagnitude.hxx>
21 #include <GeomToIGES_GeomEntity.hxx>
22 #include <GeomToIGES_GeomVector.hxx>
24 #include <gp_GTrsf.hxx>
26 #include <gp_Trsf.hxx>
28 #include <IGESData_IGESEntity.hxx>
29 #include <IGESData_ToolLocation.hxx>
30 #include <IGESGeom_CopiousData.hxx>
31 #include <IGESGeom_Direction.hxx>
32 #include <IGESGeom_Line.hxx>
33 #include <IGESGeom_Point.hxx>
34 #include <Interface_Macros.hxx>
36 //=============================================================================
37 // GeomToIGES_GeomVector
38 //=============================================================================
39 GeomToIGES_GeomVector::GeomToIGES_GeomVector()
40 :GeomToIGES_GeomEntity()
45 //=============================================================================
46 // GeomToIGES_GeomVector
47 //=============================================================================
49 GeomToIGES_GeomVector::GeomToIGES_GeomVector
50 (const GeomToIGES_GeomEntity& GE)
51 :GeomToIGES_GeomEntity(GE)
56 //=============================================================================
57 // Transfer des Entites Vector de Geom vers IGES
59 //=============================================================================
61 Handle(IGESGeom_Direction) GeomToIGES_GeomVector::TransferVector
62 (const Handle(Geom_Vector)& start)
64 Handle(IGESGeom_Direction) res;
69 if (start->IsKind(STANDARD_TYPE(Geom_VectorWithMagnitude))) {
70 DeclareAndCast(Geom_VectorWithMagnitude, VMagn, start);
71 res = TransferVector(VMagn);
73 else if (start->IsKind(STANDARD_TYPE(Geom_Direction))) {
74 DeclareAndCast(Geom_Direction, Direction, start);
75 res = TransferVector(Direction);
82 //=============================================================================
83 // Transfer des Entites VectorWithMagnitude de Geom vers IGES
85 //=============================================================================
87 Handle(IGESGeom_Direction) GeomToIGES_GeomVector::TransferVector
88 (const Handle(Geom_VectorWithMagnitude)& start)
90 Handle(IGESGeom_Direction) Dir = new IGESGeom_Direction;
97 Standard_Real M = start->Magnitude();
98 Dir->Init(gp_XYZ(X/(M*GetUnit()),Y/(M*GetUnit()),Z/(M*GetUnit())));
103 //=============================================================================
104 // Transfer des Entites Direction de Geom vers IGES
106 //=============================================================================
108 Handle(IGESGeom_Direction) GeomToIGES_GeomVector::TransferVector
109 (const Handle(Geom_Direction)& start)
111 Handle(IGESGeom_Direction) Dir = new IGESGeom_Direction;
112 if (start.IsNull()) {
118 Dir->Init(gp_XYZ(X/GetUnit(),Y/GetUnit(),Z/GetUnit()));