Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:37

0001 // Created on: 1995-09-12
0002 // Created by: Bruno DUMORTIER
0003 // Copyright (c) 1995-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 _GeomAPI_IntCS_HeaderFile
0018 #define _GeomAPI_IntCS_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <IntCurveSurface_HInter.hxx>
0025 #include <Standard_Integer.hxx>
0026 class Geom_Curve;
0027 class Geom_Surface;
0028 class gp_Pnt;
0029 
0030 
0031 //! This class implements methods for
0032 //! computing intersection points and  segments between a
0033 class GeomAPI_IntCS 
0034 {
0035 public:
0036 
0037   DEFINE_STANDARD_ALLOC
0038 
0039   
0040   //! Creates an empty object. Use the
0041   //! function Perform for further initialization of the algorithm by
0042   //! the curve and the surface.
0043   Standard_EXPORT GeomAPI_IntCS();
0044   
0045   //! Computes the intersections between
0046   //! the curve C and the surface S.
0047   //! Warning
0048   //! Use function IsDone to verify that the intersections are computed successfully.
0049   Standard_EXPORT GeomAPI_IntCS(const Handle(Geom_Curve)& C, const Handle(Geom_Surface)& S);
0050   
0051   //! This function Initializes an algorithm with the curve C and the
0052   //! surface S and computes the intersections between C and S.
0053   //! Warning
0054   //! Use function IsDone to verify that the intersections are computed successfully.
0055   Standard_EXPORT void Perform (const Handle(Geom_Curve)& C, const Handle(Geom_Surface)& S);
0056   
0057   //! Returns true if the intersections are successfully computed.
0058   Standard_EXPORT Standard_Boolean IsDone() const;
0059   
0060   //! Returns the number of Intersection Points
0061   //! if IsDone returns True.
0062   //! else NotDone is raised.
0063   Standard_EXPORT Standard_Integer NbPoints() const;
0064   
0065   //! Returns the Intersection Point of range <Index>in case of cross intersection.
0066   //! Raises NotDone if the computation has failed or if
0067   //! the computation has not been done
0068   //! raises OutOfRange if Index is not in the range <1..NbPoints>
0069   Standard_EXPORT const gp_Pnt& Point (const Standard_Integer Index) const;
0070   
0071   //! Returns parameter W on the curve
0072   //! and (parameters U,V) on the surface of the computed intersection point
0073   //! of index Index in case of cross intersection.
0074   //! Exceptions
0075   //! StdFail_NotDone if intersection algorithm fails or is not initialized.
0076   //! Standard_OutOfRange if Index is not in the range [ 1,NbPoints ], where
0077   //! NbPoints is the number of computed intersection points.
0078   Standard_EXPORT void Parameters (const Standard_Integer Index, Standard_Real& U, Standard_Real& V, Standard_Real& W) const;
0079   
0080   //! Returns the number of computed
0081   //! intersection segments in case of tangential intersection.
0082   //! Exceptions
0083   //! StdFail_NotDone if the intersection algorithm fails or is not initialized.
0084   Standard_EXPORT Standard_Integer NbSegments() const;
0085   
0086   //! Returns the computed intersection
0087   //! segment of index Index in case of tangential intersection.
0088   //! Intersection segment is a portion of the initial curve tangent to surface.
0089   //! Exceptions
0090   //! StdFail_NotDone if intersection algorithm fails or is not initialized.
0091   //! Standard_OutOfRange if Index is not in the range [ 1,NbSegments ],
0092   //! where NbSegments is the number of computed intersection segments.
0093   Standard_EXPORT Handle(Geom_Curve) Segment (const Standard_Integer Index) const;
0094   
0095   //! Returns the parameters of the first (U1,V1) and the last (U2,V2) points
0096   //! of curve's segment on the surface in case of tangential intersection.
0097   //! Index is the number of computed intersection segments.
0098   //! Exceptions
0099   //! StdFail_NotDone if intersection algorithm fails or is not initialized.
0100   //! Standard_OutOfRange if Index is not in the range [ 1,NbSegments ],
0101   //! where NbSegments is the number of computed intersection segments.
0102   Standard_EXPORT void Parameters (const Standard_Integer Index, Standard_Real& U1, Standard_Real& V1, Standard_Real& U2, Standard_Real& V2) const;
0103 
0104 
0105 
0106 
0107 protected:
0108 
0109 
0110 
0111 
0112 
0113 private:
0114 
0115 
0116 
0117   Handle(Geom_Curve) myCurve;
0118   IntCurveSurface_HInter myIntCS;
0119 
0120 
0121 };
0122 
0123 
0124 
0125 
0126 
0127 
0128 
0129 #endif // _GeomAPI_IntCS_HeaderFile