Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:00

0001 // Created on: 1993-01-09
0002 // Created by: CKY / Contract Toubro-Larsen ( Kiran )
0003 // Copyright (c) 1993-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 _IGESGeom_BSplineSurface_HeaderFile
0018 #define _IGESGeom_BSplineSurface_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Standard_Integer.hxx>
0024 #include <TColStd_HArray1OfReal.hxx>
0025 #include <TColStd_HArray2OfReal.hxx>
0026 #include <TColgp_HArray2OfXYZ.hxx>
0027 #include <IGESData_IGESEntity.hxx>
0028 class gp_Pnt;
0029 
0030 
0031 class IGESGeom_BSplineSurface;
0032 DEFINE_STANDARD_HANDLE(IGESGeom_BSplineSurface, IGESData_IGESEntity)
0033 
0034 //! defines IGESBSplineSurface, Type <128> Form <0-9>
0035 //! in package IGESGeom
0036 //! A parametric equation obtained by dividing two summations
0037 //! involving weights (which are real numbers), the control
0038 //! points, and B-Spline basis functions
0039 class IGESGeom_BSplineSurface : public IGESData_IGESEntity
0040 {
0041 
0042 public:
0043 
0044   
0045   Standard_EXPORT IGESGeom_BSplineSurface();
0046   
0047   //! This method is used to set the fields of the class
0048   //! BSplineSurface
0049   //! - anIndexU             : Upper index of first sum
0050   //! - anIndexV             : Upper index of second sum
0051   //! - aDegU, aDegV         : Degrees of first and second sets
0052   //! of basis functions
0053   //! - aCloseU, aCloseV     : 1 = Closed in U, V directions
0054   //! 0 = open in U, V directions
0055   //! - aPolynom             : 0 = Rational, 1 = polynomial
0056   //! - aPeriodU, aPeriodV   : 0 = Non periodic in U or V direction
0057   //! 1 = Periodic in U or V direction
0058   //! - allKnotsU, allKnotsV : Knots in U and V directions
0059   //! - allWeights           : Array of weights
0060   //! - allPoles             : XYZ coordinates of all control points
0061   //! - aUmin                : Starting value of U direction
0062   //! - aUmax                : Ending value of U direction
0063   //! - aVmin                : Starting value of V direction
0064   //! - aVmax                : Ending value of V direction
0065   //! raises exception if allWeights & allPoles are not of same size.
0066   Standard_EXPORT void Init (const Standard_Integer anIndexU, const Standard_Integer anIndexV, const Standard_Integer aDegU, const Standard_Integer aDegV, const Standard_Boolean aCloseU, const Standard_Boolean aCloseV, const Standard_Boolean aPolynom, const Standard_Boolean aPeriodU, const Standard_Boolean aPeriodV, const Handle(TColStd_HArray1OfReal)& allKnotsU, const Handle(TColStd_HArray1OfReal)& allKnotsV, const Handle(TColStd_HArray2OfReal)& allWeights, const Handle(TColgp_HArray2OfXYZ)& allPoles, const Standard_Real aUmin, const Standard_Real aUmax, const Standard_Real aVmin, const Standard_Real aVmax);
0067   
0068   //! Changes FormNumber (indicates the Shape of the Surface)
0069   //! Error if not in range [0-9]
0070   Standard_EXPORT void SetFormNumber (const Standard_Integer form);
0071   
0072   //! returns the upper index of the first sum (U)
0073   Standard_EXPORT Standard_Integer UpperIndexU() const;
0074   
0075   //! returns the upper index of the second sum (V)
0076   Standard_EXPORT Standard_Integer UpperIndexV() const;
0077   
0078   //! returns degree of first set of basis functions
0079   Standard_EXPORT Standard_Integer DegreeU() const;
0080   
0081   //! returns degree of second set of basis functions
0082   Standard_EXPORT Standard_Integer DegreeV() const;
0083   
0084   //! True if closed in U direction else False
0085   Standard_EXPORT Standard_Boolean IsClosedU() const;
0086   
0087   //! True if closed in V direction else False
0088   Standard_EXPORT Standard_Boolean IsClosedV() const;
0089   
0090   //! True if polynomial, False if rational
0091   //! <flag> False (D) : computed from Weights
0092   //! <flag> True : recorded
0093   Standard_EXPORT Standard_Boolean IsPolynomial (const Standard_Boolean flag = Standard_False) const;
0094   
0095   //! True if periodic in U direction else False
0096   Standard_EXPORT Standard_Boolean IsPeriodicU() const;
0097   
0098   //! True if periodic in V direction else False
0099   Standard_EXPORT Standard_Boolean IsPeriodicV() const;
0100   
0101   //! returns number of knots in U direction
0102   //! KnotsU are numbered from -DegreeU
0103   Standard_EXPORT Standard_Integer NbKnotsU() const;
0104   
0105   //! returns number of knots in V direction
0106   //! KnotsV are numbered from -DegreeV
0107   Standard_EXPORT Standard_Integer NbKnotsV() const;
0108   
0109   //! returns the value of knot referred to by anIndex in U direction
0110   //! raises exception if
0111   //! anIndex < -DegreeU() or anIndex > (NbKnotsU() - DegreeU())
0112   Standard_EXPORT Standard_Real KnotU (const Standard_Integer anIndex) const;
0113   
0114   //! returns the value of knot referred to by anIndex in V direction
0115   //! raises exception if
0116   //! anIndex < -DegreeV() or anIndex > (NbKnotsV() - DegreeV())
0117   Standard_EXPORT Standard_Real KnotV (const Standard_Integer anIndex) const;
0118   
0119   //! returns number of poles in U direction
0120   Standard_EXPORT Standard_Integer NbPolesU() const;
0121   
0122   //! returns number of poles in V direction
0123   Standard_EXPORT Standard_Integer NbPolesV() const;
0124   
0125   //! returns the weight referred to by anIndex1, anIndex2
0126   //! raises exception if anIndex1 <= 0 or anIndex1 > NbPolesU()
0127   //! or if anIndex2 <= 0 or anIndex2 > NbPolesV()
0128   Standard_EXPORT Standard_Real Weight (const Standard_Integer anIndex1, const Standard_Integer anIndex2) const;
0129   
0130   //! returns the control point referenced by anIndex1, anIndex2
0131   //! raises exception if anIndex1 <= 0 or anIndex1 > NbPolesU()
0132   //! or if anIndex2 <= 0 or anIndex2 > NbPolesV()
0133   Standard_EXPORT gp_Pnt Pole (const Standard_Integer anIndex1, const Standard_Integer anIndex2) const;
0134   
0135   //! returns the control point referenced by anIndex1, anIndex2
0136   //! after applying the Transf.Matrix
0137   //! raises exception if anIndex1 <= 0 or anIndex1 > NbPolesU()
0138   //! or if anIndex2 <= 0 or anIndex2 > NbPolesV()
0139   Standard_EXPORT gp_Pnt TransformedPole (const Standard_Integer anIndex1, const Standard_Integer anIndex2) const;
0140   
0141   //! returns starting value in the U direction
0142   Standard_EXPORT Standard_Real UMin() const;
0143   
0144   //! returns ending value in the U direction
0145   Standard_EXPORT Standard_Real UMax() const;
0146   
0147   //! returns starting value in the V direction
0148   Standard_EXPORT Standard_Real VMin() const;
0149   
0150   //! returns ending value in the V direction
0151   Standard_EXPORT Standard_Real VMax() const;
0152 
0153 
0154 
0155 
0156   DEFINE_STANDARD_RTTIEXT(IGESGeom_BSplineSurface,IGESData_IGESEntity)
0157 
0158 protected:
0159 
0160 
0161 
0162 
0163 private:
0164 
0165 
0166   Standard_Integer theIndexU;
0167   Standard_Integer theIndexV;
0168   Standard_Integer theDegreeU;
0169   Standard_Integer theDegreeV;
0170   Standard_Boolean isClosedU;
0171   Standard_Boolean isClosedV;
0172   Standard_Boolean isPolynomial;
0173   Standard_Boolean isPeriodicU;
0174   Standard_Boolean isPeriodicV;
0175   Handle(TColStd_HArray1OfReal) theKnotsU;
0176   Handle(TColStd_HArray1OfReal) theKnotsV;
0177   Handle(TColStd_HArray2OfReal) theWeights;
0178   Handle(TColgp_HArray2OfXYZ) thePoles;
0179   Standard_Real theUmin;
0180   Standard_Real theUmax;
0181   Standard_Real theVmin;
0182   Standard_Real theVmax;
0183 
0184 
0185 };
0186 
0187 
0188 
0189 
0190 
0191 
0192 
0193 #endif // _IGESGeom_BSplineSurface_HeaderFile