0031642: Visualization - crash in Graphic3d_Structure::SetVisual() on redisplaying...
[occt.git] / src / BRepMeshData / BRepMeshData_PCurve.hxx
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#ifndef _BRepMeshData_PCurve_HeaderFile
17#define _BRepMeshData_PCurve_HeaderFile
18
19#include <IMeshData_PCurve.hxx>
20#include <Standard_Type.hxx>
21#include <NCollection_IncAllocator.hxx>
22
23//! Default implementation of pcurve data model entity.
24class BRepMeshData_PCurve : public IMeshData_PCurve
25{
26public:
27
28 DEFINE_INC_ALLOC
29
30 //! Constructor.
31 Standard_EXPORT BRepMeshData_PCurve (
32 const IMeshData::IFacePtr& theDFace,
33 const TopAbs_Orientation theOrientation,
34 const Handle (NCollection_IncAllocator)& theAllocator);
35
36 //! Destructor.
37 Standard_EXPORT virtual ~BRepMeshData_PCurve ();
38
39 //! Inserts new discretization point at the given position.
40 Standard_EXPORT virtual void InsertPoint(
41 const Standard_Integer thePosition,
42 const gp_Pnt2d& thePoint,
43 const Standard_Real theParamOnPCurve) Standard_OVERRIDE;
44
45 //! Adds new discretization point to pcurve.
46 Standard_EXPORT virtual void AddPoint (
47 const gp_Pnt2d& thePoint,
48 const Standard_Real theParamOnPCurve) Standard_OVERRIDE;
49
50 //! Returns discretization point with the given index.
51 Standard_EXPORT virtual gp_Pnt2d& GetPoint (const Standard_Integer theIndex) Standard_OVERRIDE;
52
53 //! Returns index in mesh corresponded to discretization point with the given index.
54 Standard_EXPORT virtual Standard_Integer& GetIndex(const Standard_Integer theIndex) Standard_OVERRIDE;
55
56 //! Removes point with the given index.
57 Standard_EXPORT virtual void RemovePoint (const Standard_Integer theIndex) Standard_OVERRIDE;
58
59 //! Returns parameter with the given index.
60 Standard_EXPORT virtual Standard_Real& GetParameter (const Standard_Integer theIndex) Standard_OVERRIDE;
61
62 //! Returns number of parameters stored in pcurve.
63 Standard_EXPORT virtual Standard_Integer ParametersNb() const Standard_OVERRIDE;
64
65 //! Clears parameters list.
66 Standard_EXPORT virtual void Clear(const Standard_Boolean isKeepEndPoints) Standard_OVERRIDE;
67
68 DEFINE_STANDARD_RTTI_INLINE(BRepMeshData_PCurve, IMeshData_PCurve)
69
70protected:
71
72 //! Removes parameter with the given index.
73 Standard_EXPORT virtual void removeParameter (const Standard_Integer theIndex) Standard_OVERRIDE;
74
75private:
76
77 IMeshData::Model::SequenceOfPnt2d myPoints2d;
78 IMeshData::Model::SequenceOfReal myParameters;
79 IMeshData::Model::SequenceOfInteger myIndices;
80};
81
82#endif