mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-23 19:40:33 +05:00
Mantis issue 0021191: GlueEdges and GlueFaces problem with tolerance 1. A fix by PKV.
This commit is contained in:
parent
426cef8148
commit
f91bad6fb6
@ -18,12 +18,10 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
// File: GEOMAlgo_GlueDetector.cxx
|
||||
// Created:
|
||||
// Author: Peter KURNEV
|
||||
// <pkv@irinox>
|
||||
//
|
||||
|
||||
#include <GEOMAlgo_GlueDetector.hxx>
|
||||
|
||||
#include <Bnd_Box.hxx>
|
||||
@ -61,10 +59,25 @@
|
||||
#include <GEOMAlgo_PassKeyShape.hxx>
|
||||
#include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
|
||||
#include <GEOMAlgo_Tools.hxx>
|
||||
//
|
||||
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
|
||||
//modified by NIZNHY-PKV Tue Mar 13 10:25:47 2012f
|
||||
static
|
||||
Standard_Integer CheckAncesstors
|
||||
(const TopoDS_Shape& aVSD,
|
||||
const TopTools_MapOfShape& aMVSD,
|
||||
const TopTools_IndexedDataMapOfShapeListOfShape& aMVE,
|
||||
const TopTools_IndexedDataMapOfShapeListOfShape& aMEV,
|
||||
TopTools_IndexedDataMapOfShapeListOfShape& aMEVZ);
|
||||
//modified by NIZNHY-PKV Tue Mar 13 10:25:50 2012t
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
GEOMAlgo_GlueDetector::GEOMAlgo_GlueDetector()
|
||||
:
|
||||
@ -73,18 +86,30 @@ GEOMAlgo_GlueDetector::GEOMAlgo_GlueDetector()
|
||||
{}
|
||||
//=======================================================================
|
||||
//function : ~
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
GEOMAlgo_GlueDetector::~GEOMAlgo_GlueDetector()
|
||||
{}
|
||||
//modified by NIZNHY-PKV Tue Mar 13 12:26:50 2012f
|
||||
//=======================================================================
|
||||
//function : StickedShapes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const TopTools_IndexedDataMapOfShapeListOfShape&
|
||||
GEOMAlgo_GlueDetector::StickedShapes()
|
||||
{
|
||||
return myStickedShapes;
|
||||
}
|
||||
//modified by NIZNHY-PKV Tue Mar 13 12:26:54 2012t
|
||||
//=======================================================================
|
||||
//function : Perform
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_GlueDetector::Perform()
|
||||
{
|
||||
myErrorStatus=0;
|
||||
myWarningStatus=0;
|
||||
myStickedShapes.Clear();
|
||||
//
|
||||
CheckData();
|
||||
if (myErrorStatus) {
|
||||
@ -99,6 +124,13 @@ void GEOMAlgo_GlueDetector::Perform()
|
||||
return;
|
||||
}
|
||||
//
|
||||
//modified by NIZNHY-PKV Wed Mar 14 08:00:09 2012f
|
||||
CheckDetected();
|
||||
if (myErrorStatus) {
|
||||
return;
|
||||
}
|
||||
//modified by NIZNHY-PKV Wed Mar 14 08:00:12 2012t
|
||||
//
|
||||
DetectEdges();
|
||||
if (myErrorStatus) {
|
||||
return;
|
||||
@ -111,7 +143,7 @@ void GEOMAlgo_GlueDetector::Perform()
|
||||
}
|
||||
//=======================================================================
|
||||
//function : DetectVertices
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_GlueDetector::DetectVertices()
|
||||
{
|
||||
@ -127,7 +159,6 @@ void GEOMAlgo_GlueDetector::DetectVertices()
|
||||
TopTools_DataMapOfShapeListOfShape aMVV;
|
||||
GEOMAlgo_IndexedDataMapOfIntegerShape aMIS;
|
||||
NMTDS_IndexedDataMapOfShapeBndSphere aMSB;
|
||||
//
|
||||
NMTDS_BndSphereTreeSelector aSelector;
|
||||
NMTDS_BndSphereTree aBBTree;
|
||||
NCollection_UBTreeFiller <Standard_Integer, NMTDS_BndSphere> aTreeFiller(aBBTree);
|
||||
@ -155,7 +186,7 @@ void GEOMAlgo_GlueDetector::DetectVertices()
|
||||
aTreeFiller.Add(i, aBox);
|
||||
//
|
||||
aMIS.Add(i, aV);
|
||||
aMSB.Add(aV, aBox);
|
||||
aMSB.Add(aV, aBox);
|
||||
}
|
||||
//
|
||||
aTreeFiller.Fill();
|
||||
@ -179,49 +210,49 @@ void GEOMAlgo_GlueDetector::DetectVertices()
|
||||
aNbIP=aMIP.Extent();
|
||||
aIt1.Initialize(aMIP);
|
||||
for(; aIt1.More(); aIt1.Next()) {
|
||||
aIP=aIt1.Key();
|
||||
if (aMIPC.Contains(aIP)) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
|
||||
const NMTDS_BndSphere& aBoxVP=aMSB.FindFromKey(aVP);
|
||||
//
|
||||
aSelector.Clear();
|
||||
aSelector.SetBox(aBoxVP);
|
||||
//
|
||||
aNbVSD=aBBTree.Select(aSelector);
|
||||
if (!aNbVSD) {
|
||||
continue; // it shoild not be so [at least IP itself]
|
||||
}
|
||||
//
|
||||
const TColStd_ListOfInteger& aLI=aSelector.Indices();
|
||||
aIt.Initialize(aLI);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
aIP1=aIt.Value();
|
||||
if (aMIP.Contains(aIP1)) {
|
||||
continue;
|
||||
}
|
||||
aMIP1.Add(aIP1);
|
||||
} //for (; aIt.More(); aIt.Next()) {
|
||||
aIP=aIt1.Key();
|
||||
if (aMIPC.Contains(aIP)) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
|
||||
const NMTDS_BndSphere& aBoxVP=aMSB.FindFromKey(aVP);
|
||||
//
|
||||
aSelector.Clear();
|
||||
aSelector.SetBox(aBoxVP);
|
||||
//
|
||||
aNbVSD=aBBTree.Select(aSelector);
|
||||
if (!aNbVSD) {
|
||||
continue; // it shoild not be so [at least IP itself]
|
||||
}
|
||||
//
|
||||
const TColStd_ListOfInteger& aLI=aSelector.Indices();
|
||||
aIt.Initialize(aLI);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
aIP1=aIt.Value();
|
||||
if (aMIP.Contains(aIP1)) {
|
||||
continue;
|
||||
}
|
||||
aMIP1.Add(aIP1);
|
||||
} //for (; aIt.More(); aIt.Next()) {
|
||||
}//for(; aIt1.More(); aIt1.Next()) {
|
||||
//
|
||||
aNbIP1=aMIP1.Extent();
|
||||
if (!aNbIP1) {
|
||||
break;
|
||||
break;
|
||||
}
|
||||
//
|
||||
aIt1.Initialize(aMIP);
|
||||
for(; aIt1.More(); aIt1.Next()) {
|
||||
aIP=aIt1.Key();
|
||||
aMIPC.Add(aIP);
|
||||
aIP=aIt1.Key();
|
||||
aMIPC.Add(aIP);
|
||||
}
|
||||
//
|
||||
aMIP.Clear();
|
||||
aIt1.Initialize(aMIP1);
|
||||
for(; aIt1.More(); aIt1.Next()) {
|
||||
aIP=aIt1.Key();
|
||||
aMIP.Add(aIP);
|
||||
aIP=aIt1.Key();
|
||||
aMIP.Add(aIP);
|
||||
}
|
||||
aMIP1.Clear();
|
||||
}// while(1)
|
||||
@ -239,7 +270,7 @@ void GEOMAlgo_GlueDetector::DetectVertices()
|
||||
aIP=aIt1.Key();
|
||||
const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
|
||||
if (!j) {
|
||||
aVF=aVP;
|
||||
aVF=aVP;
|
||||
}
|
||||
aLVSD.Append(aVP);
|
||||
aMVProcessed.Add(aVP);
|
||||
@ -257,14 +288,14 @@ void GEOMAlgo_GlueDetector::DetectVertices()
|
||||
for (; aItS.More(); aItS.Next()) {
|
||||
const TopoDS_Shape& aVSD=aItS.Value();
|
||||
if (!myOrigins.IsBound(aVSD)) {
|
||||
myOrigins.Bind(aVSD, aV);
|
||||
myOrigins.Bind(aVSD, aV);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
//function : DetectFaces
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_GlueDetector::DetectFaces()
|
||||
{
|
||||
@ -272,7 +303,7 @@ void GEOMAlgo_GlueDetector::DetectFaces()
|
||||
}
|
||||
//=======================================================================
|
||||
//function : DetectEdges
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_GlueDetector::DetectEdges()
|
||||
{
|
||||
@ -280,7 +311,7 @@ void GEOMAlgo_GlueDetector::DetectEdges()
|
||||
}
|
||||
//=======================================================================
|
||||
//function : DetectShapes
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_GlueDetector::DetectShapes(const TopAbs_ShapeEnum aType)
|
||||
{
|
||||
@ -298,7 +329,7 @@ void GEOMAlgo_GlueDetector::DetectShapes(const TopAbs_ShapeEnum aType)
|
||||
aNbF=aMF.Extent();
|
||||
for (i=1; i<=aNbF; ++i) {
|
||||
const TopoDS_Shape& aS=aMF(i);
|
||||
//
|
||||
//
|
||||
if (aType==TopAbs_FACE) {
|
||||
const TopoDS_Face& aF=*((TopoDS_Face*)&aS);
|
||||
FacePassKey(aF, aPKF);
|
||||
@ -345,17 +376,18 @@ void GEOMAlgo_GlueDetector::DetectShapes(const TopAbs_ShapeEnum aType)
|
||||
continue;
|
||||
}
|
||||
//
|
||||
const TopoDS_Shape& aS1=aLSDF.First();
|
||||
const TopoDS_Shape& aS1=aLSDF.First();
|
||||
//
|
||||
if (aType==TopAbs_EDGE) {
|
||||
const TopoDS_Edge& aE1=*((TopoDS_Edge*)&aS1);
|
||||
bDegenerated=BRep_Tool::Degenerated(aE1);
|
||||
if (bDegenerated) {
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
//
|
||||
myImages.Bind(aS1, aLSDF);
|
||||
//
|
||||
// origins
|
||||
aItLS.Initialize(aLSDF);
|
||||
for (; aItLS.More(); aItLS.Next()) {
|
||||
@ -368,10 +400,10 @@ void GEOMAlgo_GlueDetector::DetectShapes(const TopAbs_ShapeEnum aType)
|
||||
}
|
||||
//=======================================================================
|
||||
//function : FacePassKey
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_GlueDetector::FacePassKey(const TopoDS_Face& aF,
|
||||
GEOMAlgo_PassKeyShape& aPK)
|
||||
void GEOMAlgo_GlueDetector::FacePassKey(const TopoDS_Face& aF,
|
||||
GEOMAlgo_PassKeyShape& aPK)
|
||||
{
|
||||
Standard_Integer i, aNbE;
|
||||
TopoDS_Shape aER;
|
||||
@ -388,7 +420,7 @@ void GEOMAlgo_GlueDetector::FacePassKey(const TopoDS_Face& aF,
|
||||
if (BRep_Tool::Degenerated(aEE)) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
//
|
||||
if (myOrigins.IsBound(aE)) {
|
||||
aER=myOrigins.Find(aE);
|
||||
}
|
||||
@ -401,10 +433,10 @@ void GEOMAlgo_GlueDetector::FacePassKey(const TopoDS_Face& aF,
|
||||
}
|
||||
//=======================================================================
|
||||
//function : EdgePassKey
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_GlueDetector::EdgePassKey(const TopoDS_Edge& aE,
|
||||
GEOMAlgo_PassKeyShape& aPK)
|
||||
void GEOMAlgo_GlueDetector::EdgePassKey(const TopoDS_Edge& aE,
|
||||
GEOMAlgo_PassKeyShape& aPK)
|
||||
{
|
||||
TopAbs_Orientation aOr;
|
||||
TopoDS_Shape aVR;
|
||||
@ -417,10 +449,10 @@ void GEOMAlgo_GlueDetector::EdgePassKey(const TopoDS_Edge& aE,
|
||||
aOr=aV.Orientation();
|
||||
if (aOr==TopAbs_FORWARD || aOr==TopAbs_REVERSED) {
|
||||
if (myOrigins.IsBound(aV)) {
|
||||
aVR=myOrigins.Find(aV);
|
||||
aVR=myOrigins.Find(aV);
|
||||
}
|
||||
else {
|
||||
aVR=aV;
|
||||
aVR=aV;
|
||||
}
|
||||
aLV.Append(aVR);
|
||||
}
|
||||
@ -428,3 +460,152 @@ void GEOMAlgo_GlueDetector::EdgePassKey(const TopoDS_Edge& aE,
|
||||
//
|
||||
aPK.SetShapes(aLV);
|
||||
}
|
||||
//modified by NIZNHY-PKV Tue Mar 13 09:54:18 2012f
|
||||
//=======================================================================
|
||||
//function : CheckDetected
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_GlueDetector::CheckDetected()
|
||||
{
|
||||
TopoDS_Iterator aItA;
|
||||
TopExp_Explorer aExp;
|
||||
TopTools_ListOfShape aLV;
|
||||
TopTools_MapOfShape aMFence;
|
||||
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItIm;
|
||||
TopTools_IndexedDataMapOfShapeListOfShape aMVE, aMEV;
|
||||
//
|
||||
// 1. aMVE, aMEV
|
||||
TopExp::MapShapesAndAncestors(myArgument, TopAbs_VERTEX, TopAbs_EDGE, aMVE);
|
||||
//
|
||||
aExp.Init(myArgument, TopAbs_EDGE);
|
||||
for (; aExp.More(); aExp.Next()) {
|
||||
const TopoDS_Shape& aE=aExp.Current();
|
||||
//
|
||||
aLV.Clear();
|
||||
aMFence.Clear();
|
||||
aItA.Initialize(aE);
|
||||
for (; aItA.More(); aItA.Next()) {
|
||||
const TopoDS_Shape& aV=aItA.Value();
|
||||
if (aMFence.Add(aV)) {
|
||||
aLV.Append(aV);
|
||||
}
|
||||
}
|
||||
//
|
||||
aMEV.Add(aE, aLV);
|
||||
}
|
||||
// 2. Checking
|
||||
aItIm.Initialize(myImages);
|
||||
for (; aItIm.More(); aItIm.Next()) {
|
||||
//const TopoDS_Shape& aV=aItIm.Key();
|
||||
const TopTools_ListOfShape& aLVSD=aItIm.Value();
|
||||
CheckDetected(aLVSD, aMVE, aMEV);
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
//function : CheckDetected
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_GlueDetector::CheckDetected
|
||||
(const TopTools_ListOfShape& aLVSD,
|
||||
const TopTools_IndexedDataMapOfShapeListOfShape& aMVE,
|
||||
const TopTools_IndexedDataMapOfShapeListOfShape& aMEV)
|
||||
{
|
||||
Standard_Integer i, aNbVSD, aNbA, iRet;
|
||||
TopAbs_ShapeEnum aTypeS, aTypeA[2];
|
||||
TopExp_Explorer aExp, aExpA;
|
||||
TopTools_MapOfShape aMFence, aMVSD;
|
||||
TopTools_ListOfShape aLV;
|
||||
TopTools_ListIteratorOfListOfShape aItLS;
|
||||
//
|
||||
myErrorStatus=0;
|
||||
//
|
||||
aNbVSD=aLVSD.Extent();
|
||||
if (aNbVSD < 2) {
|
||||
return ;
|
||||
}
|
||||
//
|
||||
aItLS.Initialize(aLVSD);
|
||||
for (; aItLS.More(); aItLS.Next()) {
|
||||
const TopoDS_Shape& aVSD=aItLS.Value();
|
||||
aMVSD.Add(aVSD);
|
||||
}
|
||||
//
|
||||
aItLS.Initialize(aLVSD);
|
||||
for (; aItLS.More(); aItLS.Next()) {
|
||||
const TopoDS_Shape& aVSD=aItLS.Value();
|
||||
//
|
||||
iRet=CheckAncesstors(aVSD, aMVSD, aMVE, aMEV, myStickedShapes);
|
||||
if (iRet) {
|
||||
// Sticked shapes detected
|
||||
myWarningStatus=2;
|
||||
}
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
//function : CheckAncesstors
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer CheckAncesstors
|
||||
(const TopoDS_Shape& aVSD,
|
||||
const TopTools_MapOfShape& aMVSD,
|
||||
const TopTools_IndexedDataMapOfShapeListOfShape& aMVE,
|
||||
const TopTools_IndexedDataMapOfShapeListOfShape& aMEV,
|
||||
TopTools_IndexedDataMapOfShapeListOfShape& aMEVZ)
|
||||
{
|
||||
Standard_Address pLE, pLV, pLVZ;
|
||||
Standard_Integer iRet, aNbVX;
|
||||
TopTools_ListIteratorOfListOfShape aItLE, aItLV;
|
||||
TopTools_MapOfShape aMFence;
|
||||
TopTools_ListOfShape aLVX;
|
||||
//
|
||||
iRet=0;
|
||||
//
|
||||
pLE=aMVE.FindFromKey1(aVSD);
|
||||
if (!pLE) {
|
||||
return iRet;
|
||||
}
|
||||
//
|
||||
const TopTools_ListOfShape& aLE=*((TopTools_ListOfShape*)pLE);
|
||||
aItLE.Initialize(aLE);
|
||||
for (; aItLE.More(); aItLE.Next()) {
|
||||
const TopoDS_Shape& aE=aItLE.Value();
|
||||
//
|
||||
pLV=aMEV.FindFromKey1(aE);
|
||||
if (!pLV) {
|
||||
continue; // it should be not so
|
||||
}
|
||||
//
|
||||
aLVX.Clear();
|
||||
const TopTools_ListOfShape& aLV=*((TopTools_ListOfShape*)pLV);
|
||||
aItLV.Initialize(aLV);
|
||||
for (; aItLV.More(); aItLV.Next()) {
|
||||
const TopoDS_Shape& aV=aItLV.Value();
|
||||
if (!aV.IsSame(aVSD)) {
|
||||
if (aMVSD.Contains(aV)) {
|
||||
if (aMFence.Add(aV)) {
|
||||
aLVX.Append(aV);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
aNbVX=aLVX.Extent();
|
||||
if (!aNbVX) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
iRet=1;
|
||||
//
|
||||
pLVZ=aMEVZ.FindFromKey1(aE);
|
||||
if (!pLVZ) {
|
||||
aMEVZ.Add(aE, aLVX);
|
||||
}
|
||||
else {
|
||||
TopTools_ListOfShape& aLVZ=*((TopTools_ListOfShape*)pLVZ);
|
||||
aLVZ.Append(aLVX);
|
||||
}
|
||||
}
|
||||
//
|
||||
return iRet;
|
||||
}
|
||||
//modified by NIZNHY-PKV Tue Mar 13 09:54:59 2012t
|
||||
|
@ -18,50 +18,82 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
// File: GEOMAlgo_GlueDetector.hxx
|
||||
// Created:
|
||||
// Author: Peter KURNEV
|
||||
// <pkv@irinox>
|
||||
//
|
||||
|
||||
#ifndef _GEOMAlgo_GlueDetector_HeaderFile
|
||||
#define _GEOMAlgo_GlueDetector_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <GEOMAlgo_GluerAlgo.hxx>
|
||||
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
#include <GEOMAlgo_PassKeyShape.hxx>
|
||||
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
|
||||
#include <GEOMAlgo_GluerAlgo.hxx>
|
||||
#include <GEOMAlgo_Algo.hxx>
|
||||
#include <GEOMAlgo_PassKeyShape.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : GEOMAlgo_GlueDetector
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
class GEOMAlgo_GlueDetector : public GEOMAlgo_GluerAlgo,
|
||||
public GEOMAlgo_Algo {
|
||||
class GEOMAlgo_GlueDetector : public GEOMAlgo_GluerAlgo,
|
||||
public GEOMAlgo_Algo
|
||||
{
|
||||
public:
|
||||
Standard_EXPORT GEOMAlgo_GlueDetector();
|
||||
|
||||
Standard_EXPORT virtual ~GEOMAlgo_GlueDetector();
|
||||
|
||||
Standard_EXPORT virtual void Perform() ;
|
||||
Standard_EXPORT
|
||||
GEOMAlgo_GlueDetector();
|
||||
|
||||
Standard_EXPORT virtual
|
||||
~GEOMAlgo_GlueDetector();
|
||||
|
||||
Standard_EXPORT virtual
|
||||
void Perform() ;
|
||||
|
||||
//modified by NIZNHY-PKV Tue Mar 13 12:23:20 2012f
|
||||
Standard_EXPORT
|
||||
const TopTools_IndexedDataMapOfShapeListOfShape& StickedShapes();
|
||||
//modified by NIZNHY-PKV Tue Mar 13 12:23:26 2012t
|
||||
//------------------------------------------------
|
||||
protected:
|
||||
Standard_EXPORT void DetectVertices() ;
|
||||
|
||||
Standard_EXPORT void DetectEdges() ;
|
||||
|
||||
Standard_EXPORT void DetectFaces() ;
|
||||
|
||||
Standard_EXPORT void DetectShapes(const TopAbs_ShapeEnum aType) ;
|
||||
|
||||
Standard_EXPORT void EdgePassKey(const TopoDS_Edge& aE,
|
||||
GEOMAlgo_PassKeyShape& aPK) ;
|
||||
|
||||
Standard_EXPORT void FacePassKey(const TopoDS_Face& aF,
|
||||
GEOMAlgo_PassKeyShape& aPK) ;
|
||||
Standard_EXPORT
|
||||
void DetectVertices() ;
|
||||
|
||||
Standard_EXPORT
|
||||
void DetectEdges() ;
|
||||
|
||||
Standard_EXPORT
|
||||
void DetectFaces() ;
|
||||
|
||||
Standard_EXPORT
|
||||
void DetectShapes(const TopAbs_ShapeEnum aType) ;
|
||||
|
||||
Standard_EXPORT
|
||||
void EdgePassKey(const TopoDS_Edge& aE,
|
||||
GEOMAlgo_PassKeyShape& aPK) ;
|
||||
|
||||
Standard_EXPORT
|
||||
void FacePassKey(const TopoDS_Face& aF,
|
||||
GEOMAlgo_PassKeyShape& aPK) ;
|
||||
|
||||
//modified by NIZNHY-PKV Tue Mar 13 09:53:03 2012f
|
||||
Standard_EXPORT
|
||||
void CheckDetected();
|
||||
//
|
||||
Standard_EXPORT
|
||||
void CheckDetected
|
||||
(const TopTools_ListOfShape& aLVSD,
|
||||
const TopTools_IndexedDataMapOfShapeListOfShape& aMVE,
|
||||
const TopTools_IndexedDataMapOfShapeListOfShape& aMEV);
|
||||
|
||||
|
||||
protected:
|
||||
TopTools_IndexedDataMapOfShapeListOfShape myStickedShapes;
|
||||
//modified by NIZNHY-PKV Tue Mar 13 09:53:08 2012t
|
||||
|
||||
private:
|
||||
};
|
||||
#endif
|
||||
|
@ -18,7 +18,7 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
// File: GEOMAlgo_Gluer2.cxx
|
||||
// Author: Peter KURNEV
|
||||
|
||||
@ -48,7 +48,7 @@
|
||||
|
||||
//=======================================================================
|
||||
//function : GEOMAlgo_Gluer2
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
GEOMAlgo_Gluer2::GEOMAlgo_Gluer2()
|
||||
:
|
||||
@ -59,14 +59,14 @@ GEOMAlgo_Gluer2::GEOMAlgo_Gluer2()
|
||||
}
|
||||
//=======================================================================
|
||||
//function : ~GEOMAlgo_Gluer2
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
GEOMAlgo_Gluer2::~GEOMAlgo_Gluer2()
|
||||
{
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Clear
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Gluer2::Clear()
|
||||
{
|
||||
@ -81,10 +81,24 @@ void GEOMAlgo_Gluer2::Clear()
|
||||
myImagesToWork.Clear();
|
||||
myOriginsToWork.Clear();
|
||||
myKeepNonSolids=Standard_False;
|
||||
//modified by NIZNHY-PKV Tue Mar 13 13:38:28 2012f
|
||||
myDetector.Clear();
|
||||
//modified by NIZNHY-PKV Tue Mar 13 13:38:30 2012t
|
||||
}
|
||||
//modified by NIZNHY-PKV Tue Mar 13 12:26:50 2012f
|
||||
//=======================================================================
|
||||
//function : StickedShapes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const TopTools_IndexedDataMapOfShapeListOfShape&
|
||||
GEOMAlgo_Gluer2::StickedShapes()
|
||||
{
|
||||
return myDetector.StickedShapes();
|
||||
}
|
||||
//modified by NIZNHY-PKV Tue Mar 13 12:26:54 2012t
|
||||
//=======================================================================
|
||||
//function : SetShapesToGlue
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Gluer2::SetShapesToGlue(const TopTools_DataMapOfShapeListOfShape& aM)
|
||||
{
|
||||
@ -92,7 +106,7 @@ void GEOMAlgo_Gluer2::SetShapesToGlue(const TopTools_DataMapOfShapeListOfShape&
|
||||
}
|
||||
//=======================================================================
|
||||
//function : ShapesToGlue
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const TopTools_DataMapOfShapeListOfShape& GEOMAlgo_Gluer2::ShapesToGlue()const
|
||||
{
|
||||
@ -100,7 +114,7 @@ const TopTools_DataMapOfShapeListOfShape& GEOMAlgo_Gluer2::ShapesToGlue()const
|
||||
}
|
||||
//=======================================================================
|
||||
//function : SetKeepNonSolids
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Gluer2::SetKeepNonSolids(const Standard_Boolean aFlag)
|
||||
{
|
||||
@ -108,15 +122,15 @@ void GEOMAlgo_Gluer2::SetKeepNonSolids(const Standard_Boolean aFlag)
|
||||
}
|
||||
//=======================================================================
|
||||
//function : KeepNonSolids
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean GEOMAlgo_Gluer2::KeepNonSolids()const
|
||||
Standard_Boolean GEOMAlgo_Gluer2::KeepNonSolids()const
|
||||
{
|
||||
return myKeepNonSolids;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : ShapesDetected
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const TopTools_DataMapOfShapeListOfShape& GEOMAlgo_Gluer2::ShapesDetected()const
|
||||
{
|
||||
@ -124,7 +138,7 @@ const TopTools_DataMapOfShapeListOfShape& GEOMAlgo_Gluer2::ShapesDetected()const
|
||||
}
|
||||
//=======================================================================
|
||||
//function : ImagesToWork
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const TopTools_DataMapOfShapeListOfShape& GEOMAlgo_Gluer2::ImagesToWork()const
|
||||
{
|
||||
@ -132,13 +146,13 @@ const TopTools_DataMapOfShapeListOfShape& GEOMAlgo_Gluer2::ImagesToWork()const
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Perform
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Gluer2::Perform()
|
||||
{
|
||||
myErrorStatus=0;
|
||||
myWarningStatus=0;
|
||||
//
|
||||
//
|
||||
CheckData();
|
||||
if (myErrorStatus) {
|
||||
return;
|
||||
@ -151,7 +165,8 @@ void GEOMAlgo_Gluer2::Perform()
|
||||
if (myErrorStatus) {
|
||||
return;
|
||||
}
|
||||
if (myWarningStatus==1) {// no shapes to glue
|
||||
if (myWarningStatus==1) {
|
||||
// no shapes to glue
|
||||
myShape=myArgument;
|
||||
return;
|
||||
}
|
||||
@ -210,7 +225,7 @@ void GEOMAlgo_Gluer2::Perform()
|
||||
}
|
||||
//=======================================================================
|
||||
//function : CheckData
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Gluer2::CheckData()
|
||||
{
|
||||
@ -235,8 +250,8 @@ void GEOMAlgo_Gluer2::CheckData()
|
||||
aTypeX=aSG.ShapeType();
|
||||
if (!i) {
|
||||
aType=aTypeX;
|
||||
if (!(aType==TopAbs_VERTEX ||
|
||||
aType==TopAbs_EDGE ||
|
||||
if (!(aType==TopAbs_VERTEX ||
|
||||
aType==TopAbs_EDGE ||
|
||||
aType==TopAbs_FACE)) {
|
||||
myErrorStatus=21;// non-brep shapes
|
||||
return;
|
||||
@ -253,15 +268,15 @@ void GEOMAlgo_Gluer2::CheckData()
|
||||
}
|
||||
//=======================================================================
|
||||
//function : FillEdges
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Gluer2::FillEdges()
|
||||
{
|
||||
FillBRepShapes(TopAbs_EDGE);
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
//function : FillFaces
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Gluer2::FillFaces()
|
||||
{
|
||||
@ -269,7 +284,7 @@ void GEOMAlgo_Gluer2::FillFaces()
|
||||
}
|
||||
//=======================================================================
|
||||
//function : FillWires
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Gluer2::FillWires()
|
||||
{
|
||||
@ -277,7 +292,7 @@ void GEOMAlgo_Gluer2::FillWires()
|
||||
}
|
||||
//=======================================================================
|
||||
//function : FillShells
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Gluer2::FillShells()
|
||||
{
|
||||
@ -285,23 +300,23 @@ void GEOMAlgo_Gluer2::FillShells()
|
||||
}
|
||||
//=======================================================================
|
||||
//function : FillSolids
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Gluer2::FillSolids()
|
||||
{
|
||||
FillContainers(TopAbs_SOLID);
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
//function : FillCompSolids
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Gluer2::FillCompSolids()
|
||||
{
|
||||
FillContainers(TopAbs_COMPSOLID);
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
//function : FillVertices
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Gluer2::FillVertices()
|
||||
{
|
||||
@ -336,10 +351,10 @@ void GEOMAlgo_Gluer2::FillVertices()
|
||||
}
|
||||
//=======================================================================
|
||||
//function : FillBRepShapes
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Gluer2::FillBRepShapes(const TopAbs_ShapeEnum theType)
|
||||
{
|
||||
{
|
||||
Standard_Boolean bHasImage, bIsToWork;
|
||||
Standard_Integer i, aNbE;
|
||||
TopoDS_Iterator aItS;
|
||||
@ -395,7 +410,7 @@ void GEOMAlgo_Gluer2::FillBRepShapes(const TopAbs_ShapeEnum theType)
|
||||
}
|
||||
//=======================================================================
|
||||
//function : FillContainers
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Gluer2::FillContainers(const TopAbs_ShapeEnum aType)
|
||||
{
|
||||
@ -426,9 +441,7 @@ void GEOMAlgo_Gluer2::FillContainers(const TopAbs_ShapeEnum aType)
|
||||
}
|
||||
//
|
||||
GEOMAlgo_Tools3D::MakeContainer(aType, aWnew);
|
||||
//modified by NIZNHY-PKV Tue May 10 13:46:30 2011f
|
||||
aWnew.Orientation(aW.Orientation());
|
||||
//modified by NIZNHY-PKV Tue May 10 13:46:32 2011t
|
||||
//
|
||||
aItS.Initialize(aW);
|
||||
for (; aItS.More(); aItS.Next()) {
|
||||
@ -448,10 +461,6 @@ void GEOMAlgo_Gluer2::FillContainers(const TopAbs_ShapeEnum aType)
|
||||
}
|
||||
}
|
||||
//
|
||||
//modified by NIZNHY-PKV Tue May 10 13:46:19 2011f
|
||||
//aWnew.Orientation(aW.Orientation());
|
||||
//modified by NIZNHY-PKV Tue May 10 13:46:22 2011t
|
||||
//
|
||||
//myImages / myOrigins
|
||||
TopTools_ListOfShape aLSD;
|
||||
//
|
||||
@ -463,7 +472,7 @@ void GEOMAlgo_Gluer2::FillContainers(const TopAbs_ShapeEnum aType)
|
||||
}
|
||||
//=======================================================================
|
||||
//function : FillCompounds
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Gluer2::FillCompounds()
|
||||
{
|
||||
@ -484,7 +493,7 @@ void GEOMAlgo_Gluer2::FillCompounds()
|
||||
}
|
||||
//=======================================================================
|
||||
//function : FillCompound
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Gluer2::FillCompound(const TopoDS_Shape& aC)
|
||||
{
|
||||
@ -529,7 +538,7 @@ void GEOMAlgo_Gluer2::FillCompound(const TopoDS_Shape& aC)
|
||||
}
|
||||
//=======================================================================
|
||||
//function : HasImage
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean GEOMAlgo_Gluer2::HasImage(const TopoDS_Shape& aC)
|
||||
{
|
||||
@ -563,7 +572,7 @@ Standard_Boolean GEOMAlgo_Gluer2::HasImage(const TopoDS_Shape& aC)
|
||||
}
|
||||
//=======================================================================
|
||||
//function : BuildResult
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Gluer2::BuildResult()
|
||||
{
|
||||
@ -612,7 +621,7 @@ void GEOMAlgo_Gluer2::BuildResult()
|
||||
GEOMAlgo_Tools3D::MakeContainer(TopAbs_COMPOUND, aCnew1);
|
||||
//
|
||||
TopExp::MapShapes(aCnew, TopAbs_SOLID, aM);
|
||||
|
||||
|
||||
aNb=aM.Extent();
|
||||
for (i=1; i<=aNb; ++i) {
|
||||
const TopoDS_Shape& aS=aM(i);
|
||||
@ -631,4 +640,10 @@ void GEOMAlgo_Gluer2::BuildResult()
|
||||
// 14 - PerformImagesToWork failed
|
||||
//
|
||||
// WarningStatus
|
||||
// 1 - no shapes to glue
|
||||
// 1 - no shapes to glue
|
||||
// 2 - sticked shapes are detected.
|
||||
// The value of myTolerance is so large that
|
||||
// subshapes of a shape becomes intefere
|
||||
// (e.g. vertices of an edge).
|
||||
// In the case
|
||||
// the result is can not be obtained
|
||||
|
@ -18,118 +18,159 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
// File: GEOMAlgo_Gluer2.hxx
|
||||
// Created:
|
||||
// Author: Peter KURNEV
|
||||
// <pkv@irinox>
|
||||
|
||||
#ifndef _GEOMAlgo_Gluer2_HeaderFile
|
||||
#define _GEOMAlgo_Gluer2_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
|
||||
#include <TopTools_DataMapOfShapeListOfShape.hxx>
|
||||
#include <TopTools_DataMapOfShapeShape.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <GEOMAlgo_GluerAlgo.hxx>
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
|
||||
#include <NMTTools_CoupleOfShape.hxx>
|
||||
#include <NMTTools_ListOfCoupleOfShape.hxx>
|
||||
|
||||
#include <GEOMAlgo_GluerAlgo.hxx>
|
||||
#include <GEOMAlgo_BuilderShape.hxx>
|
||||
#include <GEOMAlgo_GlueDetector.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//class : GEOMAlgo_Gluer2
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
class GEOMAlgo_Gluer2 : public GEOMAlgo_GluerAlgo,
|
||||
class GEOMAlgo_Gluer2 : public GEOMAlgo_GluerAlgo,
|
||||
public GEOMAlgo_BuilderShape {
|
||||
public:
|
||||
|
||||
Standard_EXPORT GEOMAlgo_Gluer2();
|
||||
|
||||
Standard_EXPORT virtual ~GEOMAlgo_Gluer2();
|
||||
|
||||
Standard_EXPORT void SetShapesToGlue(const TopTools_DataMapOfShapeListOfShape& aM) ;
|
||||
|
||||
Standard_EXPORT const TopTools_DataMapOfShapeListOfShape& ShapesToGlue() const;
|
||||
|
||||
Standard_EXPORT void SetKeepNonSolids(const Standard_Boolean theFlag) ;
|
||||
|
||||
Standard_EXPORT Standard_Boolean KeepNonSolids() const;
|
||||
|
||||
|
||||
Standard_EXPORT
|
||||
GEOMAlgo_Gluer2();
|
||||
|
||||
Standard_EXPORT
|
||||
virtual ~GEOMAlgo_Gluer2();
|
||||
|
||||
Standard_EXPORT
|
||||
void SetShapesToGlue(const TopTools_DataMapOfShapeListOfShape& aM) ;
|
||||
|
||||
Standard_EXPORT
|
||||
const TopTools_DataMapOfShapeListOfShape& ShapesToGlue() const;
|
||||
|
||||
Standard_EXPORT
|
||||
void SetKeepNonSolids(const Standard_Boolean theFlag) ;
|
||||
|
||||
Standard_EXPORT
|
||||
Standard_Boolean KeepNonSolids() const;
|
||||
|
||||
Standard_EXPORT virtual void Clear() ;
|
||||
|
||||
Standard_EXPORT virtual void Perform() ;
|
||||
|
||||
Standard_EXPORT virtual void CheckData() ;
|
||||
|
||||
Standard_EXPORT void Detect() ;
|
||||
|
||||
Standard_EXPORT const TopTools_DataMapOfShapeListOfShape& ShapesDetected() const;
|
||||
|
||||
Standard_EXPORT const TopTools_DataMapOfShapeListOfShape& ImagesToWork() const;
|
||||
|
||||
Standard_EXPORT virtual const TopTools_ListOfShape& Generated(const TopoDS_Shape& theS) ;
|
||||
|
||||
Standard_EXPORT virtual const TopTools_ListOfShape& Modified(const TopoDS_Shape& theS) ;
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean IsDeleted(const TopoDS_Shape& theS) ;
|
||||
|
||||
Standard_EXPORT static void MakeVertex(const TopTools_ListOfShape& theLV,
|
||||
TopoDS_Vertex& theV) ;
|
||||
|
||||
Standard_EXPORT static void MapBRepShapes(const TopoDS_Shape& theS,
|
||||
TopTools_MapOfShape& theM) ;
|
||||
|
||||
Standard_EXPORT static void MapShapes(const TopoDS_Shape& theS,
|
||||
TopTools_MapOfShape& theM) ;
|
||||
|
||||
Standard_EXPORT
|
||||
virtual void Perform() ;
|
||||
|
||||
Standard_EXPORT
|
||||
virtual void CheckData() ;
|
||||
|
||||
Standard_EXPORT
|
||||
void Detect() ;
|
||||
|
||||
Standard_EXPORT
|
||||
const TopTools_DataMapOfShapeListOfShape& ShapesDetected() const;
|
||||
|
||||
Standard_EXPORT
|
||||
const TopTools_DataMapOfShapeListOfShape& ImagesToWork() const;
|
||||
|
||||
Standard_EXPORT
|
||||
virtual const TopTools_ListOfShape& Generated(const TopoDS_Shape& theS) ;
|
||||
|
||||
Standard_EXPORT
|
||||
virtual const TopTools_ListOfShape& Modified(const TopoDS_Shape& theS) ;
|
||||
|
||||
Standard_EXPORT
|
||||
virtual Standard_Boolean IsDeleted(const TopoDS_Shape& theS) ;
|
||||
|
||||
Standard_EXPORT
|
||||
static void MakeVertex(const TopTools_ListOfShape& theLV,
|
||||
TopoDS_Vertex& theV) ;
|
||||
|
||||
Standard_EXPORT
|
||||
static void MapBRepShapes(const TopoDS_Shape& theS,
|
||||
TopTools_MapOfShape& theM) ;
|
||||
|
||||
Standard_EXPORT
|
||||
static void MapShapes(const TopoDS_Shape& theS,
|
||||
TopTools_MapOfShape& theM) ;
|
||||
|
||||
//modified by NIZNHY-PKV Tue Mar 13 12:23:20 2012f
|
||||
Standard_EXPORT
|
||||
const TopTools_IndexedDataMapOfShapeListOfShape& StickedShapes();
|
||||
//modified by NIZNHY-PKV Tue Mar 13 12:23:26 2012t
|
||||
//------------------------------------------------
|
||||
protected:
|
||||
|
||||
Standard_EXPORT void PerformShapesToWork() ;
|
||||
|
||||
Standard_EXPORT void FillVertices() ;
|
||||
|
||||
Standard_EXPORT void FillEdges() ;
|
||||
|
||||
Standard_EXPORT void FillWires() ;
|
||||
|
||||
Standard_EXPORT void FillFaces() ;
|
||||
|
||||
Standard_EXPORT void FillShells() ;
|
||||
|
||||
Standard_EXPORT void FillSolids() ;
|
||||
|
||||
Standard_EXPORT void FillCompSolids() ;
|
||||
|
||||
Standard_EXPORT void FillCompounds() ;
|
||||
|
||||
Standard_EXPORT void BuildResult() ;
|
||||
|
||||
Standard_EXPORT void FillBRepShapes(const TopAbs_ShapeEnum theType) ;
|
||||
|
||||
Standard_EXPORT void FillContainers(const TopAbs_ShapeEnum theType) ;
|
||||
|
||||
Standard_EXPORT void FillCompound(const TopoDS_Shape& theC) ;
|
||||
|
||||
Standard_EXPORT virtual void PrepareHistory() ;
|
||||
|
||||
Standard_EXPORT Standard_Boolean HasImage(const TopoDS_Shape& theC) ;
|
||||
|
||||
Standard_EXPORT void MakeBRepShapes(const TopoDS_Shape& theS,
|
||||
TopoDS_Shape& theSnew) ;
|
||||
|
||||
Standard_EXPORT void MakeEdge(const TopoDS_Edge& theE,
|
||||
TopoDS_Edge& theEnew) ;
|
||||
|
||||
Standard_EXPORT void MakeFace(const TopoDS_Face& theF,
|
||||
TopoDS_Face& theFnew) ;
|
||||
|
||||
Standard_EXPORT void TreatPair(const NMTTools_CoupleOfShape& theCS,
|
||||
NMTTools_ListOfCoupleOfShape& theLCS) ;
|
||||
Standard_EXPORT
|
||||
void PerformShapesToWork() ;
|
||||
|
||||
Standard_EXPORT
|
||||
void FillVertices() ;
|
||||
|
||||
Standard_EXPORT
|
||||
void FillEdges() ;
|
||||
|
||||
Standard_EXPORT
|
||||
void FillWires() ;
|
||||
|
||||
Standard_EXPORT
|
||||
void FillFaces() ;
|
||||
|
||||
Standard_EXPORT
|
||||
void FillShells() ;
|
||||
|
||||
Standard_EXPORT
|
||||
void FillSolids() ;
|
||||
|
||||
Standard_EXPORT
|
||||
void FillCompSolids() ;
|
||||
|
||||
Standard_EXPORT
|
||||
void FillCompounds() ;
|
||||
|
||||
Standard_EXPORT
|
||||
void BuildResult() ;
|
||||
|
||||
Standard_EXPORT
|
||||
void FillBRepShapes(const TopAbs_ShapeEnum theType) ;
|
||||
|
||||
Standard_EXPORT
|
||||
void FillContainers(const TopAbs_ShapeEnum theType) ;
|
||||
|
||||
Standard_EXPORT
|
||||
void FillCompound(const TopoDS_Shape& theC) ;
|
||||
|
||||
Standard_EXPORT
|
||||
virtual void PrepareHistory() ;
|
||||
|
||||
Standard_EXPORT
|
||||
Standard_Boolean HasImage(const TopoDS_Shape& theC) ;
|
||||
|
||||
Standard_EXPORT
|
||||
void MakeBRepShapes(const TopoDS_Shape& theS,
|
||||
TopoDS_Shape& theSnew) ;
|
||||
|
||||
Standard_EXPORT
|
||||
void MakeEdge(const TopoDS_Edge& theE,
|
||||
TopoDS_Edge& theEnew) ;
|
||||
|
||||
Standard_EXPORT
|
||||
void MakeFace(const TopoDS_Face& theF,
|
||||
TopoDS_Face& theFnew) ;
|
||||
|
||||
Standard_EXPORT
|
||||
void TreatPair(const NMTTools_CoupleOfShape& theCS,
|
||||
NMTTools_ListOfCoupleOfShape& theLCS) ;
|
||||
|
||||
protected:
|
||||
TopTools_DataMapOfShapeListOfShape myShapesToGlue;
|
||||
@ -138,7 +179,9 @@ protected:
|
||||
TopTools_DataMapOfShapeListOfShape myImagesToWork;
|
||||
TopTools_DataMapOfShapeShape myOriginsToWork;
|
||||
Standard_Boolean myKeepNonSolids;
|
||||
|
||||
//modified by NIZNHY-PKV Tue Mar 13 13:30:40 2012f
|
||||
GEOMAlgo_GlueDetector myDetector;
|
||||
//modified by NIZNHY-PKV Tue Mar 13 13:30:43 2012t
|
||||
private:
|
||||
};
|
||||
#endif
|
||||
|
@ -18,10 +18,9 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
// File: GEOMAlgo_Gluer2_3.cxx
|
||||
// Created:
|
||||
// Author: Peter KURNEV
|
||||
|
||||
// File: GEOMAlgo_Gluer2_3.cxx
|
||||
// Author: Peter KURNEV
|
||||
|
||||
#include <GEOMAlgo_Gluer2.hxx>
|
||||
|
||||
@ -55,12 +54,12 @@
|
||||
|
||||
static
|
||||
void MapShapes1(const TopoDS_Shape& aS,
|
||||
const TopAbs_ShapeEnum aType,
|
||||
TopTools_IndexedMapOfShape& aM);
|
||||
const TopAbs_ShapeEnum aType,
|
||||
TopTools_IndexedMapOfShape& aM);
|
||||
|
||||
//=======================================================================
|
||||
//function : Detect
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Gluer2::Detect()
|
||||
{
|
||||
@ -68,7 +67,7 @@ void GEOMAlgo_Gluer2::Detect()
|
||||
Standard_Integer iErr, aNbSD;
|
||||
TopTools_ListIteratorOfListOfShape aItLS;
|
||||
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItDMSLS;
|
||||
GEOMAlgo_GlueDetector aDetector;
|
||||
//GEOMAlgo_GlueDetector aDetector;
|
||||
//
|
||||
myErrorStatus=0;
|
||||
myWarningStatus=0;
|
||||
@ -77,18 +76,31 @@ void GEOMAlgo_Gluer2::Detect()
|
||||
myOriginsDetected.Clear();
|
||||
//
|
||||
bCheckGeometry=Standard_True;
|
||||
aDetector.SetArgument(myArgument);
|
||||
aDetector.SetTolerance(myTolerance);
|
||||
aDetector.SetCheckGeometry(bCheckGeometry);
|
||||
//
|
||||
aDetector.Perform();
|
||||
iErr=aDetector.ErrorStatus();
|
||||
//modified by NIZNHY-PKV Tue Mar 13 13:33:35 2012f
|
||||
myDetector.Clear();
|
||||
myDetector.SetContext(myContext);
|
||||
//modified by NIZNHY-PKV Tue Mar 13 13:33:38 2012t
|
||||
myDetector.SetArgument(myArgument);
|
||||
myDetector.SetTolerance(myTolerance);
|
||||
myDetector.SetCheckGeometry(bCheckGeometry);
|
||||
//
|
||||
myDetector.Perform();
|
||||
iErr=myDetector.ErrorStatus();
|
||||
if (iErr) {
|
||||
myErrorStatus=11;// Detector failed
|
||||
// Detector is failed
|
||||
myErrorStatus=11;
|
||||
return;
|
||||
}
|
||||
//modified by NIZNHY-PKV Tue Mar 13 13:40:36 2012f
|
||||
iErr=myDetector.WarningStatus();
|
||||
if (iErr) {
|
||||
// Sticked shapes are detected
|
||||
myWarningStatus=2;
|
||||
}
|
||||
//modified by NIZNHY-PKV Tue Mar 13 13:40:39 2012t
|
||||
//
|
||||
const TopTools_DataMapOfShapeListOfShape& aImages=aDetector.Images();
|
||||
const TopTools_DataMapOfShapeListOfShape& aImages=myDetector.Images();
|
||||
aItDMSLS.Initialize(aImages);
|
||||
for (; aItDMSLS.More(); aItDMSLS.Next()) {
|
||||
const TopoDS_Shape& aSkey=aItDMSLS.Key();
|
||||
@ -110,16 +122,16 @@ void GEOMAlgo_Gluer2::Detect()
|
||||
}
|
||||
//=======================================================================
|
||||
//function : PerformShapesToWork
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Gluer2::PerformShapesToWork()
|
||||
{
|
||||
Standard_Integer aNbSG, i, j, aNbC, aNb, aNbSD;
|
||||
{
|
||||
Standard_Integer aNbSG, i, j, k, aNbC, aNb, aNbSD;
|
||||
TopTools_ListIteratorOfListOfShape aItLS1, aItLS2;
|
||||
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItDMSLS;
|
||||
NMTTools_CoupleOfShape aCS;
|
||||
NMTTools_ListOfCoupleOfShape aLCS;
|
||||
NMTTools_ListIteratorOfListOfCoupleOfShape aItCS;
|
||||
NMTTools_ListIteratorOfListOfCoupleOfShape aItCS;
|
||||
//
|
||||
myErrorStatus=0;
|
||||
myWarningStatus=0;
|
||||
@ -144,8 +156,8 @@ void GEOMAlgo_Gluer2::PerformShapesToWork()
|
||||
const TopTools_ListOfShape& aLSD=aItDMSLS.Value();
|
||||
aItLS1.Initialize(aLSD);
|
||||
for (; aItLS1.More(); aItLS1.Next()) {
|
||||
const TopoDS_Shape& aSx=aItLS1.Value();
|
||||
myOriginsToWork.Bind(aSx, aSkey);
|
||||
const TopoDS_Shape& aSx=aItLS1.Value();
|
||||
myOriginsToWork.Bind(aSx, aSkey);
|
||||
}
|
||||
}
|
||||
return;
|
||||
@ -153,20 +165,20 @@ void GEOMAlgo_Gluer2::PerformShapesToWork()
|
||||
//
|
||||
// 1. Make pairs
|
||||
aItDMSLS.Initialize(myShapesToGlue);
|
||||
for (; aItDMSLS.More(); aItDMSLS.Next()) {
|
||||
for (k=0; aItDMSLS.More(); aItDMSLS.Next(), ++k) {
|
||||
//const TopoDS_Shape& aSkey=aItDMSLS.Key();
|
||||
const TopTools_ListOfShape& aLSG=aItDMSLS.Value();
|
||||
aItLS1.Initialize(aLSG);
|
||||
for (i=0; aItLS1.More(); aItLS1.Next(), ++i) {
|
||||
aItLS2.Initialize(aLSG);
|
||||
for (j=0; aItLS2.More(); aItLS2.Next(), ++j) {
|
||||
if (j>i) {
|
||||
const TopoDS_Shape& aSG1=aItLS1.Value();
|
||||
const TopoDS_Shape& aSG2=aItLS2.Value();
|
||||
aCS.SetShape1(aSG1);
|
||||
aCS.SetShape2(aSG2);
|
||||
TreatPair(aCS, aLCS);
|
||||
}
|
||||
if (j>i) {
|
||||
const TopoDS_Shape& aSG1=aItLS1.Value();
|
||||
const TopoDS_Shape& aSG2=aItLS2.Value();
|
||||
aCS.SetShape1(aSG1);
|
||||
aCS.SetShape2(aSG2);
|
||||
TreatPair(aCS, aLCS);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -194,10 +206,10 @@ void GEOMAlgo_Gluer2::PerformShapesToWork()
|
||||
}
|
||||
//=======================================================================
|
||||
//function : TreatPair
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Gluer2::TreatPair(const NMTTools_CoupleOfShape& aCS,
|
||||
NMTTools_ListOfCoupleOfShape& aLCS)
|
||||
NMTTools_ListOfCoupleOfShape& aLCS)
|
||||
{
|
||||
if (myErrorStatus) {
|
||||
return;
|
||||
@ -325,47 +337,23 @@ void GEOMAlgo_Gluer2::TreatPair(const NMTTools_CoupleOfShape& aCS,
|
||||
}
|
||||
//=======================================================================
|
||||
//function : MapShapes1
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void MapShapes1(const TopoDS_Shape& aS,
|
||||
const TopAbs_ShapeEnum aType,
|
||||
TopTools_IndexedMapOfShape& aM)
|
||||
const TopAbs_ShapeEnum aType,
|
||||
TopTools_IndexedMapOfShape& aM)
|
||||
{
|
||||
TopExp_Explorer aExp;
|
||||
|
||||
|
||||
aExp.Init (aS, aType);
|
||||
for ( ;aExp.More(); aExp.Next()) {
|
||||
const TopoDS_Shape aSx=aExp.Current();
|
||||
if (aType==TopAbs_EDGE) {
|
||||
const TopoDS_Edge& aEx=*((TopoDS_Edge*)&aSx);
|
||||
if (BRep_Tool::Degenerated(aEx)) {
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
aM.Add(aSx);
|
||||
}
|
||||
}
|
||||
/*
|
||||
//=======================================================================
|
||||
//function : MapShapes1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void MapShapes1(const TopoDS_Shape& aS,
|
||||
const TopAbs_ShapeEnum aType,
|
||||
TopTools_IndexedMapOfShape& aM)
|
||||
{
|
||||
TopExp_Explorer aExp (aS, aType);
|
||||
while (aExp.More()) {
|
||||
const TopoDS_Shape aSx=aExp.Current();
|
||||
if (aType==TopAbs_EDGE) {
|
||||
const TopoDS_Edge& aEx=*((TopoDS_Edge*)&aSx);
|
||||
if (BRep_Tool::Degenerated(aEx)) {
|
||||
aExp.Next();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
aM.Add(aSx);
|
||||
aExp.Next();
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
@ -818,6 +818,10 @@ Please, select face, shell or solid and try again</translation>
|
||||
<source>GEOM_GLUE_EDGES_TITLE</source>
|
||||
<translation>Glue edges</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>GLUE_ERROR_STICKED_SHAPES</source>
|
||||
<translation>The tolerance value is too big. Sticked shapes are detected.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>GEOM_LIMIT_TOLERANCE_TITLE</source>
|
||||
<translation>Limit tolerance</translation>
|
||||
|
@ -18,7 +18,6 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
#include <Standard_Stream.hxx>
|
||||
|
||||
@ -29,13 +28,13 @@
|
||||
#include <GEOM_Object.hxx>
|
||||
#include <GEOM_Function.hxx>
|
||||
|
||||
//#include <GEOMAlgo_Gluer.hxx>
|
||||
//#include "GEOMAlgo_Gluer1.hxx"
|
||||
#include "GEOMAlgo_Gluer2.hxx"
|
||||
#include "GEOMAlgo_ListIteratorOfListOfCoupleOfShapes.hxx"
|
||||
#include "GEOMAlgo_CoupleOfShapes.hxx"
|
||||
#include "GEOMAlgo_ListOfCoupleOfShapes.hxx"
|
||||
|
||||
#include <Basics_OCCTVersion.hxx>
|
||||
|
||||
#include "utilities.h"
|
||||
|
||||
#include <TDataStd_IntegerArray.hxx>
|
||||
@ -428,6 +427,39 @@ TopoDS_Shape GEOMImpl_GlueDriver::GlueWithWarnings (const TopoDS_Shape& theShape
|
||||
|
||||
// 2. Detect interferred shapes
|
||||
aGA.Detect();
|
||||
|
||||
//modified by NIZNHY-PKV Tue Mar 13 14:07:12 2012f
|
||||
#if OCC_VERSION_LARGE > 0x06050200
|
||||
Standard_Integer iWrnDetect = aGA.WarningStatus();
|
||||
if (iWrnDetect == 2) {
|
||||
/*
|
||||
TopTools_ListIteratorOfListOfShape aItLS;
|
||||
|
||||
// Sticked shapes are detected
|
||||
const TopTools_IndexedDataMapOfShapeListOfShape& aIDMSS = pGluer2->StickedShapes();
|
||||
|
||||
Standard_Integer i, aNb = aIDMSS.Extent();
|
||||
for (i = 1; i <= aNb; ++i) {
|
||||
// ancestor aSa (edge, wire face,..)
|
||||
const TopoDS_Shape& aSa = aIDMSS.FindKey(i);
|
||||
|
||||
// successors aSs (vertex, edge, ...)
|
||||
// of the ancestor that are sticked
|
||||
// for given value of the tolerance
|
||||
const TopTools_ListOfShape& aLSS = aIDMSS.FindFromIndex(i);
|
||||
aItLS.Initialize(aLSS);
|
||||
for (; aItLS.More(); aItLS.Next()) {
|
||||
const TopoDS_Shape& aSs = aItLS.Value();
|
||||
}
|
||||
}
|
||||
*/
|
||||
Standard_Failure::Raise("GLUE_ERROR_STICKED_SHAPES");
|
||||
//Standard_Failure::Raise("Sticked shapes are detected. The tolerance value is too big.");
|
||||
//theWarning = "Sticked shapes are detected. The tolerance value is too big.";
|
||||
}
|
||||
#endif
|
||||
//modified by NIZNHY-PKV Tue Mar 13 14:07:14 2012t
|
||||
|
||||
Standard_Integer iErr = aGA.ErrorStatus();
|
||||
if (iErr) {
|
||||
switch (iErr) {
|
||||
|
Loading…
Reference in New Issue
Block a user