0024428: Implementation of LGPL license
[occt.git] / src / Contap / Contap_ContourGen_1.gxx
CommitLineData
b311480e 1// Created on: 1993-02-05
2// Created by: Jacques GOUSSARD
3// Copyright (c) 1993-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
973c2be1 8// This library is free software; you can redistribute it and / or modify it
9// under the terms of the GNU Lesser General Public 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.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
733a0e55 16
7fd59977 17#include <Standard_ConstructionError.hxx>
18
19
20Contap_ContourGen::Contap_ContourGen () :
21 done(Standard_False),modeset(Standard_False)
22{}
23
24Contap_ContourGen::Contap_ContourGen (const gp_Vec& Direction) :
25
26 done(Standard_False),modeset(Standard_True)
27{
28 mySFunc.Set(Direction);
29 myAFunc.Set(Direction);
30}
31
32
33Contap_ContourGen::Contap_ContourGen (const gp_Vec& Direction,
34 const Standard_Real Angle) :
35
36 done(Standard_False),modeset(Standard_True)
37{
38 mySFunc.Set(Direction,Angle);
39 myAFunc.Set(Direction,Angle);
40}
41
42Contap_ContourGen::Contap_ContourGen (const gp_Pnt& Eye) :
43
44 done(Standard_False),modeset(Standard_True)
45{
46 mySFunc.Set(Eye);
47 myAFunc.Set(Eye);
48}
49
50
51Contap_ContourGen::Contap_ContourGen (const TheSurface& Surf,
52 const Handle(TheTopolTool)& Domain,
53 const gp_Vec& Direction) :
54
55 done(Standard_False),modeset(Standard_True)
56{
57 Perform(Surf,Domain,Direction);
58}
59
60
61Contap_ContourGen::Contap_ContourGen (const TheSurface& Surf,
62 const Handle(TheTopolTool)& Domain,
63 const gp_Vec& Direction,
64 const Standard_Real Angle) :
65
66 done(Standard_False),modeset(Standard_True)
67{
68 Perform(Surf,Domain,Direction,Angle);
69}
70
71
72Contap_ContourGen::Contap_ContourGen (const TheSurface& Surf,
73 const Handle(TheTopolTool)& Domain,
74 const gp_Pnt& Eye) :
75
76 done(Standard_False),modeset(Standard_True)
77{
78 Perform(Surf,Domain,Eye);
79}
80
81
82void Contap_ContourGen::Init (const gp_Vec& Direction)
83
84{
85 done = Standard_False;
86 modeset = Standard_True;
87 mySFunc.Set(Direction);
88 myAFunc.Set(Direction);
89}
90
91
92void Contap_ContourGen::Init(const gp_Vec& Direction,
93 const Standard_Real Angle)
94{
95 done = Standard_False;
96 modeset = Standard_True;
97 mySFunc.Set(Direction,Angle);
98 myAFunc.Set(Direction,Angle);
99}
100
101void Contap_ContourGen::Init (const gp_Pnt& Eye)
102{
103 done = Standard_False;
104 modeset = Standard_True;
105 mySFunc.Set(Eye);
106 myAFunc.Set(Eye);
107}
108
109
110void Contap_ContourGen::Perform (const TheSurface& Surf,
111 const Handle(TheTopolTool)& Domain)
112{
113 if (!modeset) {Standard_ConstructionError::Raise();}
114 mySFunc.Set(Surf);
115 myAFunc.Set(Surf);
116
117 GeomAbs_SurfaceType typS = TheSurfaceTool::GetType(Surf);
118 switch (typS) {
119 case GeomAbs_Plane:
120 case GeomAbs_Sphere:
121 case GeomAbs_Cylinder:
122 case GeomAbs_Cone:
123 {
124 PerformAna(Domain); //Surf,Domain,Direction,0.,gp_Pnt(0.,0.,0.),1);
125 }
126 break;
127
128 default:
129 {
130 Perform(Domain); //Surf,Domain,Direction,0.,gp_Pnt(0.,0.,0.),1);
131 }
132 break;
133 }
134
135}
136
137
138void Contap_ContourGen::Perform (const TheSurface& Surf,
139 const Handle(TheTopolTool)& Domain,
140 const gp_Vec& Direction)
141
142{
143 Init(Direction);
144 Perform(Surf,Domain);
145}
146
147void Contap_ContourGen::Perform (const TheSurface& Surf,
148 const Handle(TheTopolTool)& Domain,
149 const gp_Vec& Direction,
150 const Standard_Real Angle)
151
152{
153 Init(Direction,Angle);
154 Perform(Surf,Domain);
155}
156
157
158void Contap_ContourGen::Perform (const TheSurface& Surf,
159 const Handle(TheTopolTool)& Domain,
160 const gp_Pnt& Eye)
161
162{
163 Init(Eye);
164 Perform(Surf,Domain);
165}
166
167