Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-23 09:17:03

0001 // Created by: Peter KURNEV
0002 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0003 //
0004 // This file is part of Open CASCADE Technology software library.
0005 //
0006 // This library is free software; you can redistribute it and/or modify it under
0007 // the terms of the GNU Lesser General Public License version 2.1 as published
0008 // by the Free Software Foundation, with special exception defined in the file
0009 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0010 // distribution for complete text of the license and disclaimer of any warranty.
0011 //
0012 // Alternatively, this file may be used under the terms of Open CASCADE
0013 // commercial license or contractual agreement.
0014 
0015 #ifndef _BOPDS_Pave_HeaderFile
0016 #define _BOPDS_Pave_HeaderFile
0017 
0018 #include <Standard.hxx>
0019 #include <Standard_DefineAlloc.hxx>
0020 #include <Standard_Handle.hxx>
0021 
0022 #include <Standard_Real.hxx>
0023 #include <Standard_Boolean.hxx>
0024 
0025 //! The class BOPDS_Pave is to store
0026 //! information about vertex on an edge
0027 class BOPDS_Pave
0028 {
0029 public:
0030   DEFINE_STANDARD_ALLOC
0031 
0032   //! Empty constructor
0033   BOPDS_Pave();
0034 
0035   //! Modifier
0036   //! Sets the index of vertex <theIndex>
0037   void SetIndex(const Standard_Integer theIndex);
0038 
0039   //! Selector
0040   //! Returns the index of vertex
0041   Standard_Integer Index() const;
0042 
0043   //! Modifier
0044   //! Sets the parameter of vertex <theParameter>
0045   void SetParameter(const Standard_Real theParameter);
0046 
0047   //! Selector
0048   //! Returns the parameter of vertex
0049   Standard_Real Parameter() const;
0050 
0051   //! Selector
0052   //! Returns the index of vertex <theIndex>
0053   //! Returns the parameter of vertex <theParameter>
0054   void Contents(Standard_Integer& theIndex, Standard_Real& theParameter) const;
0055 
0056   //! Query
0057   //! Returns true if thr parameter od this is less
0058   //! than the parameter of  <theOther>
0059   Standard_Boolean IsLess(const BOPDS_Pave& theOther) const;
0060 
0061   Standard_Boolean operator<(const BOPDS_Pave& theOther) const { return IsLess(theOther); }
0062 
0063   //! Query
0064   //! Returns true if thr parameter od this is equal
0065   //! to the parameter of  <theOther>
0066   Standard_Boolean IsEqual(const BOPDS_Pave& theOther) const;
0067 
0068   Standard_Boolean operator==(const BOPDS_Pave& theOther) const { return IsEqual(theOther); }
0069 
0070   Standard_EXPORT void Dump() const;
0071 
0072 protected:
0073   Standard_Integer myIndex;
0074   Standard_Real    myParameter;
0075 
0076 private:
0077 };
0078 
0079 namespace std
0080 {
0081 template <>
0082 struct hash<BOPDS_Pave>
0083 {
0084   size_t operator()(const BOPDS_Pave& thePave) const noexcept
0085   {
0086     size_t aCombination[2];
0087     aCombination[0] = opencascade::hash(thePave.Index());
0088     aCombination[1] = opencascade::hash(thePave.Parameter());
0089     return opencascade::hashBytes(aCombination, sizeof(aCombination));
0090   }
0091 };
0092 } // namespace std
0093 
0094 #include <BOPDS_Pave.lxx>
0095 
0096 #endif // _BOPDS_Pave_HeaderFile