1 // Created on: 1993-01-09
2 // Created by: CKY / Contract Toubro-Larsen ( TCD )
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _IGESGeom_OffsetCurve_HeaderFile
18 #define _IGESGeom_OffsetCurve_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Standard_Integer.hxx>
24 #include <Standard_Real.hxx>
26 #include <IGESData_IGESEntity.hxx>
27 #include <Standard_Boolean.hxx>
31 class IGESGeom_OffsetCurve;
32 DEFINE_STANDARD_HANDLE(IGESGeom_OffsetCurve, IGESData_IGESEntity)
34 //! defines IGESOffsetCurve, Type <130> Form <0>
35 //! in package IGESGeom
36 //! An OffsetCurve entity contains the data necessary to
37 //! determine the offset of a given curve C. This entity
38 //! points to the base curve to be offset and contains
39 //! offset distance and other pertinent information.
40 class IGESGeom_OffsetCurve : public IGESData_IGESEntity
46 Standard_EXPORT IGESGeom_OffsetCurve();
48 //! This method is used to set the fields of the class
50 //! - aBaseCurve : The curve entity to be offset
51 //! - anOffsetType : Offset distance flag
52 //! 1 = Single value, uniform distance
53 //! 2 = Varying linearly
54 //! 3 = As a specified function
55 //! - aFunction : Curve entity, one coordinate of which
56 //! describes offset as a function of its
57 //! parameter (0 unless OffsetType = 3)
58 //! - aFunctionCoord : Particular coordinate of curve
59 //! describing offset as function of its
60 //! parameters. (used if OffsetType = 3)
61 //! - aTaperedOffsetType : Tapered offset type flag
62 //! 1 = Function of arc length
63 //! 2 = Function of parameter
64 //! (Only used if OffsetType = 2 or 3)
65 //! - offDistance1 : First offset distance
66 //! (Only used if OffsetType = 1 or 2)
67 //! - arcLength1 : Arc length or parameter value of
68 //! first offset distance
69 //! (Only used if OffsetType = 2)
70 //! - offDistance2 : Second offset distance
71 //! - arcLength2 : Arc length or parameter value of
72 //! second offset distance
73 //! (Only used if OffsetType = 2)
74 //! - aNormalVec : Unit vector normal to plane containing
75 //! curve to be offset
76 //! - anOffsetParam : Start parameter value of offset curve
77 //! - anotherOffsetParam : End parameter value of offset curve
78 Standard_EXPORT void Init (const Handle(IGESData_IGESEntity)& aBaseCurve, const Standard_Integer anOffsetType, const Handle(IGESData_IGESEntity)& aFunction, const Standard_Integer aFunctionCoord, const Standard_Integer aTaperedOffsetType, const Standard_Real offDistance1, const Standard_Real arcLength1, const Standard_Real offDistance2, const Standard_Real arcLength2, const gp_XYZ& aNormalVec, const Standard_Real anOffsetParam, const Standard_Real anotherOffsetParam);
80 //! returns the curve to be offset
81 Standard_EXPORT Handle(IGESData_IGESEntity) BaseCurve() const;
83 //! returns the offset distance flag
84 //! 1 = Single value offset (uniform distance)
85 //! 2 = Offset distance varying linearly
86 //! 3 = Offset distance specified as a function
87 Standard_EXPORT Standard_Integer OffsetType() const;
89 //! returns the function defining the offset if at all the offset
90 //! is described as a function or Null Handle.
91 Standard_EXPORT Handle(IGESData_IGESEntity) Function() const;
93 //! returns True if function defining the offset is present.
94 Standard_EXPORT Standard_Boolean HasFunction() const;
96 //! returns particular coordinate of the curve which describes offset
97 //! as a function of its parameters. (only used if OffsetType() = 3)
98 Standard_EXPORT Standard_Integer FunctionParameter() const;
100 //! returns tapered offset type flag (only used if OffsetType() = 2 or 3)
101 //! 1 = Function of arc length
102 //! 2 = Function of parameter
103 Standard_EXPORT Standard_Integer TaperedOffsetType() const;
105 //! returns first offset distance (only used if OffsetType() = 1 or 2)
106 Standard_EXPORT Standard_Real FirstOffsetDistance() const;
108 //! returns arc length or parameter value (depending on value of
109 //! offset distance flag) of first offset distance
110 //! (only used if OffsetType() = 2)
111 Standard_EXPORT Standard_Real ArcLength1() const;
113 //! returns the second offset distance
114 Standard_EXPORT Standard_Real SecondOffsetDistance() const;
116 //! returns arc length or parameter value (depending on value of
117 //! offset distance flag) of second offset distance
118 //! (only used if OffsetType() = 2)
119 Standard_EXPORT Standard_Real ArcLength2() const;
121 //! returns unit vector normal to plane containing curve to be offset
122 Standard_EXPORT gp_Vec NormalVector() const;
124 //! returns unit vector normal to plane containing curve to be offset
125 //! after applying Transf. Matrix
126 Standard_EXPORT gp_Vec TransformedNormalVector() const;
128 Standard_EXPORT void Parameters (Standard_Real& StartParam, Standard_Real& EndParam) const;
130 //! returns Start Parameter value of the offset curve
131 Standard_EXPORT Standard_Real StartParameter() const;
133 //! returns End Parameter value of the offset curve
134 Standard_EXPORT Standard_Real EndParameter() const;
139 DEFINE_STANDARD_RTTIEXT(IGESGeom_OffsetCurve,IGESData_IGESEntity)
149 Handle(IGESData_IGESEntity) theBaseCurve;
150 Standard_Integer theOffsetType;
151 Handle(IGESData_IGESEntity) theFunction;
152 Standard_Integer theFunctionCoord;
153 Standard_Integer theTaperedOffsetType;
154 Standard_Real theOffsetDistance1;
155 Standard_Real theArcLength1;
156 Standard_Real theOffsetDistance2;
157 Standard_Real theArcLength2;
158 gp_XYZ theNormalVector;
159 Standard_Real theOffsetParam1;
160 Standard_Real theOffsetParam2;
171 #endif // _IGESGeom_OffsetCurve_HeaderFile