SHAPER  9.12.0
GeomAPI_Curve.h
1 // Copyright (C) 2014-2023 CEA, EDF
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 #ifndef GeomAPI_Curve_H_
21 #define GeomAPI_Curve_H_
22 
23 #include <GeomAPI_Shape.h>
24 #include <memory>
25 
26 class GeomAPI_Pnt;
27 
34 {
35  public:
37  GEOMAPI_EXPORT
38  GeomAPI_Curve();
39 
41  GEOMAPI_EXPORT
42  GeomAPI_Curve(const std::shared_ptr<GeomAPI_Shape>& theShape);
43 
45  GEOMAPI_EXPORT
46  bool isNull() const;
47 
49  GEOMAPI_EXPORT
50  bool isEqual(const std::shared_ptr<GeomAPI_Curve>& theOther) const;
51 
53  GEOMAPI_EXPORT
54  virtual bool isLine() const;
55 
57  GEOMAPI_EXPORT
58  virtual bool isCircle() const;
59 
61  GEOMAPI_EXPORT
62  virtual bool isEllipse() const;
63 
65  GEOMAPI_EXPORT
66  double startParam();
67 
69  GEOMAPI_EXPORT
70  double endParam();
71 
73  GEOMAPI_EXPORT
74  virtual bool isTrimmed() const;
75 
77  GEOMAPI_EXPORT
78  virtual std::shared_ptr<GeomAPI_Curve> basisCurve() const;
79 
82  GEOMAPI_EXPORT
83  std::shared_ptr<GeomAPI_Pnt> getPoint(double theParam);
84 
86  GEOMAPI_EXPORT const std::shared_ptr<GeomAPI_Pnt> project(
87  const std::shared_ptr<GeomAPI_Pnt>& thePoint) const;
88 
89 public:
91  class Comparator
92  {
93  public:
95  GEOMAPI_EXPORT
96  bool operator ()(const std::shared_ptr<GeomAPI_Curve>& theCurve1,
97  const std::shared_ptr<GeomAPI_Curve>& theCurve2) const;
98  };
99 
100 private:
101  double myStart;
102  double myEnd;
103 };
104 
106 typedef std::shared_ptr<GeomAPI_Curve> GeomCurvePtr;
107 
108 #endif
Compare addresses of curves.
Definition: GeomAPI_Curve.h:92
GEOMAPI_EXPORT bool operator()(const std::shared_ptr< GeomAPI_Curve > &theCurve1, const std::shared_ptr< GeomAPI_Curve > &theCurve2) const
Return true if the address of the first curve is less than the address of the second.
Definition: GeomAPI_Curve.cpp:160
Interface to the generic curve object.
Definition: GeomAPI_Curve.h:34
GEOMAPI_EXPORT double endParam()
Returns end parameter of the curve.
Definition: GeomAPI_Curve.cpp:99
virtual GEOMAPI_EXPORT bool isTrimmed() const
Returns true if the curve is trimmed.
Definition: GeomAPI_Curve.cpp:123
GEOMAPI_EXPORT double startParam()
Returns start parameter of the curve.
Definition: GeomAPI_Curve.cpp:87
virtual GEOMAPI_EXPORT bool isCircle() const
Returns whether the curve is circular.
Definition: GeomAPI_Curve.cpp:77
GEOMAPI_EXPORT bool isNull() const
Returns true if curve is not initialized.
Definition: GeomAPI_Curve.cpp:57
virtual GEOMAPI_EXPORT bool isLine() const
Returns whether the curve is linear.
Definition: GeomAPI_Curve.cpp:72
GEOMAPI_EXPORT bool isEqual(const std::shared_ptr< GeomAPI_Curve > &theOther) const
Returns true if curves are equal.
Definition: GeomAPI_Curve.cpp:118
GEOMAPI_EXPORT GeomAPI_Curve()
Creation of empty (null) shape.
Definition: GeomAPI_Curve.cpp:37
virtual GEOMAPI_EXPORT bool isEllipse() const
Returns whether the curve is elliptic.
Definition: GeomAPI_Curve.cpp:82
GEOMAPI_EXPORT const std::shared_ptr< GeomAPI_Pnt > project(const std::shared_ptr< GeomAPI_Pnt > &thePoint) const
Project point on curve.
Definition: GeomAPI_Curve.cpp:140
virtual GEOMAPI_EXPORT std::shared_ptr< GeomAPI_Curve > basisCurve() const
Returns basis for the trimmed curve.
Definition: GeomAPI_Curve.cpp:128
GEOMAPI_EXPORT std::shared_ptr< GeomAPI_Pnt > getPoint(double theParam)
Returns point on the curve by parameter.
Definition: GeomAPI_Curve.cpp:111
General base class for all interfaces in this package.
Definition: GeomAPI_Interface.h:38
3D point defined by three coordinates
Definition: GeomAPI_Pnt.h:38