1 // Created on: 1993-01-09
2 // Created by: CKY / Contract Toubro-Larsen (Kiran)
3 // Copyright (c) 1993-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 #ifndef _IGESGeom_ConicArc_HeaderFile
18 #define _IGESGeom_ConicArc_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Standard_Real.hxx>
25 #include <IGESData_IGESEntity.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <Standard_Integer.hxx>
34 class IGESGeom_ConicArc;
35 DEFINE_STANDARD_HANDLE(IGESGeom_ConicArc, IGESData_IGESEntity)
37 //! defines IGESConicArc, Type <104> Form <0-3> in package IGESGeom
38 //! A conic arc is a bounded connected portion of a parent
39 //! conic curve which consists of more than one point. The
40 //! parent conic curve is either an ellipse, a parabola, or
41 //! a hyperbola. The definition space coordinate system is
42 //! always chosen so that the conic arc lies in a plane either
43 //! coincident with or parallel to XT, YT plane. Within such
44 //! a plane a conic is defined by the six coefficients in the
45 //! following equation.
46 //! A*XT^2 + B*XT*YT + C*YT^2 + D*XT + E*YT + F = 0
47 class IGESGeom_ConicArc : public IGESData_IGESEntity
53 Standard_EXPORT IGESGeom_ConicArc();
55 //! This method is used to set the fields of the class
57 //! - A, B, C, D, E, F : Coefficients of the equation
58 //! defining conic arc
59 //! - ZT : Parallel ZT displacement of the arc
60 //! from XT, YT plane.
61 //! - aStart : Starting point of the conic arc
62 //! - anEnd : End point of the conic arc
63 Standard_EXPORT void Init (const Standard_Real A, const Standard_Real B, const Standard_Real C, const Standard_Real D, const Standard_Real E, const Standard_Real F, const Standard_Real ZT, const gp_XY& aStart, const gp_XY& anEnd);
65 //! sets the Form Number equal to ComputedFormNumber,
66 //! returns True if changed
67 Standard_EXPORT Standard_Boolean OwnCorrect();
69 //! Computes the Form Number according to the equation
70 //! 1 for Ellipse, 2 for Hyperbola, 3 for Parabola
71 Standard_EXPORT Standard_Integer ComputedFormNumber() const;
73 Standard_EXPORT void Equation (Standard_Real& A, Standard_Real& B, Standard_Real& C, Standard_Real& D, Standard_Real& E, Standard_Real& F) const;
75 //! returns the Z displacement of the arc from XT, YT plane
76 Standard_EXPORT Standard_Real ZPlane() const;
78 //! returns the starting point of the arc
79 Standard_EXPORT gp_Pnt2d StartPoint() const;
81 //! returns the starting point of the arc after applying
83 Standard_EXPORT gp_Pnt TransformedStartPoint() const;
85 //! returns the end point of the arc
86 Standard_EXPORT gp_Pnt2d EndPoint() const;
88 //! returns the end point of the arc after applying
90 Standard_EXPORT gp_Pnt TransformedEndPoint() const;
92 //! returns True if parent conic curve is an ellipse
93 Standard_EXPORT Standard_Boolean IsFromEllipse() const;
95 //! returns True if parent conic curve is a parabola
96 Standard_EXPORT Standard_Boolean IsFromParabola() const;
98 //! returns True if parent conic curve is a hyperbola
99 Standard_EXPORT Standard_Boolean IsFromHyperbola() const;
101 //! returns True if StartPoint = EndPoint
102 Standard_EXPORT Standard_Boolean IsClosed() const;
104 //! Z-Axis of conic (i.e. [0,0,1])
105 Standard_EXPORT gp_Dir Axis() const;
107 //! Z-Axis after applying Trans. Matrix
108 Standard_EXPORT gp_Dir TransformedAxis() const;
110 //! Returns a Definition computed from equation, easier to use
111 //! <Center> : the center of the the conic (meaningless for
112 //! a parabola) (defined with Z displacement)
113 //! <MainAxis> : the Main Axis of the conic (for a Circle,
114 //! arbitrary the X Axis)
115 //! <Rmin,Rmax> : Minor and Major Radii of the conic
116 //! For a Circle, Rmin = Rmax,
117 //! For a Parabola, Rmin = Rmax = the Focal
118 //! Warning : the basic definition (by equation) is not very stable,
119 //! limit cases may be approximative
120 Standard_EXPORT void Definition (gp_Pnt& Center, gp_Dir& MainAxis, Standard_Real& rmin, Standard_Real& rmax) const;
122 //! Same as Definition, but the Location is applied on the
123 //! Center and the MainAxis
124 Standard_EXPORT void TransformedDefinition (gp_Pnt& Center, gp_Dir& MainAxis, Standard_Real& rmin, Standard_Real& rmax) const;
126 //! Computes and returns the coordinates of the definition of
127 //! a comic from its equation. Used by Definition &
128 //! TransformedDefinition, or may be called directly if needed
129 Standard_EXPORT void ComputedDefinition (Standard_Real& Xcen, Standard_Real& Ycen, Standard_Real& Xax, Standard_Real& Yax, Standard_Real& Rmin, Standard_Real& Rmax) const;
134 DEFINE_STANDARD_RTTIEXT(IGESGeom_ConicArc,IGESData_IGESEntity)
163 #endif // _IGESGeom_ConicArc_HeaderFile