Back to home page

EIC code displayed by LXR

 
 

    


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

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 
0029 //! Describe    a  polyline  of   intersection  between two
0030 //! polyhedra as a sequence of points of intersection.
0031 class Intf_SectionLine 
0032 {
0033 public:
0034 
0035   DEFINE_STANDARD_ALLOC
0036 
0037   
0038   //! Returns number of points in this SectionLine.
0039     Standard_Integer NumberOfPoints() const;
0040   
0041   //! Gives the point of intersection of  address <Index>  in the
0042   //! SectionLine.
0043   Standard_EXPORT const Intf_SectionPoint& GetPoint (const Standard_Integer Index) const;
0044   
0045   //! Returns True if the SectionLine is closed.
0046   Standard_EXPORT Standard_Boolean IsClosed() const;
0047   
0048   //! Returns True if ThePI is in the SectionLine <me>.
0049   Standard_EXPORT Standard_Boolean Contains (const Intf_SectionPoint& ThePI) const;
0050   
0051   //! Checks if <ThePI>  is an end of  the SectionLine. Returns 1
0052   //! for the beginning, 2 for the end, otherwise 0.
0053   Standard_EXPORT Standard_Integer IsEnd (const Intf_SectionPoint& ThePI) const;
0054   
0055   //! Compares two SectionLines.
0056   Standard_EXPORT Standard_Boolean IsEqual (const Intf_SectionLine& Other) const;
0057 Standard_Boolean operator == (const Intf_SectionLine& Other) const
0058 {
0059   return IsEqual(Other);
0060 }
0061   
0062   //! Constructs an empty SectionLine.
0063   Standard_EXPORT Intf_SectionLine();
0064   
0065   //! Copies a SectionLine.
0066   Standard_EXPORT Intf_SectionLine(const Intf_SectionLine& Other);
0067   
0068   //! Assignment
0069   Intf_SectionLine& operator= (const Intf_SectionLine& theOther)
0070   {
0071     //closed = theOther.closed; // not copied as in copy constructor
0072     myPoints = theOther.myPoints;
0073     return *this;
0074   }
0075 
0076   //! Adds a point at the end of the SectionLine.
0077   Standard_EXPORT void Append (const Intf_SectionPoint& Pi);
0078   
0079   //! Concatenates   the SectionLine  <LS>  at  the  end  of  the
0080   //! SectionLine <me>.
0081   Standard_EXPORT void Append (Intf_SectionLine& LS);
0082   
0083   //! Adds a point to the beginning of the SectionLine <me>.
0084   Standard_EXPORT void Prepend (const Intf_SectionPoint& Pi);
0085   
0086   //! Concatenates a SectionLine  <LS>  at the  beginning  of the
0087   //! SectionLine <me>.
0088   Standard_EXPORT void Prepend (Intf_SectionLine& LS);
0089   
0090   //! Reverses the order of the elements of the SectionLine.
0091   Standard_EXPORT void Reverse();
0092   
0093   //! Closes the SectionLine.
0094   Standard_EXPORT void Close();
0095   
0096   Standard_EXPORT void Dump (const Standard_Integer Indent) const;
0097 
0098 
0099 
0100 
0101 protected:
0102 
0103 
0104 
0105 
0106 
0107 private:
0108 
0109 
0110 
0111   Intf_SeqOfSectionPoint myPoints;
0112   Standard_Boolean closed;
0113 
0114 
0115 };
0116 
0117 
0118 #include <Intf_SectionLine.lxx>
0119 
0120 
0121 
0122 
0123 
0124 #endif // _Intf_SectionLine_HeaderFile