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
25 // Constructs internal array of 3D points defined
26 // by number of points theNbPoints
27 Select3D_PointData (const Standard_Integer theNbPoints)
28 : mynbpoints(theNbPoints)
31 throw Standard_ConstructionError("Select3D_PointData");
33 mypolyg3d = new Select3D_Pnt[mynbpoints];
37 ~Select3D_PointData ()
42 // Sets Select3D_Pnt to internal array
43 // of 3D points if theIndex is valid
44 void SetPnt (const Standard_Integer theIndex,
45 const Select3D_Pnt& theValue)
47 if (theIndex < 0 || theIndex >= mynbpoints)
48 throw Standard_OutOfRange("Select3D_PointData::SetPnt");
49 mypolyg3d[theIndex] = theValue;
52 // Sets gp_Pnt to internal array
53 // of 3D points if theIndex is valid
54 void SetPnt (const Standard_Integer theIndex,
55 const gp_Pnt& theValue)
57 if (theIndex < 0 || theIndex >= mynbpoints)
58 throw Standard_OutOfRange("Select3D_PointData::SetPnt");
59 mypolyg3d[theIndex] = theValue;
62 // Returns 3D point from internal array
63 // if theIndex is valid
64 const Select3D_Pnt& Pnt (const Standard_Integer theIndex) const
66 if (theIndex < 0 || theIndex >= mynbpoints)
67 throw Standard_OutOfRange("Select3D_PointData::Pnt");
68 return mypolyg3d[theIndex];
71 // Returns 3D point from internal array
72 // if theIndex is valid
73 gp_Pnt Pnt3d (const Standard_Integer theIndex) const
75 if (theIndex < 0 || theIndex >= mynbpoints)
76 throw Standard_OutOfRange("Select3D_PointData::Pnt");
77 return mypolyg3d[theIndex];
80 // Returns size of internal arrays
81 Standard_Integer Size () const
87 Select3D_PointData (const Select3D_PointData&);
88 Select3D_PointData& operator= (const Select3D_PointData&);
92 Select3D_Pnt* mypolyg3d;
93 Standard_Integer mynbpoints;