0031789: Coding Rules - remove redundant Standard_EXPORT from TKMesh
[occt.git] / src / BRepMeshData / BRepMeshData_Curve.cxx
CommitLineData
7bd071ed 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#include <BRepMeshData_Curve.hxx>
17#include <gp_Pnt.hxx>
18#include <BRepMesh_OrientedEdge.hxx>
19#include <BRepMesh_Vertex.hxx>
20
4945e8be 21IMPLEMENT_STANDARD_RTTIEXT(BRepMeshData_Curve, IMeshData_Curve)
22
7bd071ed 23//=======================================================================
24// Function: Constructor
25// Purpose :
26//=======================================================================
27BRepMeshData_Curve::BRepMeshData_Curve (const Handle (NCollection_IncAllocator)& theAllocator)
28: myPoints (NCollection_StdAllocator<gp_Pnt>(theAllocator)),
29 myParameters (NCollection_StdAllocator<Standard_Real>(theAllocator))
30{
31}
32
33//=======================================================================
34// Function: Destructor
35// Purpose :
36//=======================================================================
37BRepMeshData_Curve::~BRepMeshData_Curve ()
38{
39}
40
41//=======================================================================
42// Function: InsertPoint
43// Purpose :
44//=======================================================================
45void BRepMeshData_Curve::InsertPoint(
46 const Standard_Integer thePosition,
47 const gp_Pnt& thePoint,
48 const Standard_Real theParamOnPCurve)
49{
50 myPoints .insert(myPoints .begin() + thePosition, thePoint);
51 myParameters.insert(myParameters.begin() + thePosition, theParamOnPCurve);
52}
53
54//=======================================================================
55// Function: AddPoint
56// Purpose :
57//=======================================================================
58void BRepMeshData_Curve::AddPoint (
59 const gp_Pnt& thePoint,
60 const Standard_Real theParamOnPCurve)
61{
62 myPoints .push_back(thePoint);
63 myParameters.push_back(theParamOnPCurve);
64}
65
66//=======================================================================
67// Function: GetPoint
68// Purpose :
69//=======================================================================
70gp_Pnt& BRepMeshData_Curve::GetPoint (const Standard_Integer theIndex)
71{
72 return myPoints[theIndex];
73}
74
75//=======================================================================
76// Function: GetParameter
77// Purpose :
78//=======================================================================
79Standard_Real& BRepMeshData_Curve::GetParameter (const Standard_Integer theIndex)
80{
81 return myParameters[theIndex];
82}
83
84//=======================================================================
85// Function: ParameterNb
86// Purpose :
87//=======================================================================
88Standard_Integer BRepMeshData_Curve::ParametersNb() const
89{
90 return static_cast<Standard_Integer>(myParameters.size());
91}
92
93//=======================================================================
94// Function: RemovePoint
95// Purpose :
96//=======================================================================
97void BRepMeshData_Curve::RemovePoint (const Standard_Integer theIndex)
98{
99 myPoints.erase(myPoints.begin() + theIndex);
100 removeParameter (theIndex);
101}
102
103//=======================================================================
104// Function: removeParameter
105// Purpose :
106//=======================================================================
107void BRepMeshData_Curve::removeParameter (const Standard_Integer theIndex)
108{
109 myParameters.erase(myParameters.begin() + theIndex);
110}
111
112//=======================================================================
113// Function: Clear
114// Purpose :
115//=======================================================================
116void BRepMeshData_Curve::Clear(const Standard_Boolean isKeepEndPoints)
117{
118 if (!isKeepEndPoints)
119 {
120 myPoints .clear();
121 myParameters.clear();
122 }
123 else if (ParametersNb() > 2)
124 {
125 myPoints .erase(myPoints .begin() + 1, myPoints .begin() + (myPoints .size() - 1));
126 myParameters.erase(myParameters.begin() + 1, myParameters.begin() + (myParameters.size() - 1));
127 }
128}