1 // Created on: 1999-02-16
2 // Created by: Andrey BETENEV
3 // Copyright (c) 1999-1999 Matra Datavision
4 // Copyright (c) 1999-2012 OPEN CASCADE SAS
6 // The content of this file is subject to the Open CASCADE Technology Public
7 // License Version 6.5 (the "License"). You may not use the content of this file
8 // except in compliance with the License. Please obtain a copy of the License
9 // at http://www.opencascade.org and read it completely before using this file.
11 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 // The Original Code and all software distributed under the License is
15 // distributed on an "AS IS" basis, without warranty of any kind, and the
16 // Initial Developer hereby disclaims all such warranties, including without
17 // limitation, any warranties of merchantability, fitness for a particular
18 // purpose or non-infringement. Please see the License for the specific terms
19 // and conditions governing the rights and limitations under the License.
21 // sln 23.10.2001. CTS23496: If problems with creation of direction occur default direction is used (StepToGeom_MakeTransformation3d(...) function)
23 #include <StepToGeom_MakeTransformation3d.ixx>
24 #include <StepToGeom_MakeCartesianPoint.hxx>
25 #include <StepToGeom_MakeDirection.hxx>
26 #include <StepGeom_CartesianPoint.hxx>
27 #include <StepGeom_Direction.hxx>
28 #include <Geom_CartesianPoint.hxx>
29 #include <Geom_Direction.hxx>
32 //=======================================================================
33 //function : StepToGeom_MakeTransformation3d
35 //=======================================================================
37 Standard_Boolean StepToGeom_MakeTransformation3d::Convert (const Handle(StepGeom_CartesianTransformationOperator3d)& SCTO, gp_Trsf& CT)
39 Handle(Geom_CartesianPoint) CP;
40 if (StepToGeom_MakeCartesianPoint::Convert(SCTO->LocalOrigin(),CP))
42 const gp_Pnt Pgp = CP->Pnt();
44 // sln 23.10.2001. CTS23496: If problems with creation of direction occur default direction is used
46 const Handle(StepGeom_Direction) A1 = SCTO->Axis1();
48 Handle(Geom_Direction) D;
49 if (StepToGeom_MakeDirection::Convert(A1,D))
54 const Handle(StepGeom_Direction) A2 = SCTO->Axis2();
56 Handle(Geom_Direction) D;
57 if (StepToGeom_MakeDirection::Convert(A2,D))
61 Standard_Boolean isDefaultDirectionUsed = Standard_True;
63 const Handle(StepGeom_Direction) A3 = SCTO->Axis3();
65 Handle(Geom_Direction) D;
66 if(StepToGeom_MakeDirection::Convert(A3,D)) {
68 isDefaultDirectionUsed = Standard_False;
71 if(isDefaultDirectionUsed)
74 const gp_Ax3 result(Pgp,D3,D1);
75 CT.SetTransformation(result);
76 CT = CT.Inverted(); //:n8 abv 16 Feb 99: tr8_as2_db.stp: reverse for accordance with LV tool
79 return Standard_False;