Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-17 09:21:46

0001 // Created on: 1993-08-11
0002 // Created by: Remi LEQUETTE
0003 // Copyright (c) 1993-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _ProjLib_Projector_HeaderFile
0018 #define _ProjLib_Projector_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <GeomAbs_CurveType.hxx>
0025 #include <gp_Lin2d.hxx>
0026 #include <gp_Circ2d.hxx>
0027 #include <gp_Elips2d.hxx>
0028 #include <gp_Hypr2d.hxx>
0029 #include <gp_Parab2d.hxx>
0030 class Geom2d_BSplineCurve;
0031 class Geom2d_BezierCurve;
0032 class gp_Lin;
0033 class gp_Circ;
0034 class gp_Elips;
0035 class gp_Parab;
0036 class gp_Hypr;
0037 
0038 //! Root class for projection algorithms, stores the result.
0039 class ProjLib_Projector
0040 {
0041 public:
0042   DEFINE_STANDARD_ALLOC
0043 
0044   //! Sets the type to OtherCurve
0045   Standard_EXPORT ProjLib_Projector();
0046   Standard_EXPORT virtual ~ProjLib_Projector();
0047 
0048   Standard_EXPORT bool IsDone() const;
0049 
0050   //! Set isDone = true;
0051   Standard_EXPORT void Done();
0052 
0053   Standard_EXPORT GeomAbs_CurveType GetType() const;
0054 
0055   Standard_EXPORT void SetBSpline(const occ::handle<Geom2d_BSplineCurve>& C);
0056 
0057   Standard_EXPORT void SetBezier(const occ::handle<Geom2d_BezierCurve>& C);
0058 
0059   Standard_EXPORT void SetType(const GeomAbs_CurveType Type);
0060 
0061   Standard_EXPORT bool IsPeriodic() const;
0062 
0063   Standard_EXPORT void SetPeriodic();
0064 
0065   Standard_EXPORT const gp_Lin2d& Line() const;
0066 
0067   Standard_EXPORT const gp_Circ2d& Circle() const;
0068 
0069   Standard_EXPORT const gp_Elips2d& Ellipse() const;
0070 
0071   Standard_EXPORT const gp_Hypr2d& Hyperbola() const;
0072 
0073   Standard_EXPORT const gp_Parab2d& Parabola() const;
0074 
0075   Standard_EXPORT occ::handle<Geom2d_BezierCurve> Bezier() const;
0076 
0077   Standard_EXPORT occ::handle<Geom2d_BSplineCurve> BSpline() const;
0078 
0079   Standard_EXPORT virtual void Project(const gp_Lin& L);
0080 
0081   Standard_EXPORT virtual void Project(const gp_Circ& C);
0082 
0083   Standard_EXPORT virtual void Project(const gp_Elips& E);
0084 
0085   Standard_EXPORT virtual void Project(const gp_Parab& P);
0086 
0087   Standard_EXPORT virtual void Project(const gp_Hypr& H);
0088 
0089   //! Translates the 2d curve
0090   //! to set the part of the curve [CFirst, CLast]
0091   //! in the range [ UFirst, UFirst + Period [
0092   Standard_EXPORT void UFrame(const double CFirst,
0093                               const double CLast,
0094                               const double UFirst,
0095                               const double Period);
0096 
0097   //! Translates the 2d curve
0098   //! to set the part of the curve [CFirst, CLast]
0099   //! in the range [ VFirst, VFirst + Period [
0100   Standard_EXPORT void VFrame(const double CFirst,
0101                               const double CLast,
0102                               const double VFirst,
0103                               const double Period);
0104 
0105 protected:
0106   GeomAbs_CurveType                myType;
0107   gp_Lin2d                         myLin;
0108   gp_Circ2d                        myCirc;
0109   gp_Elips2d                       myElips;
0110   gp_Hypr2d                        myHypr;
0111   gp_Parab2d                       myParab;
0112   occ::handle<Geom2d_BSplineCurve> myBSpline;
0113   occ::handle<Geom2d_BezierCurve>  myBezier;
0114   bool                             myIsPeriodic;
0115   bool                             isDone;
0116 };
0117 
0118 #endif // _ProjLib_Projector_HeaderFile