1 // Created by: CKY / Contract Toubro-Larsen
2 // Copyright (c) 1993-1999 Matra Datavision
3 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 //--------------------------------------------------------------------
17 //--------------------------------------------------------------------
19 #include <gp_GTrsf.hxx>
22 #include <IGESData_IGESEntity.hxx>
23 #include <IGESGeom_OffsetCurve.hxx>
24 #include <Standard_Type.hxx>
26 IGESGeom_OffsetCurve::IGESGeom_OffsetCurve () { }
29 void IGESGeom_OffsetCurve::Init
30 (const Handle(IGESData_IGESEntity)& aBaseCurve,
31 const Standard_Integer anOffsetType,
32 const Handle(IGESData_IGESEntity)& aFunction,
33 const Standard_Integer aFunctionCoord,
34 const Standard_Integer aTaperedOffsetType,
35 const Standard_Real offDistance1,
36 const Standard_Real anArcLength1,
37 const Standard_Real offDistance2,
38 const Standard_Real anArcLength2,
39 const gp_XYZ& aNormalVec,
40 const Standard_Real anOffsetParam,
41 const Standard_Real anotherOffsetParam)
43 theBaseCurve = aBaseCurve;
44 theOffsetType = anOffsetType;
45 theFunction = aFunction;
46 theFunctionCoord = aFunctionCoord;
47 theTaperedOffsetType = aTaperedOffsetType;
48 theOffsetDistance1 = offDistance1;
49 theArcLength1 = anArcLength1;
50 theOffsetDistance2 = offDistance2;
51 theArcLength2 = anArcLength2;
52 theNormalVector = aNormalVec;
53 theOffsetParam1 = anOffsetParam;
54 theOffsetParam2 = anotherOffsetParam;
55 InitTypeAndForm(130,0);
59 Handle(IGESData_IGESEntity) IGESGeom_OffsetCurve::BaseCurve () const
64 Standard_Integer IGESGeom_OffsetCurve::OffsetType () const
69 Handle(IGESData_IGESEntity) IGESGeom_OffsetCurve::Function () const
74 Standard_Integer IGESGeom_OffsetCurve::FunctionParameter () const
76 return theFunctionCoord;
79 Standard_Integer IGESGeom_OffsetCurve::TaperedOffsetType () const
81 return theTaperedOffsetType;
84 Standard_Real IGESGeom_OffsetCurve::FirstOffsetDistance () const
86 return theOffsetDistance1;
89 Standard_Real IGESGeom_OffsetCurve::ArcLength1 () const
94 Standard_Real IGESGeom_OffsetCurve::SecondOffsetDistance () const
96 return theOffsetDistance2;
99 Standard_Real IGESGeom_OffsetCurve::ArcLength2 () const
101 return theArcLength2;
104 gp_Vec IGESGeom_OffsetCurve::NormalVector () const
106 return ( gp_Vec(theNormalVector) );
109 gp_Vec IGESGeom_OffsetCurve::TransformedNormalVector () const
111 if (!HasTransf()) return gp_Vec(theNormalVector);
112 gp_XYZ tempXYZ(theNormalVector);
113 gp_GTrsf loc = Location();
114 loc.SetTranslationPart(gp_XYZ(0.,0.,0.));
115 loc.Transforms(tempXYZ);
116 return gp_Vec(tempXYZ);
119 Standard_Real IGESGeom_OffsetCurve::StartParameter () const
120 { return theOffsetParam1; }
122 Standard_Real IGESGeom_OffsetCurve::EndParameter () const
123 { return theOffsetParam2; }
125 void IGESGeom_OffsetCurve::Parameters
126 (Standard_Real& TT1, Standard_Real& TT2) const
128 TT1 = theOffsetParam1;
129 TT2 = theOffsetParam2;
132 Standard_Boolean IGESGeom_OffsetCurve::HasFunction () const
134 return (! theFunction.IsNull() );