Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-23 09:17:11

0001 // Created on: 1993-02-05
0002 // Created by: Jacques GOUSSARD
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 _Contap_TheSegmentOfTheSearch_HeaderFile
0018 #define _Contap_TheSegmentOfTheSearch_HeaderFile
0019 
0020 #include <Adaptor2d_Curve2d.hxx>
0021 #include <Contap_ThePathPointOfTheSearch.hxx>
0022 
0023 class Standard_DomainError;
0024 class Adaptor3d_HVertex;
0025 class Contap_ThePathPointOfTheSearch;
0026 
0027 class Contap_TheSegmentOfTheSearch
0028 {
0029 public:
0030   DEFINE_STANDARD_ALLOC
0031 
0032   //! Empty constructor.
0033   Standard_EXPORT Contap_TheSegmentOfTheSearch();
0034 
0035   //! Defines the concerned arc.
0036   void SetValue(const occ::handle<Adaptor2d_Curve2d>& A);
0037 
0038   //! Defines the first point or the last point,
0039   //! depending on the value of the boolean First.
0040   Standard_EXPORT void SetLimitPoint(const Contap_ThePathPointOfTheSearch& V, const bool First);
0041 
0042   //! Returns the geometric curve on the surface 's domain
0043   //! which is solution.
0044   const occ::handle<Adaptor2d_Curve2d>& Curve() const;
0045 
0046   //! Returns True if there is a vertex (ThePathPoint) defining
0047   //! the lowest valid parameter on the arc.
0048   bool HasFirstPoint() const;
0049 
0050   //! Returns the first point.
0051   const Contap_ThePathPointOfTheSearch& FirstPoint() const;
0052 
0053   //! Returns True if there is a vertex (ThePathPoint) defining
0054   //! the greatest valid parameter on the arc.
0055   bool HasLastPoint() const;
0056 
0057   //! Returns the last point.
0058   const Contap_ThePathPointOfTheSearch& LastPoint() const;
0059 
0060 private:
0061   occ::handle<Adaptor2d_Curve2d> arc;
0062   bool                           hasfp;
0063   Contap_ThePathPointOfTheSearch thefp;
0064   bool                           haslp;
0065   Contap_ThePathPointOfTheSearch thelp;
0066 };
0067 
0068 //=================================================================================================
0069 // Inline implementations
0070 //=================================================================================================
0071 
0072 inline void Contap_TheSegmentOfTheSearch::SetValue(const occ::handle<Adaptor2d_Curve2d>& A)
0073 {
0074   hasfp = false;
0075   haslp = false;
0076   arc   = A;
0077 }
0078 
0079 inline const occ::handle<Adaptor2d_Curve2d>& Contap_TheSegmentOfTheSearch::Curve() const
0080 {
0081   return arc;
0082 }
0083 
0084 inline bool Contap_TheSegmentOfTheSearch::HasFirstPoint() const
0085 {
0086   return hasfp;
0087 }
0088 
0089 inline const Contap_ThePathPointOfTheSearch& Contap_TheSegmentOfTheSearch::FirstPoint() const
0090 {
0091   if (!hasfp)
0092   {
0093     throw Standard_DomainError();
0094   }
0095   return thefp;
0096 }
0097 
0098 inline bool Contap_TheSegmentOfTheSearch::HasLastPoint() const
0099 {
0100   return haslp;
0101 }
0102 
0103 inline const Contap_ThePathPointOfTheSearch& Contap_TheSegmentOfTheSearch::LastPoint() const
0104 {
0105   if (!haslp)
0106   {
0107     throw Standard_DomainError();
0108   }
0109   return thelp;
0110 }
0111 
0112 #endif // _Contap_TheSegmentOfTheSearch_HeaderFile