Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-02 09:12:34

0001 // Created on: 1992-10-14
0002 // Created by: Christophe MARION
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 _HLRBRep_TheExactInterCSurf_HeaderFile
0018 #define _HLRBRep_TheExactInterCSurf_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Boolean.hxx>
0025 #include <HLRBRep_TheCSFunctionOfInterCSurf.hxx>
0026 class StdFail_NotDone;
0027 class Standard_DomainError;
0028 class HLRBRep_SurfaceTool;
0029 class gp_Lin;
0030 class HLRBRep_LineTool;
0031 class HLRBRep_TheCSFunctionOfInterCSurf;
0032 class math_FunctionSetRoot;
0033 class gp_Pnt;
0034 
0035 class HLRBRep_TheExactInterCSurf
0036 {
0037 public:
0038   DEFINE_STANDARD_ALLOC
0039 
0040   //! compute the solution point with the close point
0041   //! MarginCoef is the coefficient for extension of UV bounds.
0042   //! Ex., UFirst -= MarginCoef*(ULast-UFirst)
0043   Standard_EXPORT HLRBRep_TheExactInterCSurf(const double                             U,
0044                                              const double                             V,
0045                                              const double                             W,
0046                                              const HLRBRep_TheCSFunctionOfInterCSurf& F,
0047                                              const double                             TolTangency,
0048                                              const double MarginCoef = 0.0);
0049 
0050   //! initialize the parameters to compute the solution
0051   Standard_EXPORT HLRBRep_TheExactInterCSurf(const HLRBRep_TheCSFunctionOfInterCSurf& F,
0052                                              const double                             TolTangency);
0053 
0054   //! compute the solution
0055   //! it's possible to write to optimize:
0056   //! IntImp_IntCS inter(S1,C1,Toltangency)
0057   //! math_FunctionSetRoot rsnld(Inter.function())
0058   //! while ...{
0059   //! u=...
0060   //! v=...
0061   //! w=...
0062   //! inter.Perform(u,v,w,rsnld)
0063   //! }
0064   //! or
0065   //! IntImp_IntCS inter(Toltangency)
0066   //! inter.SetSurface(S);
0067   //! math_FunctionSetRoot rsnld(Inter.function())
0068   //! while ...{
0069   //! C=...
0070   //! inter.SetCurve(C);
0071   //! u=...
0072   //! v=...
0073   //! w=...
0074   //! inter.Perform(u,v,w,rsnld)
0075   //! }
0076   Standard_EXPORT void Perform(const double          U,
0077                                const double          V,
0078                                const double          W,
0079                                math_FunctionSetRoot& Rsnld,
0080                                const double          u0,
0081                                const double          v0,
0082                                const double          u1,
0083                                const double          v1,
0084                                const double          w0,
0085                                const double          w1);
0086 
0087   //! Returns TRUE if the creation completed without failure.
0088   Standard_EXPORT bool IsDone() const;
0089 
0090   Standard_EXPORT bool IsEmpty() const;
0091 
0092   //! returns the intersection point
0093   //! The exception NotDone is raised if IsDone is false.
0094   //! The exception DomainError is raised if IsEmpty is true.
0095   Standard_EXPORT const gp_Pnt& Point() const;
0096 
0097   Standard_EXPORT double ParameterOnCurve() const;
0098 
0099   Standard_EXPORT void ParameterOnSurface(double& U, double& V) const;
0100 
0101   //! return the math function which
0102   //! is used to compute the intersection
0103   Standard_EXPORT HLRBRep_TheCSFunctionOfInterCSurf& Function();
0104 
0105 private:
0106   bool                              done;
0107   bool                              empty;
0108   HLRBRep_TheCSFunctionOfInterCSurf myFunction;
0109   double                            w;
0110   double                            u;
0111   double                            v;
0112   double                            tol;
0113 };
0114 
0115 #endif // _HLRBRep_TheExactInterCSurf_HeaderFile