1566a4d916a2c2fc88a1ccd2d6cb943ffbf37e47
[occt.git] / src / BRepMeshData / BRepMeshData_Curve.hxx
1 // Created on: 2016-04-07
2 // Copyright (c) 2016 OPEN CASCADE SAS
3 // Created by: Oleg AGASHIN
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 #ifndef _BRepMeshData_Curve_HeaderFile
17 #define _BRepMeshData_Curve_HeaderFile
18
19 #include <IMeshData_Curve.hxx>
20 #include <Standard_Type.hxx>
21 #include <NCollection_IncAllocator.hxx>
22 #include <IMeshData_Types.hxx>
23
24 //! Default implementation of curve data model entity.
25 class BRepMeshData_Curve : public IMeshData_Curve
26 {
27 public:
28
29   DEFINE_INC_ALLOC
30
31   //! Constructor.
32   Standard_EXPORT BRepMeshData_Curve (const Handle (NCollection_IncAllocator)& theAllocator);
33
34   //! Destructor.
35   Standard_EXPORT virtual ~BRepMeshData_Curve ();
36
37   //! Inserts new discretization point at the given position.
38   Standard_EXPORT virtual void InsertPoint(
39     const Standard_Integer thePosition,
40     const gp_Pnt&          thePoint,
41     const Standard_Real    theParamOnPCurve) Standard_OVERRIDE;
42
43   //! Adds new discretization point to pcurve.
44   Standard_EXPORT virtual void AddPoint (
45     const gp_Pnt&       thePoint,
46     const Standard_Real theParamOnCurve) Standard_OVERRIDE;
47
48   //! Returns discretization point with the given index.
49   Standard_EXPORT virtual gp_Pnt& GetPoint (const Standard_Integer theIndex) Standard_OVERRIDE;
50
51   //! Removes point with the given index.
52   Standard_EXPORT virtual void RemovePoint (const Standard_Integer theIndex) Standard_OVERRIDE;
53
54   //! Returns parameter with the given index.
55   Standard_EXPORT virtual Standard_Real& GetParameter (const Standard_Integer theIndex) Standard_OVERRIDE;
56
57   //! Returns number of parameters stored in curve.
58   Standard_EXPORT virtual Standard_Integer ParametersNb() const Standard_OVERRIDE;
59
60   //! Clears parameters list.
61   Standard_EXPORT virtual void Clear(const Standard_Boolean isKeepEndPoints) Standard_OVERRIDE;
62
63   DEFINE_STANDARD_RTTI_INLINE(BRepMeshData_Curve, IMeshData_Curve)
64
65 protected:
66
67   //! Removes parameter with the given index.
68   Standard_EXPORT virtual void removeParameter (const Standard_Integer theIndex) Standard_OVERRIDE;
69
70 private:
71
72   IMeshData::Model::SequenceOfPnt  myPoints;
73   IMeshData::Model::SequenceOfReal myParameters;
74 };
75
76 #endif