1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #ifndef _Select3D_PointData_HeaderFile
15 #define _Select3D_PointData_HeaderFile
17 #include <Select3D_Pnt.hxx>
19 // A framework for safe management of Select3D_SensitivePoly polygons of 3D points
20 class Select3D_PointData {
24 // Constructs internal array of 3D points defined
25 // by number of points theNbPoints
26 Select3D_PointData (const Standard_Integer theNbPoints)
27 : mynbpoints(theNbPoints)
30 Standard_ConstructionError::Raise("Select3D_PointData");
32 mypolyg3d = new Select3D_Pnt[mynbpoints];
36 ~Select3D_PointData ()
41 // Sets Select3D_Pnt to internal array
42 // of 3D points if theIndex is valid
43 void SetPnt (const Standard_Integer theIndex,
44 const Select3D_Pnt& theValue)
46 if (theIndex < 0 || theIndex >= mynbpoints)
47 Standard_OutOfRange::Raise("Select3D_PointData::SetPnt");
48 mypolyg3d[theIndex] = theValue;
51 // Sets gp_Pnt to internal array
52 // of 3D points if theIndex is valid
53 void SetPnt (const Standard_Integer theIndex,
54 const gp_Pnt& theValue)
56 if (theIndex < 0 || theIndex >= mynbpoints)
57 Standard_OutOfRange::Raise("Select3D_PointData::SetPnt");
58 mypolyg3d[theIndex] = theValue;
61 // Returns 3D point from internal array
62 // if theIndex is valid
63 Select3D_Pnt Pnt (const Standard_Integer theIndex) const
65 if (theIndex < 0 || theIndex >= mynbpoints)
66 Standard_OutOfRange::Raise("Select3D_PointData::Pnt");
67 return mypolyg3d[theIndex];
70 // Returns 3D point from internal array
71 // if theIndex is valid
72 gp_Pnt Pnt3d (const Standard_Integer theIndex) const
74 if (theIndex < 0 || theIndex >= mynbpoints)
75 Standard_OutOfRange::Raise("Select3D_PointData::Pnt");
76 return mypolyg3d[theIndex];
79 // Returns size of internal arrays
80 const Standard_Integer Size () const
86 Select3D_PointData (const Select3D_PointData&);
87 Select3D_PointData& operator= (const Select3D_PointData&);
91 Select3D_Pnt* mypolyg3d;
92 Standard_Integer mynbpoints;