Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1992-04-27
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_Intersection_HeaderFile
0018 #define _IntRes2d_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 <IntRes2d_IntersectionPoint.hxx>
0026 #include <NCollection_Sequence.hxx>
0027 #include <IntRes2d_IntersectionSegment.hxx>
0028 class IntRes2d_IntersectionPoint;
0029 class IntRes2d_IntersectionSegment;
0030 
0031 //! Defines the root class of all the Intersections
0032 //! between two 2D-Curves, and provides all the methods
0033 //! about the results of the Intersections Algorithms.
0034 class IntRes2d_Intersection
0035 {
0036 public:
0037   DEFINE_STANDARD_ALLOC
0038 
0039   //! returns TRUE when the computation was successful.
0040   bool IsDone() const;
0041 
0042   //! Returns TRUE if there is no intersection between the
0043   //! given arguments.
0044   //! The exception NotDone is raised if IsDone returns FALSE.
0045   bool IsEmpty() const;
0046 
0047   //! This function returns the number of intersection
0048   //! points between the 2 curves.
0049   //! The exception NotDone is raised if IsDone returns FALSE.
0050   int NbPoints() const;
0051 
0052   //! This function returns the intersection point
0053   //! of range N;
0054   //! The exception NotDone is raised if IsDone returns FALSE.
0055   //! The exception OutOfRange is raised if (N <= 0)
0056   //! or (N > NbPoints).
0057   const IntRes2d_IntersectionPoint& Point(const int N) const;
0058 
0059   //! This function returns the number of intersection
0060   //! segments between the two curves.
0061   //! The exception NotDone is raised if IsDone returns FALSE.
0062   int NbSegments() const;
0063 
0064   //! This function returns the intersection segment
0065   //! of range N;
0066   //! The exception NotDone is raised if IsDone returns FALSE.
0067   //! The exception OutOfRange is raised if (N <= 0)
0068   //! or (N > NbPoints).
0069   const IntRes2d_IntersectionSegment& Segment(const int N) const;
0070 
0071   void SetReversedParameters(const bool Reverseflag);
0072 
0073 protected:
0074   //! Empty constructor.
0075   IntRes2d_Intersection();
0076 
0077   IntRes2d_Intersection(const IntRes2d_Intersection& Other);
0078 
0079   //! Assignment
0080   IntRes2d_Intersection& operator=(const IntRes2d_Intersection& theOther) = default;
0081 
0082   //! Destructor is protected, for safe inheritance
0083   ~IntRes2d_Intersection() = default;
0084 
0085   Standard_EXPORT void SetValues(const IntRes2d_Intersection& Inter);
0086 
0087   Standard_EXPORT void Append(const IntRes2d_Intersection& Inter,
0088                               const double                 FirstParam1,
0089                               const double                 LastParam1,
0090                               const double                 FirstParam2,
0091                               const double                 LastParam2);
0092 
0093   void Append(const IntRes2d_IntersectionSegment& Seg);
0094 
0095   void Append(const IntRes2d_IntersectionPoint& Pnt);
0096 
0097   Standard_EXPORT void Insert(const IntRes2d_IntersectionPoint& Pnt);
0098 
0099   void ResetFields();
0100 
0101   bool ReversedParameters() const;
0102 
0103 protected:
0104   NCollection_Sequence<IntRes2d_IntersectionPoint>   lpnt;
0105   NCollection_Sequence<IntRes2d_IntersectionSegment> lseg;
0106   bool                                               done;
0107   bool                                               reverse;
0108 };
0109 
0110 #include <IntRes2d_Intersection.lxx>
0111 
0112 #endif // _IntRes2d_Intersection_HeaderFile