+#include <BooleanOperations_OnceExplorer.hxx>
+
+static
+ Standard_Boolean Contains(const TopoDS_Edge& aE,
+ const TopoDS_Vertex& aV);
+// Contribution of Samtech www.samcef.com END
+
+// In OCCT6.3.0sp9 is changed a signature of IntTools_Context::ComputeVE() method
+#ifdef OCC_VERSION_SERVICEPACK
+#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8 | OCC_VERSION_SERVICEPACK)
+#else
+#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8)
+#endif
+
+//=======================================================================
+// function: PerformVE
+// purpose:
+//=======================================================================
+void NMTTools_PaveFiller::PerformVE()
+{
+ myIsDone=Standard_False;
+ //
+ Standard_Boolean bJustAdd;
+ Standard_Integer n1, n2, anIndexIn, aFlag, aWhat;
+ Standard_Integer aWith, aNbVEs, aBlockLength, iSDV, nV1;
+ Standard_Real aT;
+#if OCC_VERSION_LARGE > 0x06030008
+ Standard_Boolean bToUpdateVertex;
+ Standard_Real aDist;
+#endif
+ TopoDS_Vertex aV1;
+ TopoDS_Edge aE2;
+ BOPTools_IndexedMapOfCoupleOfInteger aSnareMap;
+ BOPTools_CoupleOfInteger aCouple;
+ //
+ BOPTools_CArray1OfVEInterference& aVEs=myIP->VEInterferences();
+ //
+ myDSIt->Initialize (TopAbs_VERTEX, TopAbs_EDGE);
+ //
+ // BlockLength correction
+ aNbVEs=myDSIt->BlockLength();
+ aBlockLength=aVEs.BlockLength();
+ if (aNbVEs > aBlockLength) {
+ aVEs.SetBlockLength(aNbVEs);
+ }
+ //
+ for (; myDSIt->More(); myDSIt->Next()) {
+ myDSIt->Current(n1, n2, bJustAdd);
+ if (!IsSuccessorsComputed(n1, n2)) {
+ anIndexIn=0;
+ aWhat=n1; // Vertex
+ aWith=n2; // Edge
+ if (myDS->GetShapeType(n1)==TopAbs_EDGE) {
+ aWhat=n2;
+ aWith=n1;
+ }
+ //
+ if(bJustAdd) {
+ continue;
+ }
+ // Edge
+ aE2=TopoDS::Edge(myDS->Shape(aWith));
+ if (BRep_Tool::Degenerated(aE2)){
+ continue;
+ }
+ // Vertex
+ nV1=aWhat;
+ aV1=TopoDS::Vertex(myDS->Shape(aWhat));
+ //
+ iSDV=FindSDVertex(aWhat);
+ if (iSDV) {
+ nV1=iSDV;
+ aV1=TopoDS::Vertex(myDS->Shape(nV1));
+ // Modified to find same domain vertex Thu Sep 14 14:35:18 2006
+ // Contribution of Samtech www.samcef.com BEGIN
+ Standard_Integer nVE, iSDVE, iRet;
+ //
+ BooleanOperations_OnceExplorer aExp(*myDS);
+ iRet=0;
+ aExp.Init(aWith, TopAbs_VERTEX);
+ for (; aExp.More(); aExp.Next()) {
+ nVE=aExp.Current();
+ iSDVE=FindSDVertex(nVE);
+ if (iSDVE==iSDV) {
+ iRet=1;
+ break;
+ }
+ }
+ if (iRet) {
+ continue;
+ }
+ }
+ else {
+ if (Contains(aE2, aV1)) {
+ continue;
+ }
+ // Contribution of Samtech www.samcef.com END
+ }
+ //
+ //modified by NIZNHY-PKV Mon Dec 28 08:58:05 2009f
+#if OCC_VERSION_LARGE > 0x06030008
+ aFlag=myContext.ComputeVE (aV1, aE2, aT, bToUpdateVertex, aDist);
+#else
+ aFlag=myContext.ComputeVE (aV1, aE2, aT);
+#endif
+ //modified by NIZNHY-PKV Mon Dec 28 08:58:13 2009t
+ //
+ if (!aFlag) {
+ // Add Interference to the Pool
+ BOPTools_VEInterference anInterf (aWhat, aWith, aT);
+ anIndexIn=aVEs.Append(anInterf);
+ //
+ // Add Pave to the Edge's myPavePool
+ aCouple.SetCouple(nV1, aWith);
+ if (!aSnareMap.Contains(aCouple)){
+ aSnareMap.Add(aCouple);
+ //
+ BOPTools_Pave aPave(nV1, aT, BooleanOperations_VertexEdge);
+ aPave.SetInterference(anIndexIn);
+ BOPTools_PaveSet& aPaveSet= myPavePool(myDS->RefEdge(aWith));
+ aPaveSet.Append(aPave);
+ }
+ //
+ // State for the Vertex in DS;
+ myDS->SetState (aWhat, BooleanOperations_ON);
+ // Insert Vertex in Interference Object
+ BOPTools_VEInterference& aVE=aVEs(anIndexIn);
+ aVE.SetNewShape(aWhat);
+ //
+ myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_VE);
+ //
+ //modified by NIZNHY-PKV Mon Dec 28 09:00:54 2009f
+#if OCC_VERSION_LARGE > 0x06030008
+ if (bToUpdateVertex) {
+ BRep_Builder aBB;
+ //
+ aBB.UpdateVertex(aV1, aDist);
+ }
+#endif
+ //modified by NIZNHY-PKV Mon Dec 28 09:00:57 2009t
+ //
+ } //if (!aFlag) {
+ }
+ }
+ myIsDone=Standard_True;
+}