summaryrefslogtreecommitdiff
path: root/src/BRepPrimAPI/BRepPrimAPI_MakePrism.cxx
blob: 4149c06991b0e631d38172912af5b3352ba791fd (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
// File:	BRepPrimAPI_MakePrism.cxx
// Created:	Thu Oct 14 14:45:45 1993
// Author:	Remi LEQUETTE
//		<rle@phylox>


// Modified by skv - Fri Mar  4 15:50:09 2005
// Add methods for supporting history.

#include <BRepPrimAPI_MakePrism.ixx>
#include <BRepLib.hxx>

// perform checks on the argument

static const TopoDS_Shape& check(const TopoDS_Shape& S)
{
 BRepLib::BuildCurves3d(S);
   return S;
}

//=======================================================================
//function : BRepPrimAPI_MakePrism
//purpose  : 
//=======================================================================

BRepPrimAPI_MakePrism::BRepPrimAPI_MakePrism(const TopoDS_Shape& S,
				     const gp_Vec& V, 
				     const Standard_Boolean Copy,
				     const Standard_Boolean Canonize) :
       myPrism(check(S),V,Copy,Canonize)
{
  Build();
}


//=======================================================================
//function : BRepPrimAPI_MakePrism
//purpose  : 
//=======================================================================

BRepPrimAPI_MakePrism::BRepPrimAPI_MakePrism(const TopoDS_Shape& S, 
				     const gp_Dir& D,
				     const Standard_Boolean Inf, 
				     const Standard_Boolean Copy,
				     const Standard_Boolean Canonize) :
       myPrism(check(S),D,Inf,Copy,Canonize)
{
  Build();
}


//=======================================================================
//function : Prism
//purpose  : 
//=======================================================================

const BRepSweep_Prism&  BRepPrimAPI_MakePrism::Prism()const 
{
  return myPrism;
}


//=======================================================================
//function : Build
//purpose  : 
//=======================================================================

void  BRepPrimAPI_MakePrism::Build()
{
  myShape = myPrism.Shape();
  Done();
}

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

TopoDS_Shape BRepPrimAPI_MakePrism::FirstShape()
{
  return myPrism.FirstShape();
}


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

TopoDS_Shape BRepPrimAPI_MakePrism::LastShape()
{
  return myPrism.LastShape();
}


//=======================================================================
//function : Generated
//purpose  : 
//=======================================================================

const TopTools_ListOfShape& BRepPrimAPI_MakePrism::Generated (const TopoDS_Shape& S)
{
  myGenerated.Clear();
  myGenerated.Append(myPrism.Shape (S));
  return myGenerated;

}


// Modified by skv - Fri Mar  4 15:50:09 2005 Begin

//=======================================================================
//function : FirstShape
//purpose  : This method returns the bottom shape of the prism, generated
//           with theShape (subShape of the generating shape)
//=======================================================================

TopoDS_Shape BRepPrimAPI_MakePrism::FirstShape(const TopoDS_Shape &theShape)
{
  return myPrism.FirstShape(theShape);
}


//=======================================================================
//function : LastShape
//purpose  : This method returns the top shape of the prism, generated
//           with theShape (subShape of the generating shape)
//=======================================================================

TopoDS_Shape BRepPrimAPI_MakePrism::LastShape(const TopoDS_Shape &theShape)
{
  return myPrism.LastShape(theShape);
}

// Modified by skv - Fri Mar  4 15:50:09 2005 End