1 // Created on: 1991-06-18
2 // Created by: Didier PIFFAULT
3 // Copyright (c) 1991-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _Intf_SectionLine_HeaderFile
18 #define _Intf_SectionLine_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Intf_SeqOfSectionPoint.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <Standard_Integer.hxx>
27 class Standard_OutOfRange;
28 class Intf_SectionPoint;
31 //! Describe a polyline of intersection between two
32 //! polyhedra as a sequence of points of intersection.
33 class Intf_SectionLine
40 //! Returns number of points in this SectionLine.
41 Standard_Integer NumberOfPoints() const;
43 //! Gives the point of intersection of address <Index> in the
45 Standard_EXPORT const Intf_SectionPoint& GetPoint (const Standard_Integer Index) const;
47 //! Returns True if the SectionLine is closed.
48 Standard_EXPORT Standard_Boolean IsClosed() const;
50 //! Returns True if ThePI is in the SectionLine <me>.
51 Standard_EXPORT Standard_Boolean Contains (const Intf_SectionPoint& ThePI) const;
53 //! Checks if <ThePI> is an end of the SectionLine. Returns 1
54 //! for the beginning, 2 for the end, otherwise 0.
55 Standard_EXPORT Standard_Integer IsEnd (const Intf_SectionPoint& ThePI) const;
57 //! Compares two SectionLines.
58 Standard_EXPORT Standard_Boolean IsEqual (const Intf_SectionLine& Other) const;
59 Standard_Boolean operator == (const Intf_SectionLine& Other) const
61 return IsEqual(Other);
64 //! Constructs an empty SectionLine.
65 Standard_EXPORT Intf_SectionLine();
67 //! Copies a SectionLine.
68 Standard_EXPORT Intf_SectionLine(const Intf_SectionLine& Other);
71 Intf_SectionLine& operator= (const Intf_SectionLine& theOther)
73 //closed = theOther.closed; // not copied as in copy constructor
74 myPoints = theOther.myPoints;
78 //! Adds a point at the end of the SectionLine.
79 Standard_EXPORT void Append (const Intf_SectionPoint& Pi);
81 //! Concatenates the SectionLine <LS> at the end of the
83 Standard_EXPORT void Append (Intf_SectionLine& LS);
85 //! Adds a point to the beginning of the SectionLine <me>.
86 Standard_EXPORT void Prepend (const Intf_SectionPoint& Pi);
88 //! Concatenates a SectionLine <LS> at the beginning of the
90 Standard_EXPORT void Prepend (Intf_SectionLine& LS);
92 //! Reverses the order of the elements of the SectionLine.
93 Standard_EXPORT void Reverse();
95 //! Closes the SectionLine.
96 Standard_EXPORT void Close();
98 Standard_EXPORT void Dump (const Standard_Integer Indent) const;
113 Intf_SeqOfSectionPoint myPoints;
114 Standard_Boolean closed;
120 #include <Intf_SectionLine.lxx>
126 #endif // _Intf_SectionLine_HeaderFile