Back to index

salome-geom  6.5.0
NMTTools_PaveFiller.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 // File:        NMTTools_PaveFiller.hxx
00024 // Created:     Fri Dec  5 14:58:54 2003
00025 // Author:      Peter KURNEV
00026 //              <pkv@irinox>
00027 //
00028 #ifndef _NMTTools_PaveFiller_HeaderFile
00029 #define _NMTTools_PaveFiller_HeaderFile
00030 
00031 #include <Standard.hxx>
00032 #include <Standard_Macro.hxx>
00033 #include <NMTDS_PShapesDataStructure.hxx>
00034 #include <Standard_Boolean.hxx>
00035 #include <Standard_Integer.hxx>
00036 #include <BOPTools_PavePool.hxx>
00037 #include <NMTTools_CommonBlockPool.hxx>
00038 #include <BOPTools_SplitShapesPool.hxx>
00039 #include <Handle_IntTools_Context.hxx>
00040 #include <BOPTools_SSIntersectionAttribute.hxx>
00041 #include <NMTTools_IndexedDataMapOfIndexedMapOfInteger.hxx>
00042 #include <TColStd_DataMapOfIntegerInteger.hxx>
00043 #include <NMTDS_PIterator.hxx>
00044 #include <TopoDS_Shape.hxx>
00045 #include <NMTDS_PInterfPool.hxx>
00046 #include <NMTTools_DataMapOfIntegerFaceInfo.hxx>
00047 #include <TopAbs_ShapeEnum.hxx>
00048 #include <NMTTools_CommonBlock.hxx>
00049 #include <Standard_Real.hxx>
00050 
00051 #include <TopoDS_Shape.hxx>
00052 #include <BOPTools_Pave.hxx>
00053 #include <IntTools_ShrunkRange.hxx>
00054 #include <BOPTools_PavePool.hxx>
00055 #include <NMTTools_CommonBlockPool.hxx>
00056 #include <BOPTools_SplitShapesPool.hxx>
00057 #include <BOPTools_PaveBlock.hxx>
00058 #include <TopoDS_Vertex.hxx>
00059 #include <NMTTools_ListOfCommonBlock.hxx>
00060 #include <BOPTools_IDMapOfPaveBlockIMapOfPaveBlock.hxx>
00061 #include <BOPTools_IDMapOfPaveBlockIMapOfInteger.hxx>
00062 #include <BooleanOperations_IndexedDataMapOfShapeInteger.hxx>
00063 #include <TColStd_ListOfInteger.hxx>
00064 #include <BOPTools_ListOfPaveBlock.hxx>
00065 #include <TopoDS_Face.hxx>
00066 #include <BOPTools_PaveSet.hxx>
00067 #include <BOPTools_Curve.hxx>
00068 #include <BOPTools_SSInterference.hxx>
00069 #include <gp_Pnt.hxx>
00070 #include <NMTTools_IndexedDataMapOfIndexedMapOfInteger.hxx>
00071 #include <TopTools_ListOfShape.hxx>
00072 #include <TopoDS_Edge.hxx>
00073 #include <TopTools_DataMapOfShapeShape.hxx>
00074 
00075 
00076 /*
00077 class TopoDS_Shape;
00078 class BOPTools_Pave;
00079 class IntTools_ShrunkRange;
00080 class BOPTools_PavePool;
00081 class NMTTools_CommonBlockPool;
00082 class BOPTools_SplitShapesPool;
00083 class BOPTools_PaveBlock;
00084 class TopoDS_Vertex;
00085 class NMTTools_ListOfCommonBlock;
00086 class BOPTools_IDMapOfPaveBlockIMapOfPaveBlock;
00087 class BOPTools_IDMapOfPaveBlockIMapOfInteger;
00088 class BooleanOperations_IndexedDataMapOfShapeInteger;
00089 class TColStd_ListOfInteger;
00090 class BOPTools_ListOfPaveBlock;
00091 class TopoDS_Face;
00092 class BOPTools_PaveSet;
00093 class BOPTools_Curve;
00094 class BOPTools_SSInterference;
00095 class gp_Pnt;
00096 class NMTTools_IndexedDataMapOfIndexedMapOfInteger;
00097 class TopTools_ListOfShape;
00098 class TopoDS_Edge;
00099 class TopTools_DataMapOfShapeShape;
00100 class TCoLSTD_MapOfInteger;
00101 */
00102 
00103 
00104 //=======================================================================
00105 //function : NMTTools_PaveFiller
00106 //purpose  :
00107 //=======================================================================
00108 class NMTTools_PaveFiller  {
00109  public:
00110   Standard_EXPORT
00111     NMTTools_PaveFiller();
00112 
00113   Standard_EXPORT
00114   virtual ~NMTTools_PaveFiller();
00115 
00116   Standard_EXPORT
00117     void SetCompositeShape(const TopoDS_Shape& aS) ;
00118 
00119   Standard_EXPORT
00120     const TopoDS_Shape& CompositeShape() const;
00121 
00122   Standard_EXPORT
00123     NMTDS_PShapesDataStructure DS() ;
00124 
00125   Standard_EXPORT
00126     NMTDS_PIterator DSIt() ;
00127 
00128   Standard_EXPORT
00129     NMTDS_PInterfPool IP() ;
00130 
00131   Standard_EXPORT
00132     virtual  void Perform() ;
00133 
00134   Standard_EXPORT
00135     Standard_Boolean IsDone() const;
00136 
00137   Standard_EXPORT
00138     const Handle_IntTools_Context& Context() const;
00139 
00140   Standard_EXPORT
00141     const BOPTools_PavePool& PavePool() const;
00142 
00143   Standard_EXPORT
00144     BOPTools_PavePool& ChangePavePool() ;
00145 
00146   Standard_EXPORT
00147     const NMTTools_CommonBlockPool& CommonBlockPool() const;
00148 
00149   Standard_EXPORT
00150     NMTTools_CommonBlockPool& ChangeCommonBlockPool() ;
00151 
00152   Standard_EXPORT
00153     const BOPTools_SplitShapesPool& SplitShapesPool() const;
00154 
00155   Standard_EXPORT
00156     BOPTools_SplitShapesPool& ChangeSplitShapesPool() ;
00157 
00158   Standard_EXPORT
00159     Standard_Integer FindSDVertex(const Standard_Integer nV) const;
00160 
00161   Standard_EXPORT
00162     Standard_Integer SplitsInFace(const Standard_Integer aBid,
00163                               const Standard_Integer nF1,
00164                               const Standard_Integer nF2,
00165                               TColStd_ListOfInteger& aLs) ;
00166 
00167   Standard_EXPORT
00168     Standard_Integer SplitsInFace(const Standard_Integer nE1,
00169                               const Standard_Integer nF2,
00170                               TColStd_ListOfInteger& aLs) ;
00171 
00172   Standard_EXPORT
00173     Standard_Integer SplitsOnEdge(const Standard_Integer nE1,
00174                               const Standard_Integer nE2,
00175                               TColStd_ListOfInteger& aLs) ;
00176 
00177   Standard_EXPORT
00178     Standard_Integer SplitsOnFace(const Standard_Integer nE1,
00179                               const Standard_Integer nF2,
00180                               TColStd_ListOfInteger& aLs) ;
00181 
00182   Standard_EXPORT
00183     Standard_Integer SplitsOnFace(const Standard_Integer aBid,
00184                               const Standard_Integer nF1,
00185                               const Standard_Integer nF2,
00186                               TColStd_ListOfInteger& aLs) ;
00187 
00188   Standard_EXPORT
00189     Standard_Integer SplitsInFace(const Standard_Integer aBid,
00190                               const Standard_Integer nF1,
00191                               const Standard_Integer nF2,
00192                               BOPTools_ListOfPaveBlock& aLs) ;
00193 
00194   Standard_EXPORT
00195     Standard_Integer SplitsInFace(const Standard_Integer nE1,
00196                               const Standard_Integer nF2,
00197                               BOPTools_ListOfPaveBlock& aLs) ;
00198 
00199   Standard_EXPORT
00200     Standard_Integer SplitsOnEdge(const Standard_Integer nE1,
00201                               const Standard_Integer nE2,
00202                               BOPTools_ListOfPaveBlock& aLs) ;
00203 
00204   Standard_EXPORT
00205     Standard_Integer SplitsOnFace(const Standard_Integer nE1,
00206                               const Standard_Integer nF2,
00207                               BOPTools_ListOfPaveBlock& aLs) ;
00208 
00209   Standard_EXPORT
00210     Standard_Integer SplitsOnFace(const Standard_Integer aBid,
00211                               const Standard_Integer nF1,
00212                               const Standard_Integer nF2,
00213                               BOPTools_ListOfPaveBlock& aLs) ;
00214 
00215   Standard_EXPORT
00216     Standard_Integer SplitsFace(const Standard_Integer nF2,
00217                             BOPTools_ListOfPaveBlock& aLs) ;
00218 
00219   Standard_EXPORT
00220     Standard_Integer SplitsFace(const Standard_Integer nF2,
00221                             TColStd_ListOfInteger& aLs) ;
00222 
00223   Standard_EXPORT
00224     Standard_Integer CommonBlocksFace(const Standard_Integer nF,
00225                                   NMTTools_ListOfCommonBlock& aLCB) ;
00226 
00227   Standard_EXPORT
00228     void PrepareFace(const Standard_Integer nF,
00229                    TopoDS_Face& aF) ;
00230 
00231   Standard_EXPORT
00232     const BOPTools_PaveBlock& RealPaveBlock(const BOPTools_PaveBlock& aPB) ;
00233 
00234   Standard_EXPORT
00235     const BOPTools_PaveBlock& RealPaveBlock(const BOPTools_PaveBlock& aPB,
00236                                        TColStd_ListOfInteger& aLB,
00237                                        Standard_Integer& aIsCommonBlock) ;
00238 
00239   Standard_EXPORT
00240     void RealSplitsFace(const Standard_Integer nF2,
00241                      BOPTools_ListOfPaveBlock& aLs) ;
00242 
00243   Standard_EXPORT
00244     Standard_Boolean HasRealSplitsInOnFace(const Standard_Integer nF1,
00245                                       const Standard_Integer nF2) ;
00246 
00247   Standard_EXPORT
00248     void RealSplitsInFace(const Standard_Integer aBid,
00249                        const Standard_Integer nF1,
00250                        const Standard_Integer nF2,
00251                        BOPTools_ListOfPaveBlock& aLs) ;
00252 
00253   Standard_EXPORT
00254     void RealSplitsInFace(const Standard_Integer nE1,
00255                        const Standard_Integer nF2,
00256                        BOPTools_ListOfPaveBlock& aLs) ;
00257 
00258   Standard_EXPORT
00259     void RealSplitsInFace(const Standard_Integer nF1,
00260                        BOPTools_ListOfPaveBlock& aLPB) ;
00261 
00262   Standard_EXPORT
00263     void RealSplitsOnEdge(const Standard_Integer nE1,
00264                        const Standard_Integer nE2,
00265                        BOPTools_ListOfPaveBlock& aLs) ;
00266 
00267   Standard_EXPORT
00268     void RealSplitsOnFace(const Standard_Integer nE1,
00269                        const Standard_Integer nF2,
00270                        BOPTools_ListOfPaveBlock& aLs) ;
00271 
00272   Standard_EXPORT
00273     void RealSplitsOnFace(const Standard_Integer aBid,
00274                        const Standard_Integer nF1,
00275                        const Standard_Integer nF2,
00276                        BOPTools_ListOfPaveBlock& aLs) ;
00277 
00278   Standard_EXPORT
00279     void PrepareSetForFace(const Standard_Integer nF1,
00280                         const Standard_Integer nF2,
00281                         const BOPTools_ListOfPaveBlock& aLPB,
00282                         BOPTools_PaveSet& aPSF) ;
00283 
00284   Standard_EXPORT
00285     void PutPaveOnCurve(const BOPTools_PaveSet& aPSF,
00286                      const Standard_Real aTol,
00287                      BOPTools_Curve& aBC) ;
00288 
00289   Standard_EXPORT
00290     void PutBoundPaveOnCurve(BOPTools_Curve& aBC,
00291                           BOPTools_SSInterference& aFF) ;
00292 
00293   Standard_EXPORT
00294     void PutBoundPaveOnCurve(const gp_Pnt& aP,
00295                           const Standard_Real aT,
00296                           BOPTools_Curve& aBC,
00297                           BOPTools_SSInterference& aFF) ;
00298 
00299   Standard_EXPORT
00300     Standard_Boolean FindPave(const gp_Pnt& aP,
00301                            const Standard_Real aTpV,
00302                            const BOPTools_PaveSet& aPS,
00303                            BOPTools_Pave& aPV) ;
00304 
00305   Standard_EXPORT
00306     Standard_Integer CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,
00307                                        const BOPTools_PaveBlock& aPBR,
00308                                        const Standard_Real aTol) ;
00309 
00310   Standard_EXPORT
00311     Standard_Boolean IsExistingPaveBlock(const BOPTools_PaveBlock& aPB,
00312                                     const BOPTools_ListOfPaveBlock& aLPB,
00313                                     const Standard_Real aTol) ;
00314 
00315   Standard_EXPORT
00316     void MakePCurves() ;
00317 
00318   Standard_EXPORT
00319     const NMTTools_IndexedDataMapOfIndexedMapOfInteger& AloneVertices() const;
00320 
00321   Standard_EXPORT
00322     Standard_Boolean IsExistingPaveBlock(const BOPTools_PaveBlock& aPB,
00323                                     const TopTools_ListOfShape& aLPB,
00324                                     const Standard_Real aTol) ;
00325 
00326   Standard_EXPORT
00327     Standard_Boolean CheckCoincidence(const BOPTools_PaveBlock& aPB,
00328                                   const BOPTools_ListOfPaveBlock& aLPB) ;
00329 
00330   Standard_EXPORT
00331     Standard_Integer CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,
00332                                        const TopoDS_Edge& aE,
00333                                        const Standard_Real aTol) ;
00334 
00335   Standard_EXPORT
00336     void SharedEdges(const Standard_Integer nF1,
00337                    const Standard_Integer nF2,
00338                    TColStd_ListOfInteger& aLNE,
00339                    TopTools_ListOfShape& aLSE) ;
00340 
00341   Standard_EXPORT
00342     void FuseVertices(const TopoDS_Shape& aC,
00343                     TopTools_DataMapOfShapeShape& aDMVV) const;
00344 
00345   Standard_EXPORT
00346     void TreatPaveBlocks(NMTTools_ListOfCommonBlock& theLCB) ;
00347 
00348   Standard_EXPORT
00349     BOPTools_PavePool& ChangePavePoolNew() ;
00350 
00351   Standard_EXPORT
00352     Standard_Boolean CheckCoincidence(const BOPTools_PaveBlock& aPB1,
00353                                   const BOPTools_PaveBlock& aPB2) ;
00354 
00355   Standard_EXPORT
00356     void PutClosingPaveOnCurve(BOPTools_Curve& aBC,
00357                             BOPTools_SSInterference& aFF) ;
00358 
00359  protected:
00360   Standard_EXPORT
00361     virtual  void Init() ;
00362 
00363   Standard_EXPORT
00364     virtual  void Clear() ;
00365 
00366   Standard_EXPORT
00367     virtual  void PerformVV() ;
00368 
00369   Standard_EXPORT
00370     virtual  void PerformVE() ;
00371 
00372   Standard_EXPORT
00373     virtual  void PerformVF() ;
00374 
00375   Standard_EXPORT
00376     virtual  void PerformEE() ;
00377 
00378   Standard_EXPORT
00379     virtual  void PerformEF() ;
00380 
00381   Standard_EXPORT
00382     virtual  void PerformFF() ;
00383 
00384   Standard_EXPORT
00385     void MakeSplitEdges() ;
00386 
00387   Standard_EXPORT
00388     virtual  void PreparePaveBlocks(const TopAbs_ShapeEnum aType1,
00389                                 const TopAbs_ShapeEnum aType2) ;
00390 
00391   Standard_EXPORT
00392     void CorrectShrunkRanges(const Standard_Integer aSide,
00393                           const BOPTools_Pave& aPave,
00394                           IntTools_ShrunkRange& aSR) ;
00395 
00396   Standard_EXPORT
00397     virtual  void PreparePaveBlocks(const Standard_Integer anE) ;
00398 
00399   Standard_EXPORT
00400     virtual  void PrepareEdges() ;
00401 
00402   Standard_EXPORT
00403     Standard_Boolean IsSuccessorsComputed(const Standard_Integer iF1,
00404                                      const Standard_Integer iF2) const;
00405 
00406   Standard_EXPORT
00407     Standard_Boolean IsBlocksCoinside(const BOPTools_PaveBlock& aPB1,
00408                                   const BOPTools_PaveBlock& aPB2) const;
00409 
00410   Standard_EXPORT
00411     void RefinePavePool() ;
00412 
00413   Standard_EXPORT
00414     Standard_Integer CheckFacePaves(const TopoDS_Vertex& aV,
00415                                 const Standard_Integer nF) ;
00416 
00417   Standard_EXPORT
00418     void ReplaceCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ;
00419 
00420   Standard_EXPORT
00421     void RemoveCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ;
00422 
00423   Standard_EXPORT
00424     void SplitCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ;
00425 
00426   Standard_EXPORT
00427     void SplitCommonBlock(const NMTTools_CommonBlock& aCB,NMTTools_ListOfCommonBlock& aLCB) ;
00428 
00429   Standard_EXPORT
00430     void EECommonBlocks(const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aM) ;
00431 
00432   Standard_EXPORT
00433     void EFCommonBlocks(const BOPTools_IDMapOfPaveBlockIMapOfInteger& aMapCB) ;
00434 
00435   Standard_EXPORT
00436     void EENewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ;
00437 
00438   Standard_EXPORT
00439     void EENewVertices(const TopoDS_Vertex& aV,
00440                      const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ;
00441 
00442   Standard_EXPORT
00443     void EFNewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ;
00444 
00445   Standard_EXPORT
00446      void EFNewVertices(const TopoDS_Vertex& aV,
00447                      const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ;
00448 
00449   Standard_EXPORT
00450     void UpdateCommonBlocks() ;
00451 
00452   Standard_EXPORT
00453     void UpdateCommonBlocks(const Standard_Integer aI) ;
00454 
00455   Standard_EXPORT
00456     void UpdatePaveBlocks() ;
00457 
00458   Standard_EXPORT
00459     Standard_Integer SplitIndex(const BOPTools_PaveBlock& aPB) const;
00460 
00461   Standard_EXPORT
00462     void MakeBlocks() ;
00463 
00464   Standard_EXPORT
00465     void PerformVF1() ;
00466 
00467   Standard_EXPORT
00468     void MakeAloneVertices() ;
00469 
00470   Standard_EXPORT
00471     void FillFaceInfo() ;
00472 
00473   Standard_EXPORT
00474     void CorrectTolR3D(const BOPTools_SSInterference& aFF,
00475                      const TColStd_MapOfInteger& aMVStick,
00476                      Standard_Real& aTolR3D) ;
00477 
00478 
00479   NMTDS_PShapesDataStructure myDS;
00480   Standard_Boolean myIsDone;
00481   Standard_Integer myNbSources;
00482   Standard_Integer myNbEdges;
00483   BOPTools_PavePool myPavePool;
00484   BOPTools_PavePool myPavePoolNew;
00485   NMTTools_CommonBlockPool myCommonBlockPool;
00486   BOPTools_SplitShapesPool mySplitShapesPool;
00487   Handle_IntTools_Context myContext;
00488   BOPTools_SSIntersectionAttribute mySectionAttribute;
00489   NMTTools_IndexedDataMapOfIndexedMapOfInteger myAloneVertices;
00490   TColStd_DataMapOfIntegerInteger myVSD;
00491   NMTDS_PIterator myDSIt;
00492   TopoDS_Shape myCompositeShape;
00493   NMTDS_PInterfPool myIP;
00494   NMTTools_DataMapOfIntegerFaceInfo myFaceInfo;
00495 
00496 
00497   // private:
00498 
00499 };
00500 #endif