Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-24 09:15:38

0001 // Created on: 2012-12-06
0002 // Created by: Sergey KHROMOV
0003 // Copyright (c) 2004-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _Extrema_POnSurfParams_HeaderFile
0017 #define _Extrema_POnSurfParams_HeaderFile
0018 
0019 #include <Extrema_ElementType.hxx>
0020 #include <Extrema_POnSurf.hxx>
0021 #include <Standard.hxx>
0022 #include <Standard_DefineAlloc.hxx>
0023 
0024 class gp_Pnt;
0025 
0026 //! Data container for point on surface parameters. These parameters
0027 //! are required to compute an initial approximation for extrema
0028 //! computation.
0029 class Extrema_POnSurfParams : public Extrema_POnSurf
0030 {
0031 public:
0032   DEFINE_STANDARD_ALLOC
0033 
0034   //! empty constructor
0035   Extrema_POnSurfParams()
0036       : mySqrDistance(0.),
0037         myElementType(Extrema_Node),
0038         myIndexU(0),
0039         myIndexV(0)
0040   {
0041   }
0042 
0043   //! Creation of a point on surface with parameter
0044   //! values on the surface and a Pnt from gp.
0045   Extrema_POnSurfParams(const double theU, const double theV, const gp_Pnt& thePnt)
0046       : Extrema_POnSurf(theU, theV, thePnt),
0047         mySqrDistance(0.),
0048         myElementType(Extrema_Node),
0049         myIndexU(0),
0050         myIndexV(0)
0051   {
0052   }
0053 
0054   //! Sets the square distance from this point to another one
0055   //! (e.g. to the point to be projected).
0056   void SetSqrDistance(const double theSqrDistance) { mySqrDistance = theSqrDistance; }
0057 
0058   //! Query the square distance from this point to another one.
0059   double GetSqrDistance() const { return mySqrDistance; }
0060 
0061   //! Sets the element type on which this point is situated.
0062   void SetElementType(const Extrema_ElementType theElementType) { myElementType = theElementType; }
0063 
0064   //! Query the element type on which this point is situated.
0065   Extrema_ElementType GetElementType() const { return myElementType; }
0066 
0067   //! Sets the U and V indices of an element that contains
0068   //! this point.
0069   void SetIndices(const int theIndexU, const int theIndexV)
0070   {
0071     myIndexU = theIndexU;
0072     myIndexV = theIndexV;
0073   }
0074 
0075   //! Query the U and V indices of an element that contains
0076   //! this point.
0077   void GetIndices(int& theIndexU, int& theIndexV) const
0078   {
0079     theIndexU = myIndexU;
0080     theIndexV = myIndexV;
0081   }
0082 
0083 private:
0084   double              mySqrDistance;
0085   Extrema_ElementType myElementType;
0086   int                 myIndexU;
0087   int                 myIndexV;
0088 };
0089 
0090 #endif // _Extrema_POnSurfParams_HeaderFile