Back to home page

EIC code displayed by LXR

 
 

    


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

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