1 // Copyright (c) 1999-2012 OPEN CASCADE SAS
3 // The content of this file is subject to the Open CASCADE Technology Public
4 // License Version 6.5 (the "License"). You may not use the content of this file
5 // except in compliance with the License. Please obtain a copy of the License
6 // at http://www.opencascade.org and read it completely before using this file.
8 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
11 // The Original Code and all software distributed under the License is
12 // distributed on an "AS IS" basis, without warranty of any kind, and the
13 // Initial Developer hereby disclaims all such warranties, including without
14 // limitation, any warranties of merchantability, fitness for a particular
15 // purpose or non-infringement. Please see the License for the specific terms
16 // and conditions governing the rights and limitations under the License.
19 // modif du 14/09/95 mjm
20 // prise en compte de l'unite choisi par l'utilisateur
21 // pour l'ecriture du fichier IGES.
23 #include <GeomToIGES_GeomVector.ixx>
25 #include <Geom_Vector.hxx>
26 #include <Geom_VectorWithMagnitude.hxx>
27 #include <Geom_Direction.hxx>
30 #include <gp_GTrsf.hxx>
32 #include <gp_Trsf.hxx>
35 #include <IGESData_IGESEntity.hxx>
36 #include <IGESData_ToolLocation.hxx>
38 #include <IGESGeom_CopiousData.hxx>
39 #include <IGESGeom_Line.hxx>
40 #include <IGESGeom_Point.hxx>
42 #include <Interface_Macros.hxx>
46 //=============================================================================
47 // GeomToIGES_GeomVector
48 //=============================================================================
50 GeomToIGES_GeomVector::GeomToIGES_GeomVector()
51 :GeomToIGES_GeomEntity()
56 //=============================================================================
57 // GeomToIGES_GeomVector
58 //=============================================================================
60 GeomToIGES_GeomVector::GeomToIGES_GeomVector
61 (const GeomToIGES_GeomEntity& GE)
62 :GeomToIGES_GeomEntity(GE)
67 //=============================================================================
68 // Transfer des Entites Vector de Geom vers IGES
70 //=============================================================================
72 Handle(IGESGeom_Direction) GeomToIGES_GeomVector::TransferVector
73 (const Handle(Geom_Vector)& start)
75 Handle(IGESGeom_Direction) res;
80 if (start->IsKind(STANDARD_TYPE(Geom_VectorWithMagnitude))) {
81 DeclareAndCast(Geom_VectorWithMagnitude, VMagn, start);
82 res = TransferVector(VMagn);
84 else if (start->IsKind(STANDARD_TYPE(Geom_Direction))) {
85 DeclareAndCast(Geom_Direction, Direction, start);
86 res = TransferVector(Direction);
93 //=============================================================================
94 // Transfer des Entites VectorWithMagnitude de Geom vers IGES
96 //=============================================================================
98 Handle(IGESGeom_Direction) GeomToIGES_GeomVector::TransferVector
99 (const Handle(Geom_VectorWithMagnitude)& start)
101 Handle(IGESGeom_Direction) Dir = new IGESGeom_Direction;
102 if (start.IsNull()) {
108 Standard_Real M = start->Magnitude();
109 Dir->Init(gp_XYZ(X/(M*GetUnit()),Y/(M*GetUnit()),Z/(M*GetUnit())));
114 //=============================================================================
115 // Transfer des Entites Direction de Geom vers IGES
117 //=============================================================================
119 Handle(IGESGeom_Direction) GeomToIGES_GeomVector::TransferVector
120 (const Handle(Geom_Direction)& start)
122 Handle(IGESGeom_Direction) Dir = new IGESGeom_Direction;
123 if (start.IsNull()) {
129 Dir->Init(gp_XYZ(X/GetUnit(),Y/GetUnit(),Z/GetUnit()));