summaryrefslogtreecommitdiff
path: root/src/IGESGeom/IGESGeom_OffsetCurve.cxx
blob: 2d702521bbba5c0cb3b25a4c9225f48ff258bab5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
//--------------------------------------------------------------------
//
//  File Name : IGESGeom_OffsetCurve.cxx
//  Date      :
//  Author    : CKY / Contract Toubro-Larsen
//  Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------

#include <IGESGeom_OffsetCurve.ixx>
#include <gp_GTrsf.hxx>


    IGESGeom_OffsetCurve::IGESGeom_OffsetCurve ()     {  }


    void IGESGeom_OffsetCurve::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    anArcLength1, 
   const Standard_Real    offDistance2, 
   const Standard_Real    anArcLength2, 
   const gp_XYZ&          aNormalVec,
   const Standard_Real    anOffsetParam, 
   const Standard_Real    anotherOffsetParam) 
{
  theBaseCurve         = aBaseCurve;
  theOffsetType        = anOffsetType;
  theFunction          = aFunction;
  theFunctionCoord     = aFunctionCoord;
  theTaperedOffsetType = aTaperedOffsetType;
  theOffsetDistance1   = offDistance1;
  theArcLength1        = anArcLength1;
  theOffsetDistance2   = offDistance2;
  theArcLength2        = anArcLength2;
  theNormalVector      = aNormalVec;
  theOffsetParam1      = anOffsetParam;
  theOffsetParam2      = anotherOffsetParam;
  InitTypeAndForm(130,0);
}


    Handle(IGESData_IGESEntity) IGESGeom_OffsetCurve::BaseCurve () const
{
  return theBaseCurve;
}

    Standard_Integer IGESGeom_OffsetCurve::OffsetType () const
{
  return theOffsetType;
}

    Handle(IGESData_IGESEntity) IGESGeom_OffsetCurve::Function () const
{
  return theFunction;
}

    Standard_Integer IGESGeom_OffsetCurve::FunctionParameter () const
{
  return theFunctionCoord;
}

    Standard_Integer IGESGeom_OffsetCurve::TaperedOffsetType () const
{
  return theTaperedOffsetType;
}

    Standard_Real IGESGeom_OffsetCurve::FirstOffsetDistance () const
{
  return theOffsetDistance1;
}

    Standard_Real IGESGeom_OffsetCurve::ArcLength1 () const
{
  return theArcLength1;
}

    Standard_Real IGESGeom_OffsetCurve::SecondOffsetDistance () const
{
  return theOffsetDistance2;
}

    Standard_Real IGESGeom_OffsetCurve::ArcLength2 () const
{
  return theArcLength2;
}

    gp_Vec IGESGeom_OffsetCurve::NormalVector () const
{
  return ( gp_Vec(theNormalVector) );
}

    gp_Vec IGESGeom_OffsetCurve::TransformedNormalVector () const
{
  if (!HasTransf()) return gp_Vec(theNormalVector);
  gp_XYZ tempXYZ(theNormalVector);
  gp_GTrsf loc = Location();
  loc.SetTranslationPart(gp_XYZ(0.,0.,0.));
  loc.Transforms(tempXYZ);
  return gp_Vec(tempXYZ);
}

    Standard_Real IGESGeom_OffsetCurve::StartParameter () const
{  return theOffsetParam1;  }

    Standard_Real IGESGeom_OffsetCurve::EndParameter () const
{  return theOffsetParam2;  }

    void IGESGeom_OffsetCurve::Parameters
  (Standard_Real& TT1, Standard_Real& TT2) const
{
  TT1 = theOffsetParam1;
  TT2 = theOffsetParam2;
}

    Standard_Boolean IGESGeom_OffsetCurve::HasFunction () const
{
  return (! theFunction.IsNull() );
}