Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1992-03-05
0002 // Created by: Laurent BUCHARD
0003 // Copyright (c) 1992-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 _IntRes2d_Domain_HeaderFile
0018 #define _IntRes2d_Domain_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <gp_Pnt2d.hxx>
0025 #include <Standard_Boolean.hxx>
0026 
0027 
0028 //! Definition of the domain of parameter on a 2d-curve.
0029 //! Most of the time, a domain is defined by two extremities.
0030 //! An extremity is made of :
0031 //! - a point in 2d-space (Pnt2d from gp),
0032 //! - a parameter on the curve,
0033 //! - a tolerance in the 2d-space.
0034 //! Sometimes, it can be made of 0 or 1 point ( for an infinite
0035 //! or semi-infinite line for example).
0036 //!
0037 //! For Intersection algorithms, Ellipses and Circles
0038 //! Domains must be closed.
0039 //! So, SetEquivalentParameters(.,.) method must be called
0040 //! after initializing the first and the last bounds.
0041 class IntRes2d_Domain 
0042 {
0043 public:
0044 
0045   DEFINE_STANDARD_ALLOC
0046 
0047   
0048   //! Creates an infinite Domain (HasFirstPoint = False
0049   //! and HasLastPoint = False).
0050   Standard_EXPORT IntRes2d_Domain();
0051   
0052   //! Creates a bounded Domain.
0053   Standard_EXPORT IntRes2d_Domain(const gp_Pnt2d& Pnt1, const Standard_Real Par1, const Standard_Real Tol1, const gp_Pnt2d& Pnt2, const Standard_Real Par2, const Standard_Real Tol2);
0054   
0055   //! Creates a semi-infinite Domain. If First is set to
0056   //! True, the given point is the first point of the domain,
0057   //! otherwise it is the last point.
0058   Standard_EXPORT IntRes2d_Domain(const gp_Pnt2d& Pnt, const Standard_Real Par, const Standard_Real Tol, const Standard_Boolean First);
0059   
0060   //! Sets the values for a bounded domain.
0061   Standard_EXPORT void SetValues (const gp_Pnt2d& Pnt1, const Standard_Real Par1, const Standard_Real Tol1, const gp_Pnt2d& Pnt2, const Standard_Real Par2, const Standard_Real Tol2);
0062   
0063   //! Sets the values for an infinite domain.
0064   Standard_EXPORT void SetValues();
0065   
0066   //! Sets the values for a semi-infinite domain.
0067   Standard_EXPORT void SetValues (const gp_Pnt2d& Pnt, const Standard_Real Par, const Standard_Real Tol, const Standard_Boolean First);
0068   
0069   //! Defines a closed domain.
0070     void SetEquivalentParameters (const Standard_Real zero, const Standard_Real period);
0071   
0072   //! Returns True if the domain has a first point, i-e
0073   //! a point defining the lowest admitted parameter on the
0074   //! curve.
0075     Standard_Boolean HasFirstPoint() const;
0076   
0077   //! Returns the parameter of the first point of the domain
0078   //! The exception DomainError is raised if HasFirstPoint
0079   //! returns False.
0080     Standard_Real FirstParameter() const;
0081   
0082   //! Returns the first point of the domain.
0083   //! The exception DomainError is raised if HasFirstPoint
0084   //! returns False.
0085     const gp_Pnt2d& FirstPoint() const;
0086   
0087   //! Returns the tolerance of the first (left) bound.
0088   //! The exception DomainError is raised if HasFirstPoint
0089   //! returns False.
0090     Standard_Real FirstTolerance() const;
0091   
0092   //! Returns True if the domain has a last point, i-e
0093   //! a point defining the highest admitted parameter on the
0094   //! curve.
0095     Standard_Boolean HasLastPoint() const;
0096   
0097   //! Returns the parameter of the last point of the domain.
0098   //! The exception DomainError is raised if HasLastPoint
0099   //! returns False.
0100     Standard_Real LastParameter() const;
0101   
0102   //! Returns the last point of the domain.
0103   //! The exception DomainError is raised if HasLastPoint
0104   //! returns False.
0105     const gp_Pnt2d& LastPoint() const;
0106   
0107   //! Returns the tolerance of the last (right) bound.
0108   //! The exception DomainError is raised if HasLastPoint
0109   //! returns False.
0110     Standard_Real LastTolerance() const;
0111   
0112   //! Returns True if the domain is closed.
0113     Standard_Boolean IsClosed() const;
0114   
0115   //! Returns Equivalent parameters if the domain is closed.
0116   //! Otherwise, the exception DomainError is raised.
0117     void EquivalentParameters (Standard_Real& zero, Standard_Real& zeroplusperiod) const;
0118 
0119 
0120 
0121 
0122 protected:
0123 
0124 
0125 
0126 
0127 
0128 private:
0129 
0130 
0131 
0132   Standard_Integer status;
0133   Standard_Real first_param;
0134   Standard_Real last_param;
0135   Standard_Real first_tol;
0136   Standard_Real last_tol;
0137   gp_Pnt2d first_point;
0138   gp_Pnt2d last_point;
0139   Standard_Real periodfirst;
0140   Standard_Real periodlast;
0141 
0142 
0143 };
0144 
0145 
0146 #include <IntRes2d_Domain.lxx>
0147 
0148 
0149 
0150 
0151 
0152 #endif // _IntRes2d_Domain_HeaderFile