Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:50

0001 // Created on: 1992-02-18
0002 // Created by: Christophe MARION
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 _HLRAlgo_EdgeStatus_HeaderFile
0018 #define _HLRAlgo_EdgeStatus_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Intrv_Intervals.hxx>
0025 
0026 
0027 //! This class describes the Hidden  Line status of an
0028 //! Edge. It contains :
0029 //!
0030 //! The Bounds of the Edge and their tolerances
0031 //!
0032 //! Two flags indicating if the edge is full visible
0033 //! or full hidden.
0034 //!
0035 //! The Sequence  of visible Intervals  on the Edge.
0036 class HLRAlgo_EdgeStatus 
0037 {
0038 public:
0039 
0040   DEFINE_STANDARD_ALLOC
0041 
0042   
0043   Standard_EXPORT HLRAlgo_EdgeStatus();
0044   
0045   //! Creates a  new  EdgeStatus.  Default visible.  The
0046   //! Edge is   bounded by the  interval  <Start>, <End>
0047   //! with the tolerances <TolStart>, <TolEnd>.
0048   Standard_EXPORT HLRAlgo_EdgeStatus(const Standard_Real Start, const Standard_ShortReal TolStart, const Standard_Real End, const Standard_ShortReal TolEnd);
0049   
0050   //! Initialize  an  EdgeStatus.  Default visible.  The
0051   //! Edge is   bounded by the  interval  <Start>, <End>
0052   //! with the tolerances <TolStart>, <TolEnd>.
0053   Standard_EXPORT void Initialize (const Standard_Real Start, const Standard_ShortReal TolStart, const Standard_Real End, const Standard_ShortReal TolEnd);
0054 
0055   void Bounds (Standard_Real& theStart, Standard_ShortReal& theTolStart, Standard_Real& theEnd, Standard_ShortReal& theTolEnd) const
0056   {
0057     theStart    = myStart;
0058     theTolStart = myTolStart;
0059     theEnd      = myEnd;
0060     theTolEnd   = myTolEnd;
0061   }
0062 
0063   Standard_EXPORT Standard_Integer NbVisiblePart() const;
0064   
0065   Standard_EXPORT void VisiblePart (const Standard_Integer Index, Standard_Real& Start, Standard_ShortReal& TolStart, Standard_Real& End, Standard_ShortReal& TolEnd) const;
0066   
0067   //! Hides  the  interval  <Start>,    <End>   with the
0068   //! tolerances <TolStart>,  <TolEnd>. This interval is
0069   //! subtracted from the visible  parts.  If the hidden
0070   //! part is on ( or under ) the face the flag <OnFace>
0071   //! is True ( or False ).  If the hidden  part is on (
0072   //! or  inside  ) the boundary  of  the  face the flag
0073   //! <OnBoundary> is True ( or False ).
0074   Standard_EXPORT void Hide (const Standard_Real Start, const Standard_ShortReal TolStart, const Standard_Real End, const Standard_ShortReal TolEnd, const Standard_Boolean OnFace, const Standard_Boolean OnBoundary);
0075 
0076   //! Hide the whole Edge.
0077   void HideAll()
0078   {
0079     AllVisible(Standard_False);
0080     AllHidden (Standard_True);
0081   }
0082 
0083   //! Show the whole Edge.
0084   void ShowAll()
0085   {
0086     AllVisible(Standard_True);
0087     AllHidden (Standard_False);
0088   }
0089 
0090   Standard_Boolean AllHidden() const { return myAllHidden; }
0091 
0092   void AllHidden (const Standard_Boolean B) { myAllHidden = B; }
0093 
0094   Standard_Boolean AllVisible() const { return myAllVisible; }
0095 
0096   void AllVisible (const Standard_Boolean B) { myAllVisible = B; }
0097 
0098 private:
0099 
0100   Standard_Real myStart;
0101   Standard_Real myEnd;
0102   Standard_ShortReal myTolStart;
0103   Standard_ShortReal myTolEnd;
0104   Standard_Boolean myAllHidden;
0105   Standard_Boolean myAllVisible;
0106   Intrv_Intervals myVisibles;
0107 
0108 };
0109 
0110 #endif // _HLRAlgo_EdgeStatus_HeaderFile