Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-13 09:17:51

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_PaveBlock_HeaderFile
0016 #define _BOPDS_PaveBlock_HeaderFile
0017 
0018 #include <Standard.hxx>
0019 
0020 #include <Bnd_Box.hxx>
0021 #include <BOPDS_ListOfPave.hxx>
0022 #include <BOPDS_ListOfPaveBlock.hxx>
0023 #include <BOPDS_Pave.hxx>
0024 #include <NCollection_BaseAllocator.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <Standard_Transient.hxx>
0027 #include <TColStd_MapOfInteger.hxx>
0028 
0029 class BOPDS_PaveBlock;
0030 DEFINE_STANDARD_HANDLE(BOPDS_PaveBlock, Standard_Transient)
0031 
0032 //! The class BOPDS_PaveBlock is to store
0033 //! the information about pave block on an edge.
0034 //! Two adjacent paves on edge make up pave block.
0035 class BOPDS_PaveBlock : public Standard_Transient
0036 {
0037 
0038 public:
0039   //! Empty constructor
0040   Standard_EXPORT BOPDS_PaveBlock();
0041 
0042   //! Constructor
0043   //! @param theAllocator the allocator to manage the memory
0044   Standard_EXPORT BOPDS_PaveBlock(const Handle(NCollection_BaseAllocator)& theAllocator);
0045 
0046   //! Modifier
0047   //! Sets the first pave <thePave>
0048   Standard_EXPORT void SetPave1(const BOPDS_Pave& thePave);
0049 
0050   //! Selector
0051   //! Returns the first pave
0052   Standard_EXPORT const BOPDS_Pave& Pave1() const;
0053 
0054   //! Modifier
0055   //! Sets the second pave <thePave>
0056   Standard_EXPORT void SetPave2(const BOPDS_Pave& thePave);
0057 
0058   //! Selector
0059   //! Returns the second pave
0060   Standard_EXPORT const BOPDS_Pave& Pave2() const;
0061 
0062   //! Modifier
0063   //! Sets the index of edge of pave block <theEdge>
0064   Standard_EXPORT void SetEdge(const Standard_Integer theEdge);
0065 
0066   //! Selector
0067   //! Returns the index of edge of pave block
0068   Standard_EXPORT Standard_Integer Edge() const;
0069 
0070   //! Query
0071   //! Returns true if the pave block has edge
0072   Standard_EXPORT Standard_Boolean HasEdge() const;
0073 
0074   //! Query
0075   //! Returns true if the pave block has edge
0076   //! Returns the index of edge <theEdge>
0077   Standard_EXPORT Standard_Boolean HasEdge(Standard_Integer& theEdge) const;
0078 
0079   //! Modifier
0080   //! Sets the index of original edge
0081   //! of the pave block <theEdge>
0082   Standard_EXPORT void SetOriginalEdge(const Standard_Integer theEdge);
0083 
0084   //! Selector
0085   //! Returns the index of original edge of pave block
0086   Standard_EXPORT Standard_Integer OriginalEdge() const;
0087 
0088   //! Query
0089   //! Returns true if the edge is equal to the original edge
0090   //! of the pave block
0091   Standard_EXPORT Standard_Boolean IsSplitEdge() const;
0092 
0093   //! Selector
0094   //! Returns the parametric range <theT1,theT2>
0095   //! of the pave block
0096   Standard_EXPORT void Range(Standard_Real& theT1, Standard_Real& theT2) const;
0097 
0098   //! Query
0099   //! Returns true if the pave block has pave indices
0100   //! that equal to the  pave indices of the pave block
0101   //! <theOther>
0102   Standard_EXPORT Standard_Boolean HasSameBounds(const Handle(BOPDS_PaveBlock)& theOther) const;
0103 
0104   //! Selector
0105   //! Returns the pave indices  <theIndex1,theIndex2>
0106   //! of the pave block
0107   Standard_EXPORT void Indices(Standard_Integer& theIndex1, Standard_Integer& theIndex2) const;
0108 
0109   //! Query
0110   //! Returns true if the pave block contains extra paves
0111   Standard_EXPORT Standard_Boolean IsToUpdate() const;
0112 
0113   //! Modifier
0114   //! Appends extra paves <thePave>
0115   Standard_EXPORT void AppendExtPave(const BOPDS_Pave& thePave);
0116 
0117   //! Modifier
0118   //! Appends extra pave <thePave>
0119   Standard_EXPORT void AppendExtPave1(const BOPDS_Pave& thePave);
0120 
0121   //! Modifier
0122   //! Removes a pave with the given vertex number from extra paves
0123   Standard_EXPORT void RemoveExtPave(const Standard_Integer theVertNum);
0124 
0125   //! Selector
0126   //! Returns the  extra paves
0127   Standard_EXPORT const BOPDS_ListOfPave& ExtPaves() const;
0128 
0129   //! Selector / Modifier
0130   //! Returns the extra paves
0131   Standard_EXPORT BOPDS_ListOfPave& ChangeExtPaves();
0132 
0133   //! Modifier
0134   //! Updates the pave block. The extra paves are used
0135   //! to create new pave blocks <theLPB>.
0136   //! <theFlag> - if true, the first pave and the second
0137   //! pave are used to produce new pave blocks.
0138   Standard_EXPORT void Update(BOPDS_ListOfPaveBlock& theLPB,
0139                               const Standard_Boolean theFlag = Standard_True);
0140 
0141   //! Query
0142   //! Returns true if the extra paves contain the pave
0143   //! with given value of the parameter <thePrm>
0144   //! <theTol>  - the value of the tolerance to compare
0145   //! <theInd>  - index of the found pave
0146   Standard_EXPORT Standard_Boolean ContainsParameter(const Standard_Real thePrm,
0147                                                      const Standard_Real theTol,
0148                                                      Standard_Integer&   theInd) const;
0149 
0150   //! Modifier
0151   //! Sets the shrunk data for the pave block
0152   //! <theTS1>,  <theTS2> - shrunk range
0153   //! <theBox> - the bounding box
0154   //! <theIsSplittable> - defines whether the edge can be split
0155   Standard_EXPORT void SetShrunkData(const Standard_Real    theTS1,
0156                                      const Standard_Real    theTS2,
0157                                      const Bnd_Box&         theBox,
0158                                      const Standard_Boolean theIsSplittable);
0159 
0160   //! Selector
0161   //! Returns  the shrunk data for the pave block
0162   //! <theTS1>,  <theTS2> - shrunk range
0163   //! <theBox> - the bounding box
0164   //! <theIsSplittable> - defines whether the edge can be split
0165   Standard_EXPORT void ShrunkData(Standard_Real&    theTS1,
0166                                   Standard_Real&    theTS2,
0167                                   Bnd_Box&          theBox,
0168                                   Standard_Boolean& theIsSplittable) const;
0169 
0170   //! Query
0171   //! Returns true if the pave block contains
0172   //! the shrunk data
0173   Standard_EXPORT Standard_Boolean HasShrunkData() const;
0174 
0175   Standard_EXPORT void Dump() const;
0176 
0177   //! Query
0178   //! Returns FALSE if the pave block has a too short
0179   //! shrunk range and cannot be split, otherwise returns TRUE
0180   Standard_Boolean IsSplittable() const { return myIsSplittable; }
0181 
0182   DEFINE_STANDARD_RTTIEXT(BOPDS_PaveBlock, Standard_Transient)
0183 
0184 protected:
0185   Handle(NCollection_BaseAllocator) myAllocator;
0186   Standard_Integer                  myEdge;
0187   Standard_Integer                  myOriginalEdge;
0188   BOPDS_Pave                        myPave1;
0189   BOPDS_Pave                        myPave2;
0190   BOPDS_ListOfPave                  myExtPaves;
0191   Standard_Real                     myTS1;
0192   Standard_Real                     myTS2;
0193   Bnd_Box                           myShrunkBox;
0194   TColStd_MapOfInteger              myMFence;
0195   Standard_Boolean                  myIsSplittable;
0196 
0197 private:
0198 };
0199 
0200 #endif // _BOPDS_PaveBlock_HeaderFile