1 -- Created on: 1992-09-28
2 -- Created by: Remi GILET
3 -- Copyright (c) 1992-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License 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.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 class MakeTrimmedCone from GC inherits Root from GC
19 --- Purpose: Implements construction algorithms for a trimmed
20 -- cone limited by two planes orthogonal to its axis. The
21 -- result is a Geom_RectangularTrimmedSurface surface.
22 -- A MakeTrimmedCone provides a framework for:
23 -- - defining the construction of the trimmed cone,
24 -- - implementing the construction algorithm, and
25 -- - consulting the results. In particular, the Value
26 -- function returns the constructed trimmed cone.
31 RectangularTrimmedSurface from Geom,
34 raises NotDone from StdFail
38 Create(P1,P2,P3,P4 : Pnt from gp ) returns MakeTrimmedCone;
39 ---Purpose: Make a RectangularTrimmedSurface <TheCone> from Geom
40 -- It is trimmed by P3 and P4.
41 -- Its axis is <P1P2> and the radius of its base is
42 -- the distance between <P3> and <P1P2>.
43 -- The distance between <P4> and <P1P2> is the radius of
44 -- the section passing through <P4>.
45 -- An error iss raised if <P1>,<P2>,<P3>,<P4> are
46 -- colinear or if <P3P4> is perpendicular to <P1P2> or
47 -- <P3P4> is colinear to <P1P2>.
49 Create(P1,P2 : Pnt from gp ;
50 R1,R2 : Real from Standard) returns MakeTrimmedCone;
51 ---Purpose : Make a RectangularTrimmedSurface from Geom <TheCone>
52 -- from a cone and trimmed by two points P1 and P2 and
53 -- the two radius <R1> and <R2> of the sections passing
54 -- through <P1> an <P2>.
56 -- If an error occurs (that is, when IsDone returns
57 -- false), the Status function returns:
58 -- - gce_ConfusedPoints if points P1 and P2, or P3 and P4, are coincident;
59 -- - gce_NullAngle if:
60 -- - the lines joining P1 to P2 and P3 to P4 are parallel, or
61 -- - R1 and R2 are equal (i.e. their difference is less than gp::Resolution());
62 -- - gce_NullRadius if:
63 -- - the line joining P1 to P2 is perpendicular to the line joining P3 to P4, or
64 -- - the points P1, P2, P3 and P4 are collinear;
65 -- - gce_NegativeRadius if R1 or R2 is negative; or
66 -- - gce_NullAxis if points P1 and P2 are coincident (2nd syntax only).
68 Value(me) returns RectangularTrimmedSurface from Geom
71 ---Purpose: Returns the constructed trimmed cone.
72 -- StdFail_NotDone if no trimmed cone is constructed.
75 Operator(me) returns RectangularTrimmedSurface from Geom
78 ---C++: alias "Standard_EXPORT operator Handle_Geom_RectangularTrimmedSurface() const;"
82 TheCone : RectangularTrimmedSurface from Geom;
83 --The solution from Geom.