Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-29 09:19:28

0001 // Created on: 1992-05-06
0002 // Created by: Jacques GOUSSARD
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 _IntPatch_Point_HeaderFile
0018 #define _IntPatch_Point_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <IntSurf_PntOn2S.hxx>
0025 #include <IntSurf_Transition.hxx>
0026 #include <Adaptor2d_Curve2d.hxx>
0027 
0028 class Adaptor3d_HVertex;
0029 class gp_Pnt;
0030 
0031 //! Definition of an intersection point between two surfaces.
0032 //! Such a point is contains geometrical information (see
0033 //! the Value method) and logical information.
0034 class IntPatch_Point
0035 {
0036 public:
0037   DEFINE_STANDARD_ALLOC
0038 
0039   //! Empty constructor.
0040   IntPatch_Point();
0041 
0042   //! Sets the values of a point which is on no domain,
0043   //! when both surfaces are implicit ones.
0044   //! If Tangent is True, the point is a point of tangency
0045   //! between the surfaces.
0046   Standard_EXPORT void SetValue(const gp_Pnt& Pt, const double Tol, const bool Tangent);
0047 
0048   void SetValue(const gp_Pnt& Pt);
0049 
0050   //! Sets the value of <pt> member
0051   void SetValue(const IntSurf_PntOn2S& thePOn2S);
0052 
0053   void SetTolerance(const double Tol);
0054 
0055   //! Sets the values of the parameters of the point
0056   //! on each surface.
0057   void SetParameters(const double U1, const double V1, const double U2, const double V2);
0058 
0059   //! Set the value of the parameter on the intersection line.
0060   void SetParameter(const double Para);
0061 
0062   //! Sets the values of a point which is a vertex on
0063   //! the initial facet of restriction of one
0064   //! of the surface.
0065   //! If OnFirst is True, the point is on the domain of the
0066   //! first patch, otherwise the point is on the domain of the
0067   //! second surface.
0068   Standard_EXPORT void SetVertex(const bool OnFirst, const occ::handle<Adaptor3d_HVertex>& V);
0069 
0070   //! Sets the values of a point which is on one of the domain,
0071   //! when both surfaces are implicit ones.
0072   //! If OnFirst is True, the point is on the domain of the
0073   //! first patch, otherwise the point is on the domain of the
0074   //! second surface.
0075   Standard_EXPORT void SetArc(const bool                            OnFirst,
0076                               const occ::handle<Adaptor2d_Curve2d>& A,
0077                               const double                          Param,
0078                               const IntSurf_Transition&             TLine,
0079                               const IntSurf_Transition&             TArc);
0080 
0081   //! Sets (or unsets) the point as a point on several
0082   //! intersection line.
0083   void SetMultiple(const bool IsMult);
0084 
0085   //! Returns the intersection point (geometric information).
0086   const gp_Pnt& Value() const;
0087 
0088   //! This method returns the parameter of the point
0089   //! on the intersection line.
0090   //! If the points does not belong to an intersection line,
0091   //! the value returned does not have any sens.
0092   double ParameterOnLine() const;
0093 
0094   //! This method returns the fuzziness on the point.
0095   double Tolerance() const;
0096 
0097   //! Returns True if the Point is a tangency point between
0098   //! the surfaces.
0099   //! If the Point is on one of the domain (IsOnDomS1 returns
0100   //! True or IsOnDomS2 returns True), an exception is raised.
0101   bool IsTangencyPoint() const;
0102 
0103   //! Returns the parameters on the first surface of the point.
0104   void ParametersOnS1(double& U1, double& V1) const;
0105 
0106   //! Returns the parameters on the second surface of the point.
0107   void ParametersOnS2(double& U2, double& V2) const;
0108 
0109   //! Returns True if the point belongs to several intersection
0110   //! lines.
0111   bool IsMultiple() const;
0112 
0113   //! Returns TRUE if the point is on a boundary of the domain
0114   //! of the first patch.
0115   bool IsOnDomS1() const;
0116 
0117   //! Returns TRUE if the point is a vertex on the initial
0118   //! restriction facet of the first surface.
0119   bool IsVertexOnS1() const;
0120 
0121   //! Returns the information about the point when it is
0122   //! on the domain of the first patch, i-e when the function
0123   //! IsVertexOnS1 returns True.
0124   //! Otherwise, an exception is raised.
0125   const occ::handle<Adaptor3d_HVertex>& VertexOnS1() const;
0126 
0127   //! Returns the arc of restriction containing the
0128   //! vertex.
0129   //! The exception DomainError is raised if
0130   //! IsOnDomS1 returns False.
0131   const occ::handle<Adaptor2d_Curve2d>& ArcOnS1() const;
0132 
0133   //! Returns the transition of the point on the
0134   //! intersection line with the arc on S1.
0135   //! The exception DomainError is raised if IsOnDomS1
0136   //! returns False.
0137   const IntSurf_Transition& TransitionLineArc1() const;
0138 
0139   //! Returns the transition between the intersection line
0140   //! returned by the method Line and the arc on S1 returned
0141   //! by ArcOnS1().
0142   //! The exception DomainError is raised if
0143   //! IsOnDomS1 returns False.
0144   const IntSurf_Transition& TransitionOnS1() const;
0145 
0146   //! Returns the parameter of the point on the
0147   //! arc returned by the method ArcOnS2.
0148   //! The exception DomainError is raised if
0149   //! IsOnDomS1 returns False.
0150   double ParameterOnArc1() const;
0151 
0152   //! Returns TRUE if the point is on a boundary of the domain
0153   //! of the second patch.
0154   bool IsOnDomS2() const;
0155 
0156   //! Returns TRUE if the point is a vertex on the initial
0157   //! restriction facet of the first surface.
0158   bool IsVertexOnS2() const;
0159 
0160   //! Returns the information about the point when it is
0161   //! on the domain of the second patch, i-e when the function
0162   //! IsVertexOnS2 returns True.
0163   //! Otherwise, an exception is raised.
0164   const occ::handle<Adaptor3d_HVertex>& VertexOnS2() const;
0165 
0166   //! Returns the arc of restriction containing the
0167   //! vertex.
0168   //! The exception DomainError is raised if
0169   //! IsOnDomS2 returns False.
0170   const occ::handle<Adaptor2d_Curve2d>& ArcOnS2() const;
0171 
0172   //! Returns the transition of the point on the
0173   //! intersection line with the arc on S2.
0174   //! The exception DomainError is raised if IsOnDomS2
0175   //! returns False.
0176   const IntSurf_Transition& TransitionLineArc2() const;
0177 
0178   //! Returns the transition between the intersection line
0179   //! returned by the method Line and the arc on S2 returned
0180   //! by ArcOnS2.
0181   //! The exception DomainError is raised if
0182   //! IsOnDomS2 returns False.
0183   const IntSurf_Transition& TransitionOnS2() const;
0184 
0185   //! Returns the parameter of the point on the
0186   //! arc returned by the method ArcOnS2.
0187   //! The exception DomainError is raised if
0188   //! IsOnDomS2 returns False.
0189   double ParameterOnArc2() const;
0190 
0191   //! Returns the PntOn2S
0192   //! (geometric Point and the parameters)
0193   const IntSurf_PntOn2S& PntOn2S() const;
0194 
0195   //! Returns the parameters on the first and on the
0196   //! second surface of the point.
0197   void Parameters(double& U1, double& V1, double& U2, double& V2) const;
0198 
0199   Standard_EXPORT void ReverseTransition();
0200 
0201   Standard_EXPORT void Dump() const;
0202 
0203 private:
0204   IntSurf_PntOn2S pt;
0205   double          para;
0206   double          tol;
0207   bool            tgt;
0208 
0209   // TRUE if the point is in several intersection lines
0210   bool mult;
0211 
0212   bool                           onS1;
0213   bool                           vtxonS1;
0214   occ::handle<Adaptor3d_HVertex> vS1;
0215   occ::handle<Adaptor2d_Curve2d> arcS1;
0216   IntSurf_Transition             traline1;
0217   IntSurf_Transition             tra1;
0218   double                         prm1;
0219   bool                           onS2;
0220   bool                           vtxonS2;
0221   occ::handle<Adaptor3d_HVertex> vS2;
0222   occ::handle<Adaptor2d_Curve2d> arcS2;
0223   IntSurf_Transition             traline2;
0224   IntSurf_Transition             tra2;
0225   double                         prm2;
0226 };
0227 
0228 #include <IntPatch_Point.lxx>
0229 
0230 #endif // _IntPatch_Point_HeaderFile