Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-24 09:14:26

0001 // Created by: Peter KURNEV
0002 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0003 //
0004 // This file is part of Open CASCADE Technology software library.
0005 //
0006 // This library is free software; you can redistribute it and/or modify it under
0007 // the terms of the GNU Lesser General Public License version 2.1 as published
0008 // by the Free Software Foundation, with special exception defined in the file
0009 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0010 // distribution for complete text of the license and disclaimer of any warranty.
0011 //
0012 // Alternatively, this file may be used under the terms of Open CASCADE
0013 // commercial license or contractual agreement.
0014 
0015 #ifndef _IntTools_ShrunkRange_HeaderFile
0016 #define _IntTools_ShrunkRange_HeaderFile
0017 
0018 #include <Standard.hxx>
0019 #include <Standard_DefineAlloc.hxx>
0020 #include <Standard_Handle.hxx>
0021 
0022 #include <TopoDS_Edge.hxx>
0023 #include <TopoDS_Vertex.hxx>
0024 #include <Bnd_Box.hxx>
0025 #include <Standard_Integer.hxx>
0026 class IntTools_Context;
0027 
0028 //! The class provides the computation of
0029 //! a working (shrunk) range [t1, t2] for
0030 //! the 3D-curve of the edge.
0031 class IntTools_ShrunkRange
0032 {
0033 public:
0034   DEFINE_STANDARD_ALLOC
0035 
0036   Standard_EXPORT IntTools_ShrunkRange();
0037   Standard_EXPORT virtual ~IntTools_ShrunkRange();
0038 
0039   Standard_EXPORT void SetData(const TopoDS_Edge&   aE,
0040                                const double         aT1,
0041                                const double         aT2,
0042                                const TopoDS_Vertex& aV1,
0043                                const TopoDS_Vertex& aV2);
0044 
0045   Standard_EXPORT void SetContext(const occ::handle<IntTools_Context>& aCtx);
0046 
0047   Standard_EXPORT const occ::handle<IntTools_Context>& Context() const;
0048 
0049   Standard_EXPORT void SetShrunkRange(const double aT1, const double aT2);
0050 
0051   Standard_EXPORT void ShrunkRange(double& aT1, double& aT2) const;
0052 
0053   Standard_EXPORT const Bnd_Box& BndBox() const;
0054 
0055   Standard_EXPORT const TopoDS_Edge& Edge() const;
0056 
0057   Standard_EXPORT void Perform();
0058 
0059   //! Returns TRUE in case the shrunk range is computed
0060   bool IsDone() const { return myIsDone; }
0061 
0062   //! Returns FALSE in case the shrunk range is
0063   //! too short and the edge cannot be split,
0064   //! otherwise returns TRUE
0065   bool IsSplittable() const { return myIsSplittable; }
0066 
0067   //! Returns the length of the edge if computed.
0068   double Length() const { return myLength; }
0069 
0070 protected:
0071   TopoDS_Edge                   myEdge;
0072   TopoDS_Vertex                 myV1;
0073   TopoDS_Vertex                 myV2;
0074   double                        myT1;
0075   double                        myT2;
0076   double                        myTS1;
0077   double                        myTS2;
0078   Bnd_Box                       myBndBox;
0079   occ::handle<IntTools_Context> myCtx;
0080   bool                          myIsDone;
0081   bool                          myIsSplittable;
0082   double                        myLength;
0083 };
0084 
0085 #endif // _IntTools_ShrunkRange_HeaderFile