geom/src/NMTTools/NMTTools_PaveFiller.hxx

501 lines
14 KiB
C++
Raw Normal View History

2013-04-01 18:25:01 +06:00
// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
2012-08-09 13:58:02 +06:00
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
2009-02-13 17:16:39 +05:00
//
2012-08-09 13:58:02 +06:00
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
2009-02-13 17:16:39 +05:00
//
2012-08-09 13:58:02 +06:00
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
2009-02-13 17:16:39 +05:00
//
2012-08-09 13:58:02 +06:00
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2009-02-13 17:16:39 +05:00
//
2012-08-09 13:58:02 +06:00
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: NMTTools_PaveFiller.hxx
// Created: Fri Dec 5 14:58:54 2003
// Author: Peter KURNEV
// <pkv@irinox>
//
2004-12-01 15:39:14 +05:00
#ifndef _NMTTools_PaveFiller_HeaderFile
#define _NMTTools_PaveFiller_HeaderFile
2012-08-09 13:58:02 +06:00
#include <Standard.hxx>
#include <Standard_Macro.hxx>
2004-12-01 15:39:14 +05:00
#include <NMTDS_PShapesDataStructure.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <BOPTools_PavePool.hxx>
#include <NMTTools_CommonBlockPool.hxx>
#include <BOPTools_SplitShapesPool.hxx>
2012-08-09 13:58:02 +06:00
#include <Handle_IntTools_Context.hxx>
2004-12-01 15:39:14 +05:00
#include <BOPTools_SSIntersectionAttribute.hxx>
#include <NMTTools_IndexedDataMapOfIndexedMapOfInteger.hxx>
#include <TColStd_DataMapOfIntegerInteger.hxx>
#include <NMTDS_PIterator.hxx>
#include <TopoDS_Shape.hxx>
#include <NMTDS_PInterfPool.hxx>
2012-08-09 13:58:02 +06:00
#include <NMTTools_DataMapOfIntegerFaceInfo.hxx>
2004-12-01 15:39:14 +05:00
#include <TopAbs_ShapeEnum.hxx>
2012-08-09 13:58:02 +06:00
#include <NMTTools_CommonBlock.hxx>
2004-12-01 15:39:14 +05:00
#include <Standard_Real.hxx>
2012-08-09 13:58:02 +06:00
#include <TopoDS_Shape.hxx>
#include <BOPTools_Pave.hxx>
#include <IntTools_ShrunkRange.hxx>
#include <BOPTools_PavePool.hxx>
#include <NMTTools_CommonBlockPool.hxx>
#include <BOPTools_SplitShapesPool.hxx>
#include <BOPTools_PaveBlock.hxx>
#include <TopoDS_Vertex.hxx>
#include <NMTTools_ListOfCommonBlock.hxx>
#include <BOPTools_IDMapOfPaveBlockIMapOfPaveBlock.hxx>
#include <BOPTools_IDMapOfPaveBlockIMapOfInteger.hxx>
#include <BooleanOperations_IndexedDataMapOfShapeInteger.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <BOPTools_ListOfPaveBlock.hxx>
#include <TopoDS_Face.hxx>
#include <BOPTools_PaveSet.hxx>
#include <BOPTools_Curve.hxx>
#include <BOPTools_SSInterference.hxx>
#include <gp_Pnt.hxx>
#include <NMTTools_IndexedDataMapOfIndexedMapOfInteger.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopoDS_Edge.hxx>
#include <TopTools_DataMapOfShapeShape.hxx>
/*
class TopoDS_Shape;
2004-12-01 15:39:14 +05:00
class BOPTools_Pave;
class IntTools_ShrunkRange;
class BOPTools_PavePool;
class NMTTools_CommonBlockPool;
class BOPTools_SplitShapesPool;
class BOPTools_PaveBlock;
class TopoDS_Vertex;
class NMTTools_ListOfCommonBlock;
class BOPTools_IDMapOfPaveBlockIMapOfPaveBlock;
class BOPTools_IDMapOfPaveBlockIMapOfInteger;
class BooleanOperations_IndexedDataMapOfShapeInteger;
class TColStd_ListOfInteger;
class BOPTools_ListOfPaveBlock;
class TopoDS_Face;
class BOPTools_PaveSet;
class BOPTools_Curve;
class BOPTools_SSInterference;
class gp_Pnt;
class NMTTools_IndexedDataMapOfIndexedMapOfInteger;
class TopTools_ListOfShape;
class TopoDS_Edge;
class TopTools_DataMapOfShapeShape;
2012-08-09 13:58:02 +06:00
class TCoLSTD_MapOfInteger;
*/
2004-12-01 15:39:14 +05:00
2012-08-09 13:58:02 +06:00
//=======================================================================
//function : NMTTools_PaveFiller
//purpose :
//=======================================================================
2004-12-01 15:39:14 +05:00
class NMTTools_PaveFiller {
2012-08-09 13:58:02 +06:00
public:
Standard_EXPORT
NMTTools_PaveFiller();
2004-12-01 15:39:14 +05:00
2012-08-09 13:58:02 +06:00
Standard_EXPORT
virtual ~NMTTools_PaveFiller();
2012-08-09 13:58:02 +06:00
Standard_EXPORT
void SetCompositeShape(const TopoDS_Shape& aS) ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
const TopoDS_Shape& CompositeShape() const;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
NMTDS_PShapesDataStructure DS() ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
NMTDS_PIterator DSIt() ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
NMTDS_PInterfPool IP() ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
virtual void Perform() ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
Standard_Boolean IsDone() const;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
const Handle_IntTools_Context& Context() const;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
const BOPTools_PavePool& PavePool() const;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
BOPTools_PavePool& ChangePavePool() ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
const NMTTools_CommonBlockPool& CommonBlockPool() const;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
NMTTools_CommonBlockPool& ChangeCommonBlockPool() ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
const BOPTools_SplitShapesPool& SplitShapesPool() const;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
BOPTools_SplitShapesPool& ChangeSplitShapesPool() ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
Standard_Integer FindSDVertex(const Standard_Integer nV) const;
Standard_EXPORT
Standard_Integer SplitsInFace(const Standard_Integer aBid,
const Standard_Integer nF1,
const Standard_Integer nF2,
TColStd_ListOfInteger& aLs) ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
Standard_Integer SplitsInFace(const Standard_Integer nE1,
const Standard_Integer nF2,
TColStd_ListOfInteger& aLs) ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
Standard_Integer SplitsOnEdge(const Standard_Integer nE1,
const Standard_Integer nE2,
TColStd_ListOfInteger& aLs) ;
Standard_EXPORT
Standard_Integer SplitsOnFace(const Standard_Integer nE1,
const Standard_Integer nF2,
TColStd_ListOfInteger& aLs) ;
Standard_EXPORT
Standard_Integer SplitsOnFace(const Standard_Integer aBid,
const Standard_Integer nF1,
const Standard_Integer nF2,
TColStd_ListOfInteger& aLs) ;
Standard_EXPORT
Standard_Integer SplitsInFace(const Standard_Integer aBid,
const Standard_Integer nF1,
const Standard_Integer nF2,
BOPTools_ListOfPaveBlock& aLs) ;
Standard_EXPORT
Standard_Integer SplitsInFace(const Standard_Integer nE1,
const Standard_Integer nF2,
BOPTools_ListOfPaveBlock& aLs) ;
Standard_EXPORT
Standard_Integer SplitsOnEdge(const Standard_Integer nE1,
const Standard_Integer nE2,
BOPTools_ListOfPaveBlock& aLs) ;
Standard_EXPORT
Standard_Integer SplitsOnFace(const Standard_Integer nE1,
const Standard_Integer nF2,
BOPTools_ListOfPaveBlock& aLs) ;
Standard_EXPORT
Standard_Integer SplitsOnFace(const Standard_Integer aBid,
const Standard_Integer nF1,
const Standard_Integer nF2,
BOPTools_ListOfPaveBlock& aLs) ;
Standard_EXPORT
Standard_Integer SplitsFace(const Standard_Integer nF2,
BOPTools_ListOfPaveBlock& aLs) ;
Standard_EXPORT
Standard_Integer SplitsFace(const Standard_Integer nF2,
TColStd_ListOfInteger& aLs) ;
Standard_EXPORT
Standard_Integer CommonBlocksFace(const Standard_Integer nF,
NMTTools_ListOfCommonBlock& aLCB) ;
Standard_EXPORT
void PrepareFace(const Standard_Integer nF,
TopoDS_Face& aF) ;
Standard_EXPORT
const BOPTools_PaveBlock& RealPaveBlock(const BOPTools_PaveBlock& aPB) ;
Standard_EXPORT
const BOPTools_PaveBlock& RealPaveBlock(const BOPTools_PaveBlock& aPB,
TColStd_ListOfInteger& aLB,
Standard_Integer& aIsCommonBlock) ;
Standard_EXPORT
void RealSplitsFace(const Standard_Integer nF2,
BOPTools_ListOfPaveBlock& aLs) ;
Standard_EXPORT
Standard_Boolean HasRealSplitsInOnFace(const Standard_Integer nF1,
const Standard_Integer nF2) ;
Standard_EXPORT
void RealSplitsInFace(const Standard_Integer aBid,
const Standard_Integer nF1,
const Standard_Integer nF2,
BOPTools_ListOfPaveBlock& aLs) ;
Standard_EXPORT
void RealSplitsInFace(const Standard_Integer nE1,
const Standard_Integer nF2,
BOPTools_ListOfPaveBlock& aLs) ;
Standard_EXPORT
void RealSplitsInFace(const Standard_Integer nF1,
BOPTools_ListOfPaveBlock& aLPB) ;
Standard_EXPORT
void RealSplitsOnEdge(const Standard_Integer nE1,
const Standard_Integer nE2,
BOPTools_ListOfPaveBlock& aLs) ;
Standard_EXPORT
void RealSplitsOnFace(const Standard_Integer nE1,
const Standard_Integer nF2,
BOPTools_ListOfPaveBlock& aLs) ;
Standard_EXPORT
void RealSplitsOnFace(const Standard_Integer aBid,
const Standard_Integer nF1,
const Standard_Integer nF2,
BOPTools_ListOfPaveBlock& aLs) ;
Standard_EXPORT
void PrepareSetForFace(const Standard_Integer nF1,
const Standard_Integer nF2,
const BOPTools_ListOfPaveBlock& aLPB,
BOPTools_PaveSet& aPSF) ;
Standard_EXPORT
void PutPaveOnCurve(const BOPTools_PaveSet& aPSF,
const Standard_Real aTol,
BOPTools_Curve& aBC) ;
Standard_EXPORT
void PutBoundPaveOnCurve(BOPTools_Curve& aBC,
BOPTools_SSInterference& aFF) ;
Standard_EXPORT
void PutBoundPaveOnCurve(const gp_Pnt& aP,
const Standard_Real aT,
BOPTools_Curve& aBC,
BOPTools_SSInterference& aFF) ;
Standard_EXPORT
Standard_Boolean FindPave(const gp_Pnt& aP,
const Standard_Real aTpV,
const BOPTools_PaveSet& aPS,
BOPTools_Pave& aPV) ;
Standard_EXPORT
Standard_Integer CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,
const BOPTools_PaveBlock& aPBR,
const Standard_Real aTol) ;
Standard_EXPORT
Standard_Boolean IsExistingPaveBlock(const BOPTools_PaveBlock& aPB,
const BOPTools_ListOfPaveBlock& aLPB,
const Standard_Real aTol) ;
Standard_EXPORT
void MakePCurves() ;
Standard_EXPORT
const NMTTools_IndexedDataMapOfIndexedMapOfInteger& AloneVertices() const;
Standard_EXPORT
Standard_Boolean IsExistingPaveBlock(const BOPTools_PaveBlock& aPB,
const TopTools_ListOfShape& aLPB,
const Standard_Real aTol) ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
Standard_Boolean CheckCoincidence(const BOPTools_PaveBlock& aPB,
const BOPTools_ListOfPaveBlock& aLPB) ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
Standard_Integer CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,
const TopoDS_Edge& aE,
const Standard_Real aTol) ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
void SharedEdges(const Standard_Integer nF1,
const Standard_Integer nF2,
TColStd_ListOfInteger& aLNE,
TopTools_ListOfShape& aLSE) ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
void FuseVertices(const TopoDS_Shape& aC,
TopTools_DataMapOfShapeShape& aDMVV) const;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
void TreatPaveBlocks(NMTTools_ListOfCommonBlock& theLCB) ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
BOPTools_PavePool& ChangePavePoolNew() ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
Standard_Boolean CheckCoincidence(const BOPTools_PaveBlock& aPB1,
const BOPTools_PaveBlock& aPB2) ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
void PutClosingPaveOnCurve(BOPTools_Curve& aBC,
BOPTools_SSInterference& aFF) ;
2012-08-09 13:58:02 +06:00
protected:
Standard_EXPORT
virtual void Init() ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
virtual void Clear() ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
virtual void PerformVV() ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
virtual void PerformVE() ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
virtual void PerformVF() ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
virtual void PerformEE() ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
virtual void PerformEF() ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
virtual void PerformFF() ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
void MakeSplitEdges() ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
virtual void PreparePaveBlocks(const TopAbs_ShapeEnum aType1,
const TopAbs_ShapeEnum aType2) ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
void CorrectShrunkRanges(const Standard_Integer aSide,
const BOPTools_Pave& aPave,
IntTools_ShrunkRange& aSR) ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
virtual void PreparePaveBlocks(const Standard_Integer anE) ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
virtual void PrepareEdges() ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
Standard_Boolean IsSuccessorsComputed(const Standard_Integer iF1,
const Standard_Integer iF2) const;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
Standard_Boolean IsBlocksCoinside(const BOPTools_PaveBlock& aPB1,
const BOPTools_PaveBlock& aPB2) const;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
void RefinePavePool() ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
Standard_Integer CheckFacePaves(const TopoDS_Vertex& aV,
const Standard_Integer nF) ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
void ReplaceCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
void RemoveCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
void SplitCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
void SplitCommonBlock(const NMTTools_CommonBlock& aCB,NMTTools_ListOfCommonBlock& aLCB) ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
void EECommonBlocks(const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aM) ;
2004-12-01 15:39:14 +05:00
2012-08-09 13:58:02 +06:00
Standard_EXPORT
void EFCommonBlocks(const BOPTools_IDMapOfPaveBlockIMapOfInteger& aMapCB) ;
2004-12-01 15:39:14 +05:00
2012-08-09 13:58:02 +06:00
Standard_EXPORT
void EENewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
void EENewVertices(const TopoDS_Vertex& aV,
const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
void EFNewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
void EFNewVertices(const TopoDS_Vertex& aV,
const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
void UpdateCommonBlocks() ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
void UpdateCommonBlocks(const Standard_Integer aI) ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
void UpdatePaveBlocks() ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
Standard_Integer SplitIndex(const BOPTools_PaveBlock& aPB) const;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
void MakeBlocks() ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
void PerformVF1() ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
void MakeAloneVertices() ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
void FillFaceInfo() ;
2012-08-09 13:58:02 +06:00
Standard_EXPORT
void CorrectTolR3D(const BOPTools_SSInterference& aFF,
const TColStd_MapOfInteger& aMVStick,
Standard_Real& aTolR3D) ;
2004-12-01 15:39:14 +05:00
2012-08-09 13:58:02 +06:00
NMTDS_PShapesDataStructure myDS;
Standard_Boolean myIsDone;
Standard_Integer myNbSources;
Standard_Integer myNbEdges;
BOPTools_PavePool myPavePool;
BOPTools_PavePool myPavePoolNew;
NMTTools_CommonBlockPool myCommonBlockPool;
BOPTools_SplitShapesPool mySplitShapesPool;
Handle_IntTools_Context myContext;
BOPTools_SSIntersectionAttribute mySectionAttribute;
NMTTools_IndexedDataMapOfIndexedMapOfInteger myAloneVertices;
TColStd_DataMapOfIntegerInteger myVSD;
NMTDS_PIterator myDSIt;
TopoDS_Shape myCompositeShape;
NMTDS_PInterfPool myIP;
NMTTools_DataMapOfIntegerFaceInfo myFaceInfo;
2004-12-01 15:39:14 +05:00
2012-08-09 13:58:02 +06:00
// private:
2004-12-01 15:39:14 +05:00
};
#endif