Back to home page

EIC code displayed by LXR

 
 

    


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

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 
0029 
0030 //! The class provides the computation of
0031 //! a working (shrunk) range [t1, t2] for
0032 //! the 3D-curve of the edge.
0033 class IntTools_ShrunkRange 
0034 {
0035 public:
0036 
0037   DEFINE_STANDARD_ALLOC
0038 
0039   
0040   Standard_EXPORT IntTools_ShrunkRange();
0041 Standard_EXPORT virtual ~IntTools_ShrunkRange();
0042   
0043   Standard_EXPORT void SetData (const TopoDS_Edge& aE, const Standard_Real aT1, const Standard_Real aT2, const TopoDS_Vertex& aV1, const TopoDS_Vertex& aV2);
0044   
0045   Standard_EXPORT void SetContext (const Handle(IntTools_Context)& aCtx);
0046   
0047   Standard_EXPORT const Handle(IntTools_Context)& Context() const;
0048   
0049   Standard_EXPORT void SetShrunkRange (const Standard_Real aT1, const Standard_Real aT2);
0050   
0051   Standard_EXPORT void ShrunkRange (Standard_Real& aT1, Standard_Real& 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   Standard_Boolean IsDone() const
0061   {
0062     return myIsDone;
0063   }
0064 
0065   //! Returns FALSE in case the shrunk range is
0066   //! too short and the edge cannot be split,
0067   //! otherwise returns TRUE
0068   Standard_Boolean IsSplittable() const
0069   {
0070     return myIsSplittable;
0071   }
0072 
0073   //! Returns the length of the edge if computed.
0074   Standard_Real Length() const { return myLength; }
0075 
0076 protected:
0077 
0078   TopoDS_Edge myEdge;
0079   TopoDS_Vertex myV1;
0080   TopoDS_Vertex myV2;
0081   Standard_Real myT1;
0082   Standard_Real myT2;
0083   Standard_Real myTS1;
0084   Standard_Real myTS2;
0085   Bnd_Box myBndBox;
0086   Handle(IntTools_Context) myCtx;
0087   Standard_Boolean myIsDone;
0088   Standard_Boolean myIsSplittable;
0089   Standard_Real myLength;
0090 
0091 private:
0092 
0093 };
0094 
0095 #endif // _IntTools_ShrunkRange_HeaderFile