Commit | Line | Data |
---|---|---|
7fd59977 | 1 | // File: GC_MakeTrimmedCylinder.cxx |
2 | // Created: Fri Oct 2 16:38:49 1992 | |
3 | // Author: Remi GILET | |
4 | // <reg@topsn3> | |
5 | ||
6 | #include <GC_MakeTrimmedCylinder.ixx> | |
7 | #include <GC_MakeCylindricalSurface.hxx> | |
8 | #include <StdFail_NotDone.hxx> | |
9 | #include <Standard_NotImplemented.hxx> | |
10 | ||
11 | //========================================================================= | |
0d969553 Y |
12 | // Creation of a cylinder limited by three points <P1>, <P2> and <P3>. + |
13 | // the height og the resulting cylinder is the distance from <P1> to <P2>. + | |
14 | // The radius is the distance from <P3> to axis <P1P2>. + | |
7fd59977 | 15 | //========================================================================= |
16 | ||
17 | GC_MakeTrimmedCylinder::GC_MakeTrimmedCylinder(const gp_Pnt& P1 , | |
18 | const gp_Pnt& P2 , | |
19 | const gp_Pnt& P3 ) | |
20 | { | |
21 | GC_MakeCylindricalSurface Cyl(P1,P2,P3); | |
22 | TheError = Cyl.Status(); | |
23 | if (TheError == gce_Done) { | |
24 | TheCyl = new Geom_RectangularTrimmedSurface(Cyl.Value(),0.,2.*PI,0., | |
25 | P2.Distance(P1),Standard_True,Standard_True); | |
26 | } | |
27 | } | |
28 | ||
29 | //========================================================================= | |
0d969553 | 30 | // Creation of a cylinder limited by a circle and height. + |
7fd59977 | 31 | //========================================================================= |
32 | ||
33 | GC_MakeTrimmedCylinder::GC_MakeTrimmedCylinder(const gp_Circ& Circ , | |
34 | const Standard_Real Height ) { | |
35 | GC_MakeCylindricalSurface Cyl(Circ); | |
36 | TheError = Cyl.Status(); | |
37 | if (TheError == gce_Done) { | |
38 | TheCyl = new Geom_RectangularTrimmedSurface(Cyl.Value(),0.,2.*PI,0., | |
39 | Height,Standard_True,Standard_True); | |
40 | } | |
41 | } | |
42 | ||
43 | //========================================================================= | |
44 | //========================================================================= | |
45 | ||
46 | GC_MakeTrimmedCylinder::GC_MakeTrimmedCylinder(const gp_Ax1& A1 , | |
47 | const Standard_Real Radius , | |
48 | const Standard_Real Height ) { | |
49 | GC_MakeCylindricalSurface Cyl(A1,Radius); | |
50 | TheError = Cyl.Status(); | |
51 | if (TheError == gce_Done) { | |
52 | TheCyl = new Geom_RectangularTrimmedSurface(Cyl.Value(),0.,2.*PI,0., | |
53 | Height,Standard_True,Standard_True); | |
54 | } | |
55 | } | |
56 | ||
57 | GC_MakeTrimmedCylinder::GC_MakeTrimmedCylinder(const gp_Cylinder& , // Cyl, | |
58 | const gp_Pnt& , // P, | |
59 | const Standard_Real )//Height) | |
60 | { | |
61 | Standard_NotImplemented::Raise("GC_MakeTrimmedCylinder"); | |
62 | } | |
63 | ||
64 | GC_MakeTrimmedCylinder::GC_MakeTrimmedCylinder(const gp_Cylinder& , // Cyl, | |
65 | const gp_Pnt& , // P1, | |
66 | const gp_Pnt& ) // P2) | |
67 | { | |
68 | Standard_NotImplemented::Raise("GC_MakeTrimmedCylinder"); | |
69 | } | |
70 | ||
71 | const Handle(Geom_RectangularTrimmedSurface)& GC_MakeTrimmedCylinder:: | |
72 | Value() const | |
73 | { | |
74 | StdFail_NotDone_Raise_if(!TheError == gce_Done,""); | |
75 | return TheCyl; | |
76 | } | |
77 | ||
78 | const Handle(Geom_RectangularTrimmedSurface)& GC_MakeTrimmedCylinder:: | |
79 | Operator() const | |
80 | { | |
81 | return Value(); | |
82 | } | |
83 | ||
84 | GC_MakeTrimmedCylinder:: | |
85 | operator Handle(Geom_RectangularTrimmedSurface) () const | |
86 | { | |
87 | return Value(); | |
88 | } | |
89 |