Test for 0022778: Bug in BRepMesh
[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
4// Copyright (c) 1999-2012 OPEN CASCADE SAS
5//
6// The content of this file is subject to the Open CASCADE Technology Public
7// License Version 6.5 (the "License"). You may not use the content of this file
8// except in compliance with the License. Please obtain a copy of the License
9// at http://www.opencascade.org and read it completely before using this file.
10//
11// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13//
14// The Original Code and all software distributed under the License is
15// distributed on an "AS IS" basis, without warranty of any kind, and the
16// Initial Developer hereby disclaims all such warranties, including without
17// limitation, any warranties of merchantability, fitness for a particular
18// purpose or non-infringement. Please see the License for the specific terms
19// and conditions governing the rights and limitations under the License.
20
733a0e55 21
7fd59977 22#include <Standard_ConstructionError.hxx>
23
24
25Contap_ContourGen::Contap_ContourGen () :
26 done(Standard_False),modeset(Standard_False)
27{}
28
29Contap_ContourGen::Contap_ContourGen (const gp_Vec& Direction) :
30
31 done(Standard_False),modeset(Standard_True)
32{
33 mySFunc.Set(Direction);
34 myAFunc.Set(Direction);
35}
36
37
38Contap_ContourGen::Contap_ContourGen (const gp_Vec& Direction,
39 const Standard_Real Angle) :
40
41 done(Standard_False),modeset(Standard_True)
42{
43 mySFunc.Set(Direction,Angle);
44 myAFunc.Set(Direction,Angle);
45}
46
47Contap_ContourGen::Contap_ContourGen (const gp_Pnt& Eye) :
48
49 done(Standard_False),modeset(Standard_True)
50{
51 mySFunc.Set(Eye);
52 myAFunc.Set(Eye);
53}
54
55
56Contap_ContourGen::Contap_ContourGen (const TheSurface& Surf,
57 const Handle(TheTopolTool)& Domain,
58 const gp_Vec& Direction) :
59
60 done(Standard_False),modeset(Standard_True)
61{
62 Perform(Surf,Domain,Direction);
63}
64
65
66Contap_ContourGen::Contap_ContourGen (const TheSurface& Surf,
67 const Handle(TheTopolTool)& Domain,
68 const gp_Vec& Direction,
69 const Standard_Real Angle) :
70
71 done(Standard_False),modeset(Standard_True)
72{
73 Perform(Surf,Domain,Direction,Angle);
74}
75
76
77Contap_ContourGen::Contap_ContourGen (const TheSurface& Surf,
78 const Handle(TheTopolTool)& Domain,
79 const gp_Pnt& Eye) :
80
81 done(Standard_False),modeset(Standard_True)
82{
83 Perform(Surf,Domain,Eye);
84}
85
86
87void Contap_ContourGen::Init (const gp_Vec& Direction)
88
89{
90 done = Standard_False;
91 modeset = Standard_True;
92 mySFunc.Set(Direction);
93 myAFunc.Set(Direction);
94}
95
96
97void Contap_ContourGen::Init(const gp_Vec& Direction,
98 const Standard_Real Angle)
99{
100 done = Standard_False;
101 modeset = Standard_True;
102 mySFunc.Set(Direction,Angle);
103 myAFunc.Set(Direction,Angle);
104}
105
106void Contap_ContourGen::Init (const gp_Pnt& Eye)
107{
108 done = Standard_False;
109 modeset = Standard_True;
110 mySFunc.Set(Eye);
111 myAFunc.Set(Eye);
112}
113
114
115void Contap_ContourGen::Perform (const TheSurface& Surf,
116 const Handle(TheTopolTool)& Domain)
117{
118 if (!modeset) {Standard_ConstructionError::Raise();}
119 mySFunc.Set(Surf);
120 myAFunc.Set(Surf);
121
122 GeomAbs_SurfaceType typS = TheSurfaceTool::GetType(Surf);
123 switch (typS) {
124 case GeomAbs_Plane:
125 case GeomAbs_Sphere:
126 case GeomAbs_Cylinder:
127 case GeomAbs_Cone:
128 {
129 PerformAna(Domain); //Surf,Domain,Direction,0.,gp_Pnt(0.,0.,0.),1);
130 }
131 break;
132
133 default:
134 {
135 Perform(Domain); //Surf,Domain,Direction,0.,gp_Pnt(0.,0.,0.),1);
136 }
137 break;
138 }
139
140}
141
142
143void Contap_ContourGen::Perform (const TheSurface& Surf,
144 const Handle(TheTopolTool)& Domain,
145 const gp_Vec& Direction)
146
147{
148 Init(Direction);
149 Perform(Surf,Domain);
150}
151
152void Contap_ContourGen::Perform (const TheSurface& Surf,
153 const Handle(TheTopolTool)& Domain,
154 const gp_Vec& Direction,
155 const Standard_Real Angle)
156
157{
158 Init(Direction,Angle);
159 Perform(Surf,Domain);
160}
161
162
163void Contap_ContourGen::Perform (const TheSurface& Surf,
164 const Handle(TheTopolTool)& Domain,
165 const gp_Pnt& Eye)
166
167{
168 Init(Eye);
169 Perform(Surf,Domain);
170}
171
172