Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-12 09:16:35

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 _BOPDS_Curve_HeaderFile
0016 #define _BOPDS_Curve_HeaderFile
0017 
0018 #include <Standard.hxx>
0019 #include <Standard_DefineAlloc.hxx>
0020 #include <Standard_Handle.hxx>
0021 
0022 #include <Bnd_Box.hxx>
0023 #include <IntTools_Curve.hxx>
0024 #include <NCollection_BaseAllocator.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <NCollection_List.hxx>
0027 class IntTools_Curve;
0028 class Bnd_Box;
0029 class BOPDS_PaveBlock;
0030 
0031 //! The class BOPDS_Curve is to store
0032 //! the information about intersection curve
0033 class BOPDS_Curve
0034 {
0035 public:
0036   DEFINE_STANDARD_ALLOC
0037 
0038   //! Empty constructor
0039   BOPDS_Curve();
0040 
0041   virtual ~BOPDS_Curve();
0042 
0043   //! Constructor
0044   //! @param theAllocator the allocator to manage the memory
0045   BOPDS_Curve(const occ::handle<NCollection_BaseAllocator>& theAllocator);
0046 
0047   //! Modifier
0048   //! Sets the curve <theC>
0049   void SetCurve(const IntTools_Curve& theC);
0050 
0051   //! Selector
0052   //! Returns the curve
0053   const IntTools_Curve& Curve() const;
0054 
0055   //! Modifier
0056   //! Sets the bounding box <theBox> of the curve
0057   void SetBox(const Bnd_Box& theBox);
0058 
0059   //! Selector
0060   //! Returns the bounding box of the curve
0061   const Bnd_Box& Box() const;
0062 
0063   //! Selector/Modifier
0064   //! Returns the bounding box of the curve
0065   Bnd_Box& ChangeBox();
0066 
0067   void SetPaveBlocks(const NCollection_List<occ::handle<BOPDS_PaveBlock>>& theLPB);
0068 
0069   //! Selector
0070   //! Returns the list of pave blocks
0071   //! of the curve
0072   const NCollection_List<occ::handle<BOPDS_PaveBlock>>& PaveBlocks() const;
0073 
0074   //! Selector/Modifier
0075   //! Returns the list of pave blocks
0076   //! of the curve
0077   NCollection_List<occ::handle<BOPDS_PaveBlock>>& ChangePaveBlocks();
0078 
0079   //! Creates initial pave block
0080   //! of the curve
0081   void InitPaveBlock1();
0082 
0083   //! Selector/Modifier
0084   //! Returns initial pave block
0085   //! of the curve
0086   occ::handle<BOPDS_PaveBlock>& ChangePaveBlock1();
0087 
0088   //! Selector
0089   //! Returns list of indices of technologic vertices
0090   //! of the curve
0091   const NCollection_List<int>& TechnoVertices() const;
0092 
0093   //! Selector/Modifier
0094   //! Returns list of indices of technologic vertices
0095   //! of the curve
0096   NCollection_List<int>& ChangeTechnoVertices();
0097 
0098   //! Query
0099   //! Returns true if at least one pave block of the curve
0100   //! has edge
0101   bool HasEdge() const;
0102 
0103   //! Sets the tolerance for the curve.
0104   void SetTolerance(const double theTol) { myTolerance = theTol; }
0105 
0106   //! Returns the tolerance of the curve
0107   double Tolerance() const { return myTolerance; }
0108 
0109   //! Returns the tangential tolerance of the curve
0110   double TangentialTolerance() const { return myCurve.TangentialTolerance(); }
0111 
0112 protected:
0113   occ::handle<NCollection_BaseAllocator>         myAllocator;
0114   IntTools_Curve                                 myCurve;
0115   NCollection_List<occ::handle<BOPDS_PaveBlock>> myPaveBlocks;
0116   NCollection_List<int>                          myTechnoVertices;
0117   Bnd_Box                                        myBox;
0118   double                                         myTolerance;
0119 };
0120 
0121 #include <BOPDS_Curve.lxx>
0122 
0123 #endif // _BOPDS_Curve_HeaderFile