Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/AppParCurves_MultiCurve.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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_MultiCurve_HeaderFile
0018 #define _AppParCurves_MultiCurve_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <AppParCurves_HArray1OfMultiPoint.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <AppParCurves_Array1OfMultiPoint.hxx>
0027 #include <TColgp_Array1OfPnt.hxx>
0028 #include <TColgp_Array1OfPnt2d.hxx>
0029 #include <Standard_Real.hxx>
0030 #include <Standard_OStream.hxx>
0031 class AppParCurves_MultiPoint;
0032 class gp_Pnt;
0033 class gp_Pnt2d;
0034 class gp_Vec;
0035 class gp_Vec2d;
0036 
0037 
0038 //! This class describes a MultiCurve approximating a Multiline.
0039 //! As a Multiline is a set of n lines, a MultiCurve is a set
0040 //! of n curves. These curves are Bezier curves.
0041 //! A MultiCurve is composed of m MultiPoint.
0042 //! The approximating degree of these n curves is the same for
0043 //! each one.
0044 //!
0045 //! Example of a MultiCurve composed of MultiPoints:
0046 //!
0047 //! P1______P2_____P3______P4________........_____PNbMPoints
0048 //!
0049 //! Q1______Q2_____Q3______Q4________........_____QNbMPoints
0050 //! .                                               .
0051 //! .                                               .
0052 //! .                                               .
0053 //! R1______R2_____R3______R4________........_____RNbMPoints
0054 //!
0055 //! Pi, Qi, ..., Ri are points of dimension 2 or 3.
0056 //!
0057 //! (Pi, Qi, ...Ri), i= 1,...NbPoles are MultiPoints.
0058 //! each MultiPoint has got NbPol Poles.
0059 class AppParCurves_MultiCurve 
0060 {
0061 public:
0062 
0063   DEFINE_STANDARD_ALLOC
0064 
0065   
0066   //! returns an indefinite MultiCurve.
0067   Standard_EXPORT AppParCurves_MultiCurve();
0068   
0069   //! creates a MultiCurve, describing Bezier curves all
0070   //! containing the same number of MultiPoint.
0071   //! An exception is raised if Degree < 0.
0072   Standard_EXPORT AppParCurves_MultiCurve(const Standard_Integer NbPol);
0073   
0074   //! creates a MultiCurve, describing Bezier curves all
0075   //! containing the same number of MultiPoint.
0076   //! Each MultiPoint must have NbCurves Poles.
0077   Standard_EXPORT AppParCurves_MultiCurve(const AppParCurves_Array1OfMultiPoint& tabMU);
0078   Standard_EXPORT virtual ~AppParCurves_MultiCurve();
0079   
0080   //! The number of poles of the MultiCurve
0081   //! will be set to <nbPoles>.
0082   Standard_EXPORT void SetNbPoles (const Standard_Integer nbPoles);
0083   
0084   //! sets the MultiPoint of range Index to the value
0085   //! <MPoint>.
0086   //! An exception is raised if Index <0 or Index >NbMPoint.
0087   Standard_EXPORT void SetValue (const Standard_Integer Index, const AppParCurves_MultiPoint& MPoint);
0088   
0089   //! Returns the number of curves resulting from the
0090   //! approximation of a MultiLine.
0091   Standard_EXPORT Standard_Integer NbCurves() const;
0092   
0093   //! Returns the number of poles on curves resulting from the approximation of a MultiLine.
0094   Standard_EXPORT virtual Standard_Integer NbPoles() const;
0095   
0096   //! returns the degree of the curves.
0097   Standard_EXPORT virtual Standard_Integer Degree() const;
0098   
0099   //! returns the dimension of the CuIndex curve.
0100   //! An exception is raised if CuIndex<0 or CuIndex>NbCurves.
0101   Standard_EXPORT Standard_Integer Dimension (const Standard_Integer CuIndex) const;
0102   
0103   //! returns the Pole array of the curve of range CuIndex.
0104   //! An exception is raised if the dimension of the curve
0105   //! is 2d.
0106   Standard_EXPORT void Curve (const Standard_Integer CuIndex, TColgp_Array1OfPnt& TabPnt) const;
0107   
0108   //! returns the Pole array of the curve of range CuIndex.
0109   //! An exception is raised if the dimension of the curve
0110   //! is 3d.
0111   Standard_EXPORT void Curve (const Standard_Integer CuIndex, TColgp_Array1OfPnt2d& TabPnt) const;
0112   
0113   //! returns the Index MultiPoint.
0114   //! An exception is raised if Index <0 or Index >Degree+1.
0115   Standard_EXPORT const AppParCurves_MultiPoint& Value (const Standard_Integer Index) const;
0116   
0117   //! returns the Nieme pole of the CuIndex curve.
0118   //! the curve must be a 3D curve.
0119   Standard_EXPORT const gp_Pnt& Pole (const Standard_Integer CuIndex, const Standard_Integer Nieme) const;
0120   
0121   //! returns the Nieme pole of the CuIndex curve.
0122   //! the curve must be a 2D curve.
0123   Standard_EXPORT const gp_Pnt2d& Pole2d (const Standard_Integer CuIndex, const Standard_Integer Nieme) const;
0124   
0125   //! Applies a transformation to the curve of range
0126   //! <CuIndex>.
0127   //! newx = x + dx*oldx
0128   //! newy = y + dy*oldy    for all points of the curve.
0129   //! newz = z + dz*oldz
0130   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);
0131   
0132   //! Applies a transformation to the Curve of range
0133   //! <CuIndex>.
0134   //! newx = x + dx*oldx
0135   //! newy = y + dy*oldy    for all points of the curve.
0136   Standard_EXPORT void Transform2d (const Standard_Integer CuIndex, const Standard_Real x, const Standard_Real dx, const Standard_Real y, const Standard_Real dy);
0137   
0138   //! returns the value of the point with a parameter U
0139   //! on the Bezier curve number CuIndex.
0140   //! An exception is raised if CuIndex <0 or > NbCurves.
0141   //! An exception is raised if the curve dimension is 2d.
0142   Standard_EXPORT virtual void Value (const Standard_Integer CuIndex, const Standard_Real U, gp_Pnt& Pt) const;
0143   
0144   //! returns the value of the point with a parameter U
0145   //! on the Bezier curve number CuIndex.
0146   //! An exception is raised if CuIndex <0 or > NbCurves.
0147   //! An exception is raised if the curve dimension is 3d.
0148   Standard_EXPORT virtual void Value (const Standard_Integer CuIndex, const Standard_Real U, gp_Pnt2d& Pt) const;
0149   
0150   //! returns the value of the point with a parameter U
0151   //! on the Bezier curve number CuIndex.
0152   //! An exception is raised if CuIndex <0 or > NbCurves.
0153   //! An exception is raised if the curve dimension is 3d.
0154   Standard_EXPORT virtual void D1 (const Standard_Integer CuIndex, const Standard_Real U, gp_Pnt& Pt, gp_Vec& V1) const;
0155   
0156   //! returns the value of the point with a parameter U
0157   //! on the Bezier curve number CuIndex.
0158   //! An exception is raised if CuIndex <0 or > NbCurves.
0159   //! An exception is raised if the curve dimension is 2d.
0160   Standard_EXPORT virtual void D1 (const Standard_Integer CuIndex, const Standard_Real U, gp_Pnt2d& Pt, gp_Vec2d& V1) const;
0161   
0162   //! returns the value of the point with a parameter U
0163   //! on the Bezier curve number CuIndex.
0164   //! An exception is raised if CuIndex <0 or > NbCurves.
0165   //! An exception is raised if the curve dimension is 3d.
0166   Standard_EXPORT virtual void D2 (const Standard_Integer CuIndex, const Standard_Real U, gp_Pnt& Pt, gp_Vec& V1, gp_Vec& V2) const;
0167   
0168   //! returns the value of the point with a parameter U
0169   //! on the Bezier curve number CuIndex.
0170   //! An exception is raised if CuIndex <0 or > NbCurves.
0171   //! An exception is raised if the curve dimension is 2d.
0172   Standard_EXPORT virtual void D2 (const Standard_Integer CuIndex, const Standard_Real U, gp_Pnt2d& Pt, gp_Vec2d& V1, gp_Vec2d& V2) const;
0173   
0174   //! Prints on the stream o information on the current
0175   //! state of the object.
0176   //! Is used to redefine the operator <<.
0177   Standard_EXPORT virtual void Dump (Standard_OStream& o) const;
0178 
0179 
0180 
0181 
0182 protected:
0183 
0184 
0185 
0186   Handle(AppParCurves_HArray1OfMultiPoint) tabPoint;
0187 
0188 
0189 private:
0190 
0191 
0192 
0193 
0194 
0195 };
0196 
0197 
0198 
0199 
0200 
0201 
0202 
0203 #endif // _AppParCurves_MultiCurve_HeaderFile