1 // Created on: 1991-12-02
2 // Created by: Laurent PAINNOT
3 // Copyright (c) 1991-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _AppParCurves_MultiPoint_HeaderFile
18 #define _AppParCurves_MultiPoint_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Integer.hxx>
25 #include <TColgp_Array1OfPnt.hxx>
26 #include <TColgp_Array1OfPnt2d.hxx>
27 #include <Standard_Real.hxx>
28 #include <Standard_OStream.hxx>
30 class Standard_OutOfRange;
31 class Standard_DimensionError;
36 //! This class describes Points composing a MultiPoint.
37 //! These points can be 2D or 3D. The user must first give the
38 //! 3D Points and then the 2D Points.
39 //! They are Poles of a Bezier Curve.
40 //! This class is used either to define data input or
41 //! results when performing the approximation of several lines in parallel.
42 class AppParCurves_MultiPoint
49 //! creates an indefinite MultiPoint.
50 Standard_EXPORT AppParCurves_MultiPoint();
52 //! constructs a set of Points used to approximate a
54 //! These Points can be of 2 or 3 dimensions.
55 //! Points will be initialized with SetPoint and SetPoint2d.
56 //! NbPoints is the number of 3D Points.
57 //! NbPoints2d is the number of 2D Points.
58 Standard_EXPORT AppParCurves_MultiPoint(const Standard_Integer NbPoints, const Standard_Integer NbPoints2d);
60 //! creates a MultiPoint only composed of 3D points.
61 Standard_EXPORT AppParCurves_MultiPoint(const TColgp_Array1OfPnt& tabP);
63 //! creates a MultiPoint only composed of 2D points.
64 Standard_EXPORT AppParCurves_MultiPoint(const TColgp_Array1OfPnt2d& tabP2d);
66 //! constructs a set of Points used to approximate a
68 //! These Points can be of 2 or 3 dimensions.
69 //! Points will be initialized with SetPoint and SetPoint2d.
70 //! NbPoints is the total number of Points.
71 Standard_EXPORT AppParCurves_MultiPoint(const TColgp_Array1OfPnt& tabP, const TColgp_Array1OfPnt2d& tabP2d);
72 Standard_EXPORT virtual ~AppParCurves_MultiPoint();
74 //! the 3d Point of range Index of this MultiPoint is
76 //! An exception is raised if Index < 0 or
77 //! Index > number of 3d Points.
78 Standard_EXPORT void SetPoint (const Standard_Integer Index, const gp_Pnt& Point);
80 //! returns the 3d Point of range Index.
81 //! An exception is raised if Index < 0 or
82 //! Index < number of 3d Points.
83 Standard_EXPORT const gp_Pnt& Point (const Standard_Integer Index) const;
85 //! The 2d Point of range Index is set to <Point>.
86 //! An exception is raised if Index > 3d Points or
87 //! Index > total number of Points.
88 Standard_EXPORT void SetPoint2d (const Standard_Integer Index, const gp_Pnt2d& Point);
90 //! returns the 2d Point of range Index.
91 //! An exception is raised if index <= number of
92 //! 3d Points or Index > total number of Points.
93 Standard_EXPORT const gp_Pnt2d& Point2d (const Standard_Integer Index) const;
95 //! returns the dimension of the point of range Index.
96 //! An exception is raised if Index <0 or Index > NbCurves.
97 Standard_Integer Dimension (const Standard_Integer Index) const;
99 //! returns the number of points of dimension 3D.
100 Standard_Integer NbPoints() const;
102 //! returns the number of points of dimension 2D.
103 Standard_Integer NbPoints2d() const;
105 //! Applies a transformation to the curve of range
107 //! newx = x + dx*oldx
108 //! newy = y + dy*oldy for all points of the curve.
109 //! newz = z + dz*oldz
110 Standard_EXPORT void Transform (const Standard_Integer CuIndex, const Standard_Real x, const Standard_Real dx, const Standard_Real y, const Standard_Real dy, const Standard_Real z, const Standard_Real dz);
112 //! Applies a transformation to the Curve of range
114 //! newx = x + dx*oldx
115 //! newy = y + dy*oldy for all points of the curve.
116 Standard_EXPORT void Transform2d (const Standard_Integer CuIndex, const Standard_Real x, const Standard_Real dx, const Standard_Real y, const Standard_Real dy);
118 //! Prints on the stream o information on the current
119 //! state of the object.
120 //! Is used to redefine the operator <<.
121 Standard_EXPORT virtual void Dump (Standard_OStream& o) const;
130 Handle(MMgt_TShared) ttabPoint;
131 Handle(MMgt_TShared) ttabPoint2d;
132 Standard_Integer nbP;
133 Standard_Integer nbP2d;
145 #include <AppParCurves_MultiPoint.lxx>
151 #endif // _AppParCurves_MultiPoint_HeaderFile