Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-05 09:22:31

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