Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-10 09:17:18

0001 // Created on: 1991-06-18
0002 // Created by: Didier PIFFAULT
0003 // Copyright (c) 1991-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 _Intf_SectionLine_HeaderFile
0018 #define _Intf_SectionLine_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Intf_SeqOfSectionPoint.hxx>
0025 #include <Standard_Boolean.hxx>
0026 class Intf_SectionPoint;
0027 
0028 //! Describe    a  polyline  of   intersection  between two
0029 //! polyhedra as a sequence of points of intersection.
0030 class Intf_SectionLine
0031 {
0032 public:
0033   DEFINE_STANDARD_ALLOC
0034 
0035   //! Returns number of points in this SectionLine.
0036   Standard_Integer NumberOfPoints() const;
0037 
0038   //! Gives the point of intersection of  address <Index>  in the
0039   //! SectionLine.
0040   Standard_EXPORT const Intf_SectionPoint& GetPoint(const Standard_Integer Index) const;
0041 
0042   //! Returns True if the SectionLine is closed.
0043   Standard_EXPORT Standard_Boolean IsClosed() const;
0044 
0045   //! Returns True if ThePI is in the SectionLine <me>.
0046   Standard_EXPORT Standard_Boolean Contains(const Intf_SectionPoint& ThePI) const;
0047 
0048   //! Checks if <ThePI>  is an end of  the SectionLine. Returns 1
0049   //! for the beginning, 2 for the end, otherwise 0.
0050   Standard_EXPORT Standard_Integer IsEnd(const Intf_SectionPoint& ThePI) const;
0051 
0052   //! Compares two SectionLines.
0053   Standard_EXPORT Standard_Boolean IsEqual(const Intf_SectionLine& Other) const;
0054 
0055   Standard_Boolean operator==(const Intf_SectionLine& Other) const { return IsEqual(Other); }
0056 
0057   //! Constructs an empty SectionLine.
0058   Standard_EXPORT Intf_SectionLine();
0059 
0060   //! Copies a SectionLine.
0061   Standard_EXPORT Intf_SectionLine(const Intf_SectionLine& Other);
0062 
0063   //! Assignment
0064   Intf_SectionLine& operator=(const Intf_SectionLine& theOther)
0065   {
0066     // closed = theOther.closed; // not copied as in copy constructor
0067     myPoints = theOther.myPoints;
0068     return *this;
0069   }
0070 
0071   //! Adds a point at the end of the SectionLine.
0072   Standard_EXPORT void Append(const Intf_SectionPoint& Pi);
0073 
0074   //! Concatenates   the SectionLine  <LS>  at  the  end  of  the
0075   //! SectionLine <me>.
0076   Standard_EXPORT void Append(Intf_SectionLine& LS);
0077 
0078   //! Adds a point to the beginning of the SectionLine <me>.
0079   Standard_EXPORT void Prepend(const Intf_SectionPoint& Pi);
0080 
0081   //! Concatenates a SectionLine  <LS>  at the  beginning  of the
0082   //! SectionLine <me>.
0083   Standard_EXPORT void Prepend(Intf_SectionLine& LS);
0084 
0085   //! Reverses the order of the elements of the SectionLine.
0086   Standard_EXPORT void Reverse();
0087 
0088   //! Closes the SectionLine.
0089   Standard_EXPORT void Close();
0090 
0091   Standard_EXPORT void Dump(const Standard_Integer Indent) const;
0092 
0093 protected:
0094 private:
0095   Intf_SeqOfSectionPoint myPoints;
0096   Standard_Boolean       closed;
0097 };
0098 
0099 #include <Intf_SectionLine.lxx>
0100 
0101 #endif // _Intf_SectionLine_HeaderFile