summaryrefslogtreecommitdiff
path: root/src/BRepSweep/BRepSweep_Prism.cxx
blob: 0f71f493034274870d0646a02acae556e222b468 (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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
// File:	BRepSweep_Prism.cxx
// Created:	Fri Jun 25 10:33:47 1993
// Author:	Laurent BOURESCHE
//		<lbo@phylox>

#include <BRepSweep_Prism.ixx>
#include <BRepSweep_Translation.hxx>
#include <Sweep_NumShape.hxx>

#include <gp_Trsf.hxx>
#include <Precision.hxx>
//=======================================================================
//function : BRepSweep_Prism
//purpose  : 
//=======================================================================

BRepSweep_Prism::BRepSweep_Prism
  (const TopoDS_Shape& S, 
   const gp_Vec& V,
   const Standard_Boolean C,
   const Standard_Boolean Canonize):
  myTranslation(S,
		NumShape(),
		Location(V),
		V,
		C,
		Canonize)
{
  Standard_ConstructionError_Raise_if
    (V.Magnitude()<=Precision::Confusion(),"BRepSweep_Prism::Constructor");
}

//=======================================================================
//function : BRepSweep_Prism
//purpose  : 
//=======================================================================

BRepSweep_Prism::BRepSweep_Prism
  (const TopoDS_Shape& S, 
   const gp_Dir& D, 
   const Standard_Boolean Inf,
   const Standard_Boolean C,
   const Standard_Boolean Canonize):
  myTranslation(S,
		NumShape(Inf),
		Location(D),
		D,
		C,
		Canonize)
{
}


//=======================================================================
//function : Shape
//purpose  : 
//=======================================================================

TopoDS_Shape  BRepSweep_Prism::Shape()
{
  return myTranslation.Shape();
}


//=======================================================================
//function : Shape
//purpose  : 
//=======================================================================

TopoDS_Shape  BRepSweep_Prism::Shape(const TopoDS_Shape& aGenS)
{
  return myTranslation.Shape(aGenS);
}


//=======================================================================
//function : FirstShape
//purpose  : 
//=======================================================================

TopoDS_Shape  BRepSweep_Prism::FirstShape()
{
  return myTranslation.FirstShape();
}


//=======================================================================
//function : FirstShape
//purpose  : 
//=======================================================================

TopoDS_Shape  BRepSweep_Prism::FirstShape(const TopoDS_Shape& aGenS)
{
  return myTranslation.FirstShape(aGenS);
}


//=======================================================================
//function : LastShape
//purpose  : 
//=======================================================================

TopoDS_Shape  BRepSweep_Prism::LastShape()
{
  return myTranslation.LastShape();
}


//=======================================================================
//function : LastShape
//purpose  : 
//=======================================================================

TopoDS_Shape  BRepSweep_Prism::LastShape(const TopoDS_Shape& aGenS)
{
  return myTranslation.LastShape(aGenS);
}


//=======================================================================
//function : Vec
//purpose  : 
//=======================================================================

gp_Vec BRepSweep_Prism::Vec()const
{
  return myTranslation.Vec();
}


//=======================================================================
//function : NumShape
//purpose  : 
//=======================================================================

Sweep_NumShape  BRepSweep_Prism::NumShape()const 
{
  return Sweep_NumShape(2,TopAbs_EDGE);
}


//=======================================================================
//function : NumShape
//purpose  : 
//=======================================================================

Sweep_NumShape  BRepSweep_Prism::NumShape(const Standard_Boolean Inf)const 
{
  Sweep_NumShape N;
  if(Inf){
    N.Init(0,TopAbs_EDGE,Standard_False,Standard_True,Standard_True);
  }
  else{
    N.Init(1,TopAbs_EDGE,Standard_False,Standard_False,Standard_True);
  }
  return N;
}


//=======================================================================
//function : Location
//purpose  : 
//=======================================================================

TopLoc_Location  BRepSweep_Prism::Location(const gp_Vec& V)const 
{
  gp_Trsf gpt;
  gpt.SetTranslation(V);
  TopLoc_Location L(gpt);
  return L;
}