Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-20 09:18:07

0001 // Created on: 1993-04-07
0002 // Created by: Laurent BUCHARD
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 _IntCurveSurface_Intersection_HeaderFile
0018 #define _IntCurveSurface_Intersection_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Boolean.hxx>
0025 #include <IntCurveSurface_IntersectionPoint.hxx>
0026 #include <NCollection_Sequence.hxx>
0027 #include <IntCurveSurface_IntersectionSegment.hxx>
0028 class IntCurveSurface_IntersectionPoint;
0029 class IntCurveSurface_IntersectionSegment;
0030 
0031 class IntCurveSurface_Intersection
0032 {
0033 public:
0034   DEFINE_STANDARD_ALLOC
0035 
0036   //! returns the <done> field.
0037   Standard_EXPORT bool IsDone() const;
0038 
0039   //! returns the number of IntersectionPoint
0040   //! if IsDone returns True.
0041   //! else NotDone is raised.
0042   Standard_EXPORT int NbPoints() const;
0043 
0044   //! returns the IntersectionPoint of range <Index>
0045   //! raises NotDone if the computation has failed or if
0046   //! the computation has not been done
0047   //! raises OutOfRange if Index is not in the range <1..NbPoints>
0048   Standard_EXPORT const IntCurveSurface_IntersectionPoint& Point(const int Index) const;
0049 
0050   //! returns the number of IntersectionSegment
0051   //! if IsDone returns True.
0052   //! else NotDone is raised.
0053   Standard_EXPORT int NbSegments() const;
0054 
0055   //! returns the IntersectionSegment of range <Index>
0056   //! raises NotDone if the computation has failed or if
0057   //! the computation has not been done
0058   //! raises OutOfRange if Index is not in the range <1..NbSegment>
0059   Standard_EXPORT const IntCurveSurface_IntersectionSegment& Segment(const int Index) const;
0060 
0061   //! Returns true if curve is parallel or belongs surface
0062   //! This case is recognized only for some pairs
0063   //! of analytical curves and surfaces (plane - line, ...)
0064   Standard_EXPORT bool IsParallel() const;
0065 
0066   //! Dump all the fields.
0067   Standard_EXPORT void Dump() const;
0068 
0069 protected:
0070   //! Empty Constructor;
0071   Standard_EXPORT IntCurveSurface_Intersection();
0072 
0073   //! Destructor is protected, for safe inheritance
0074   ~IntCurveSurface_Intersection() = default;
0075 
0076   //! Internal method
0077   //! copy the <Inter> fields to <me>
0078   Standard_EXPORT void SetValues(const IntCurveSurface_Intersection& Inter);
0079 
0080   //! Internal method
0081   //! Append the IntersectionPoints and
0082   //! IntersectionSegments of <Inter> to <me>.
0083   Standard_EXPORT void Append(const IntCurveSurface_Intersection& Inter,
0084                               const double                        FirstParamOnCurve,
0085                               const double                        LastParamOnCurve);
0086 
0087   //! Internal method
0088   //! Append the IntersectionPoints of <Inter> to <me>
0089   Standard_EXPORT void Append(const IntCurveSurface_IntersectionPoint& Pt);
0090 
0091   //! Internal method
0092   //! Append the IntersectionPoints of <Inter> to <me>
0093   Standard_EXPORT void Append(const IntCurveSurface_IntersectionSegment& Seg);
0094 
0095   //! Internal method
0096   //! Reset all the fields of <me>
0097   //! Clear the sequences of IntersectionPoints and Segments
0098   //! Set the field <done> to false.
0099   Standard_EXPORT void ResetFields();
0100 
0101   bool done;
0102   bool myIsParallel; // Curve is "parallel" surface
0103   // This case is recognized only for some pairs
0104   // of analytical curves and surfaces (plane - line, ...)
0105 
0106 private:
0107   NCollection_Sequence<IntCurveSurface_IntersectionPoint>   lpnt;
0108   NCollection_Sequence<IntCurveSurface_IntersectionSegment> lseg;
0109 };
0110 
0111 #endif // _IntCurveSurface_Intersection_HeaderFile