Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-04 09:15:55

0001 // Created on: 1999-06-22
0002 // Created by: Roman LYGIN
0003 // Copyright (c) 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 _ShapeExtend_ComplexCurve_HeaderFile
0018 #define _ShapeExtend_ComplexCurve_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Geom_Curve.hxx>
0024 #include <GeomAbs_Shape.hxx>
0025 class gp_Trsf;
0026 
0027 //! Defines a curve which consists of several segments.
0028 //! Implements basic interface to it.
0029 class ShapeExtend_ComplexCurve : public Geom_Curve
0030 {
0031 
0032 public:
0033   //! Returns number of curves
0034   Standard_EXPORT virtual int NbCurves() const = 0;
0035 
0036   //! Returns curve given by its index
0037   Standard_EXPORT virtual const occ::handle<Geom_Curve>& Curve(const int index) const = 0;
0038 
0039   //! Returns number of the curve for the given parameter U
0040   //! and local parameter UOut for the found curve
0041   Standard_EXPORT virtual int LocateParameter(const double U, double& UOut) const = 0;
0042 
0043   //! Returns global parameter for the whole curve according
0044   //! to the segment and local parameter on it
0045   Standard_EXPORT virtual double LocalToGlobal(const int index, const double Ulocal) const = 0;
0046 
0047   //! Applies transformation to each curve
0048   Standard_EXPORT void Transform(const gp_Trsf& T) override;
0049 
0050   //! Returns 1 - U
0051   double ReversedParameter(const double U) const override;
0052 
0053   //! Returns 0
0054   double FirstParameter() const override;
0055 
0056   //! Returns 1
0057   double LastParameter() const override;
0058 
0059   //! Returns True if the curve is closed
0060   bool IsClosed() const override;
0061 
0062   //! Returns False
0063   bool IsPeriodic() const override;
0064 
0065   //! Returns GeomAbs_C0
0066   GeomAbs_Shape Continuity() const override;
0067 
0068   //! Returns False if N > 0
0069   bool IsCN(const int N) const override;
0070 
0071   //! Returns point at parameter U.
0072   //! Finds appropriate curve and local parameter on it.
0073   Standard_EXPORT gp_Pnt EvalD0(const double U) const override;
0074 
0075   Standard_EXPORT Geom_Curve::ResD1 EvalD1(const double U) const override;
0076 
0077   Standard_EXPORT Geom_Curve::ResD2 EvalD2(const double U) const override;
0078 
0079   Standard_EXPORT Geom_Curve::ResD3 EvalD3(const double U) const override;
0080 
0081   Standard_EXPORT gp_Vec EvalDN(const double U, const int N) const override;
0082 
0083   //! Returns scale factor for recomputing of deviatives.
0084   Standard_EXPORT virtual double GetScaleFactor(const int ind) const = 0;
0085 
0086   //! Checks geometrical connectivity of the curves, including
0087   //! closure (sets fields myClosed)
0088   Standard_EXPORT bool CheckConnectivity(const double Preci);
0089 
0090   DEFINE_STANDARD_RTTIEXT(ShapeExtend_ComplexCurve, Geom_Curve)
0091 
0092 protected:
0093   Standard_EXPORT ShapeExtend_ComplexCurve();
0094 
0095   //! Transform the derivative according to its order
0096   Standard_EXPORT void TransformDN(gp_Vec& V, const int ind, const int N) const;
0097 
0098   bool myClosed;
0099 };
0100 
0101 #include <ShapeExtend_ComplexCurve.lxx>
0102 
0103 #endif // _ShapeExtend_ComplexCurve_HeaderFile