Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-30 09:26:28

0001 // Created on: 1991-12-02
0002 // Created by: Laurent PAINNOT
0003 // Copyright (c) 1991-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _AppParCurves_MultiPoint_HeaderFile
0018 #define _AppParCurves_MultiPoint_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Integer.hxx>
0025 #include <gp_Pnt.hxx>
0026 #include <NCollection_Array1.hxx>
0027 #include <gp_Pnt2d.hxx>
0028 #include <Standard_Real.hxx>
0029 #include <Standard_OStream.hxx>
0030 class Standard_Transient;
0031 class gp_Pnt;
0032 class gp_Pnt2d;
0033 
0034 //! This class describes Points composing a MultiPoint.
0035 //! These points can be 2D or 3D. The user must first give the
0036 //! 3D Points and then the 2D Points.
0037 //! They are Poles of a Bezier Curve.
0038 //! This class is used either to define data input or
0039 //! results when performing the approximation of several lines in parallel.
0040 class AppParCurves_MultiPoint
0041 {
0042 public:
0043   DEFINE_STANDARD_ALLOC
0044 
0045   //! creates an indefinite MultiPoint.
0046   Standard_EXPORT AppParCurves_MultiPoint();
0047 
0048   //! constructs a set of Points used to approximate a
0049   //! Multiline.
0050   //! These Points can be of 2 or 3 dimensions.
0051   //! Points will be initialized with SetPoint and SetPoint2d.
0052   //! NbPoints is the number of 3D Points.
0053   //! NbPoints2d is the number of 2D Points.
0054   Standard_EXPORT AppParCurves_MultiPoint(const int NbPoints, const int NbPoints2d);
0055 
0056   //! creates a MultiPoint only composed of 3D points.
0057   Standard_EXPORT AppParCurves_MultiPoint(const NCollection_Array1<gp_Pnt>& tabP);
0058 
0059   //! creates a MultiPoint only composed of 2D points.
0060   Standard_EXPORT AppParCurves_MultiPoint(const NCollection_Array1<gp_Pnt2d>& tabP2d);
0061 
0062   //! constructs a set of Points used to approximate a
0063   //! Multiline.
0064   //! These Points can be of 2 or 3 dimensions.
0065   //! Points will be initialized with SetPoint and SetPoint2d.
0066   //! NbPoints is the total number of Points.
0067   Standard_EXPORT AppParCurves_MultiPoint(const NCollection_Array1<gp_Pnt>&   tabP,
0068                                           const NCollection_Array1<gp_Pnt2d>& tabP2d);
0069   Standard_EXPORT virtual ~AppParCurves_MultiPoint();
0070 
0071   //! the 3d Point of range Index of this MultiPoint is
0072   //! set to <Point>.
0073   //! An exception is raised if Index < 0 or
0074   //! Index > number of 3d Points.
0075   Standard_EXPORT void SetPoint(const int Index, const gp_Pnt& Point);
0076 
0077   //! returns the 3d Point of range Index.
0078   //! An exception is raised if Index < 0 or
0079   //! Index < number of 3d Points.
0080   Standard_EXPORT const gp_Pnt& Point(const int Index) const;
0081 
0082   //! The 2d Point of range Index is set to <Point>.
0083   //! An exception is raised if Index > 3d Points or
0084   //! Index > total number of Points.
0085   Standard_EXPORT void SetPoint2d(const int Index, const gp_Pnt2d& Point);
0086 
0087   //! returns the 2d Point of range Index.
0088   //! An exception is raised if index <= number of
0089   //! 3d Points or Index > total number of Points.
0090   Standard_EXPORT const gp_Pnt2d& Point2d(const int Index) const;
0091 
0092   //! returns the dimension of the point of range Index.
0093   //! An exception is raised if Index <0 or Index > NbCurves.
0094   int Dimension(const int Index) const;
0095 
0096   //! returns the number of points of dimension 3D.
0097   int NbPoints() const;
0098 
0099   //! returns the number of points of dimension 2D.
0100   int NbPoints2d() const;
0101 
0102   //! Applies a transformation to the curve of range
0103   //! <CuIndex>.
0104   //! newx = x + dx*oldx
0105   //! newy = y + dy*oldy    for all points of the curve.
0106   //! newz = z + dz*oldz
0107   Standard_EXPORT void Transform(const int    CuIndex,
0108                                  const double x,
0109                                  const double dx,
0110                                  const double y,
0111                                  const double dy,
0112                                  const double z,
0113                                  const double dz);
0114 
0115   //! Applies a transformation to the Curve of range
0116   //! <CuIndex>.
0117   //! newx = x + dx*oldx
0118   //! newy = y + dy*oldy    for all points of the curve.
0119   Standard_EXPORT void Transform2d(const int    CuIndex,
0120                                    const double x,
0121                                    const double dx,
0122                                    const double y,
0123                                    const double dy);
0124 
0125   //! Prints on the stream o information on the current
0126   //! state of the object.
0127   //! Is used to redefine the operator <<.
0128   Standard_EXPORT virtual void Dump(Standard_OStream& o) const;
0129 
0130 protected:
0131   occ::handle<Standard_Transient> ttabPoint;
0132   occ::handle<Standard_Transient> ttabPoint2d;
0133   int                             nbP;
0134   int                             nbP2d;
0135 };
0136 
0137 #include <AppParCurves_MultiPoint.lxx>
0138 
0139 #endif // _AppParCurves_MultiPoint_HeaderFile