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 IMPLEMENT_STANDARD_RTTIEXT(IGESGeom_OffsetCurve,IGESData_IGESEntity)
28 IGESGeom_OffsetCurve::IGESGeom_OffsetCurve () { }
31 void IGESGeom_OffsetCurve::Init
32 (const Handle(IGESData_IGESEntity)& aBaseCurve,
33 const Standard_Integer anOffsetType,
34 const Handle(IGESData_IGESEntity)& aFunction,
35 const Standard_Integer aFunctionCoord,
36 const Standard_Integer aTaperedOffsetType,
37 const Standard_Real offDistance1,
38 const Standard_Real anArcLength1,
39 const Standard_Real offDistance2,
40 const Standard_Real anArcLength2,
41 const gp_XYZ& aNormalVec,
42 const Standard_Real anOffsetParam,
43 const Standard_Real anotherOffsetParam)
45 theBaseCurve = aBaseCurve;
46 theOffsetType = anOffsetType;
47 theFunction = aFunction;
48 theFunctionCoord = aFunctionCoord;
49 theTaperedOffsetType = aTaperedOffsetType;
50 theOffsetDistance1 = offDistance1;
51 theArcLength1 = anArcLength1;
52 theOffsetDistance2 = offDistance2;
53 theArcLength2 = anArcLength2;
54 theNormalVector = aNormalVec;
55 theOffsetParam1 = anOffsetParam;
56 theOffsetParam2 = anotherOffsetParam;
57 InitTypeAndForm(130,0);
61 Handle(IGESData_IGESEntity) IGESGeom_OffsetCurve::BaseCurve () const
66 Standard_Integer IGESGeom_OffsetCurve::OffsetType () const
71 Handle(IGESData_IGESEntity) IGESGeom_OffsetCurve::Function () const
76 Standard_Integer IGESGeom_OffsetCurve::FunctionParameter () const
78 return theFunctionCoord;
81 Standard_Integer IGESGeom_OffsetCurve::TaperedOffsetType () const
83 return theTaperedOffsetType;
86 Standard_Real IGESGeom_OffsetCurve::FirstOffsetDistance () const
88 return theOffsetDistance1;
91 Standard_Real IGESGeom_OffsetCurve::ArcLength1 () const
96 Standard_Real IGESGeom_OffsetCurve::SecondOffsetDistance () const
98 return theOffsetDistance2;
101 Standard_Real IGESGeom_OffsetCurve::ArcLength2 () const
103 return theArcLength2;
106 gp_Vec IGESGeom_OffsetCurve::NormalVector () const
108 return ( gp_Vec(theNormalVector) );
111 gp_Vec IGESGeom_OffsetCurve::TransformedNormalVector () const
113 if (!HasTransf()) return gp_Vec(theNormalVector);
114 gp_XYZ tempXYZ(theNormalVector);
115 gp_GTrsf loc = Location();
116 loc.SetTranslationPart(gp_XYZ(0.,0.,0.));
117 loc.Transforms(tempXYZ);
118 return gp_Vec(tempXYZ);
121 Standard_Real IGESGeom_OffsetCurve::StartParameter () const
122 { return theOffsetParam1; }
124 Standard_Real IGESGeom_OffsetCurve::EndParameter () const
125 { return theOffsetParam2; }
127 void IGESGeom_OffsetCurve::Parameters
128 (Standard_Real& TT1, Standard_Real& TT2) const
130 TT1 = theOffsetParam1;
131 TT2 = theOffsetParam2;
134 Standard_Boolean IGESGeom_OffsetCurve::HasFunction () const
136 return (! theFunction.IsNull() );