Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:10

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_SequenceOfIntersectionPoint.hxx>
0026 #include <IntRes2d_SequenceOfIntersectionSegment.hxx>
0027 class IntRes2d_IntersectionPoint;
0028 class IntRes2d_IntersectionSegment;
0029 
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 
0038   DEFINE_STANDARD_ALLOC
0039 
0040   
0041   //! returns TRUE when the computation was successful.
0042     Standard_Boolean IsDone() const;
0043   
0044   //! Returns TRUE if there is no intersection between the
0045   //! given arguments.
0046   //! The exception NotDone is raised if IsDone returns FALSE.
0047     Standard_Boolean IsEmpty() const;
0048   
0049   //! This function returns the number of intersection
0050   //! points between the 2 curves.
0051   //! The exception NotDone is raised if IsDone returns FALSE.
0052     Standard_Integer NbPoints() const;
0053   
0054   //! This function returns the intersection point
0055   //! of range N;
0056   //! The exception NotDone is raised if IsDone returns FALSE.
0057   //! The exception OutOfRange is raised if (N <= 0)
0058   //! or (N > NbPoints).
0059     const IntRes2d_IntersectionPoint& Point (const Standard_Integer N) const;
0060   
0061   //! This function returns the number of intersection
0062   //! segments between the two curves.
0063   //! The exception NotDone is raised if IsDone returns FALSE.
0064     Standard_Integer NbSegments() const;
0065   
0066   //! This function returns the intersection segment
0067   //! of range N;
0068   //! The exception NotDone is raised if IsDone returns FALSE.
0069   //! The exception OutOfRange is raised if (N <= 0)
0070   //! or (N > NbPoints).
0071     const IntRes2d_IntersectionSegment& Segment (const Standard_Integer N) const;
0072   
0073     void SetReversedParameters (const Standard_Boolean Reverseflag);
0074 
0075 
0076 
0077 
0078 protected:
0079 
0080   
0081   //! Empty constructor.
0082     IntRes2d_Intersection();
0083   
0084     IntRes2d_Intersection(const IntRes2d_Intersection& Other);
0085 
0086     //! Assignment
0087     IntRes2d_Intersection& operator= (const IntRes2d_Intersection& theOther)
0088     {
0089       done = theOther.done;
0090       reverse = theOther.reverse;
0091       lpnt = theOther.lpnt;
0092       lseg = theOther.lseg;
0093       return *this;
0094     }
0095 
0096   //! Destructor is protected, for safe inheritance
0097   ~IntRes2d_Intersection () {}
0098   
0099   Standard_EXPORT void SetValues (const IntRes2d_Intersection& Inter);
0100   
0101   Standard_EXPORT void Append (const IntRes2d_Intersection& Inter, const Standard_Real FirstParam1, const Standard_Real LastParam1, const Standard_Real FirstParam2, const Standard_Real LastParam2);
0102   
0103     void Append (const IntRes2d_IntersectionSegment& Seg);
0104   
0105     void Append (const IntRes2d_IntersectionPoint& Pnt);
0106   
0107   Standard_EXPORT void Insert (const IntRes2d_IntersectionPoint& Pnt);
0108   
0109     void ResetFields();
0110   
0111     Standard_Boolean ReversedParameters() const;
0112 
0113 protected:
0114 
0115   IntRes2d_SequenceOfIntersectionPoint lpnt;
0116   IntRes2d_SequenceOfIntersectionSegment lseg;
0117   Standard_Boolean done;
0118   Standard_Boolean reverse;
0119 
0120 };
0121 
0122 
0123 #include <IntRes2d_Intersection.lxx>
0124 
0125 
0126 
0127 
0128 
0129 #endif // _IntRes2d_Intersection_HeaderFile