2013-04-01 18:25:01 +06:00
|
|
|
// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
|
2005-12-05 21:23:52 +05:00
|
|
|
//
|
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
|
2005-12-05 21:23:52 +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
|
2005-12-05 21:23:52 +05:00
|
|
|
//
|
2012-08-09 13:58:02 +06:00
|
|
|
|
|
|
|
// File: NMTTools_PaveFiller_3.cxx
|
|
|
|
// Created: Mon Dec 8 16:06:56 2003
|
|
|
|
// Author: Peter KURNEV
|
|
|
|
// <pkv@irinox>
|
2009-02-13 17:16:39 +05:00
|
|
|
//
|
2012-08-09 13:58:02 +06:00
|
|
|
#include <NMTTools_PaveFiller.hxx>
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
#include <TopoDS.hxx>
|
|
|
|
#include <TopoDS_Shape.hxx>
|
|
|
|
#include <TopoDS_Vertex.hxx>
|
|
|
|
#include <TopoDS_Face.hxx>
|
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
#include <TopExp_Explorer.hxx>
|
|
|
|
|
2004-12-01 15:39:14 +05:00
|
|
|
#include <BOPTools_VSInterference.hxx>
|
|
|
|
#include <BOPTools_CArray1OfVSInterference.hxx>
|
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
#include <NMTDS_Iterator.hxx>
|
2004-12-01 15:39:14 +05:00
|
|
|
#include <NMTDS_ShapesDataStructure.hxx>
|
2008-03-07 12:45:34 +05:00
|
|
|
#include <NMTDS_InterfPool.hxx>
|
2012-08-09 13:58:02 +06:00
|
|
|
#include <IntTools_Context.hxx>
|
2008-03-07 12:45:34 +05:00
|
|
|
|
2004-12-01 15:39:14 +05:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
static
|
|
|
|
Standard_Boolean Contains(const TopoDS_Face& aF,
|
2012-08-09 13:58:02 +06:00
|
|
|
const TopoDS_Vertex& aV);
|
|
|
|
|
2004-12-01 15:39:14 +05:00
|
|
|
//=======================================================================
|
|
|
|
// function: PerformVF
|
2012-08-09 13:58:02 +06:00
|
|
|
// purpose:
|
2004-12-01 15:39:14 +05:00
|
|
|
//=======================================================================
|
2012-08-09 13:58:02 +06:00
|
|
|
void NMTTools_PaveFiller::PerformVF()
|
2004-12-01 15:39:14 +05:00
|
|
|
{
|
|
|
|
myIsDone=Standard_False;
|
|
|
|
//
|
2008-03-07 12:45:34 +05:00
|
|
|
Standard_Boolean aJustAdd;
|
2004-12-01 15:39:14 +05:00
|
|
|
Standard_Integer n1, n2, anIndexIn, aFlag, aWhat, aWith, aNbVSs, aBlockLength, iSDV;
|
|
|
|
Standard_Real aU, aV;
|
|
|
|
TopoDS_Vertex aV1;
|
|
|
|
TopoDS_Face aF2;
|
|
|
|
//
|
2008-03-07 12:45:34 +05:00
|
|
|
BOPTools_CArray1OfVSInterference& aVSs=myIP->VSInterferences();
|
2004-12-01 15:39:14 +05:00
|
|
|
//
|
2012-08-09 13:58:02 +06:00
|
|
|
// V/E Interferences
|
2008-03-07 12:45:34 +05:00
|
|
|
myDSIt->Initialize(TopAbs_VERTEX, TopAbs_FACE);
|
2004-12-01 15:39:14 +05:00
|
|
|
//
|
|
|
|
// BlockLength correction
|
2008-03-07 12:45:34 +05:00
|
|
|
aNbVSs=myDSIt->BlockLength();
|
2004-12-01 15:39:14 +05:00
|
|
|
aBlockLength=aVSs.BlockLength();
|
|
|
|
if (aNbVSs > aBlockLength) {
|
|
|
|
aVSs.SetBlockLength(aNbVSs);
|
|
|
|
}
|
|
|
|
//
|
2008-03-07 12:45:34 +05:00
|
|
|
for (; myDSIt->More(); myDSIt->Next()) {
|
|
|
|
myDSIt->Current(n1, n2, aJustAdd);
|
|
|
|
if (! IsSuccessorsComputed(n1, n2)) {
|
|
|
|
anIndexIn=0;
|
|
|
|
aWhat=n1; // Vertex
|
|
|
|
aWith=n2; // Face
|
|
|
|
if (myDS->GetShapeType(n1)==TopAbs_FACE) {
|
2012-08-09 13:58:02 +06:00
|
|
|
aWhat=n2;
|
|
|
|
aWith=n1;
|
2008-03-07 12:45:34 +05:00
|
|
|
}
|
|
|
|
//
|
|
|
|
iSDV=FindSDVertex(aWhat);
|
2012-08-09 13:58:02 +06:00
|
|
|
//
|
2008-03-07 12:45:34 +05:00
|
|
|
if(aJustAdd) {
|
2012-08-09 13:58:02 +06:00
|
|
|
//myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn);
|
|
|
|
continue;
|
2008-03-07 12:45:34 +05:00
|
|
|
}
|
|
|
|
//
|
|
|
|
aV1=TopoDS::Vertex(myDS->Shape(aWhat));
|
|
|
|
if (iSDV) {
|
2012-08-09 13:58:02 +06:00
|
|
|
aV1=TopoDS::Vertex(myDS->Shape(iSDV));
|
2008-03-07 12:45:34 +05:00
|
|
|
}
|
2012-08-09 13:58:02 +06:00
|
|
|
//
|
2008-03-07 12:45:34 +05:00
|
|
|
aF2=TopoDS::Face(myDS->Shape(aWith));
|
|
|
|
//
|
2012-08-09 13:58:02 +06:00
|
|
|
// Modified Thu Sep 14 14:35:18 2006
|
2008-03-07 12:45:34 +05:00
|
|
|
// Contribution of Samtech www.samcef.com BEGIN
|
|
|
|
if (Contains(aF2, aV1)) {
|
2012-08-09 13:58:02 +06:00
|
|
|
continue;
|
2008-03-07 12:45:34 +05:00
|
|
|
}
|
|
|
|
// Contribution of Samtech www.samcef.com END
|
|
|
|
//
|
2012-08-09 13:58:02 +06:00
|
|
|
aFlag=myContext->ComputeVS (aV1, aF2, aU, aV);
|
2008-03-07 12:45:34 +05:00
|
|
|
//
|
|
|
|
if (!aFlag) {
|
2012-08-09 13:58:02 +06:00
|
|
|
//
|
|
|
|
// Add Interference to the Pool
|
|
|
|
BOPTools_VSInterference anInterf (aWhat, aWith, aU, aV);
|
|
|
|
anIndexIn=aVSs.Append(anInterf);
|
|
|
|
//
|
|
|
|
// SetState for Vertex in DS;
|
|
|
|
myDS->SetState (aWhat, BooleanOperations_ON);
|
|
|
|
// Insert Vertex in Interference Object
|
|
|
|
BOPTools_VSInterference& aVS=aVSs(anIndexIn);
|
|
|
|
aVS.SetNewShape(aWhat);
|
|
|
|
// qqf
|
|
|
|
{
|
|
|
|
myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_VF);
|
|
|
|
}
|
|
|
|
// qqt
|
2004-12-01 15:39:14 +05:00
|
|
|
}
|
2008-03-07 12:45:34 +05:00
|
|
|
//myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn);
|
2004-12-01 15:39:14 +05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
myIsDone=Standard_True;
|
|
|
|
}
|
2012-08-09 13:58:02 +06:00
|
|
|
// Modified Thu Sep 14 14:35:18 2006
|
2008-03-07 12:45:34 +05:00
|
|
|
// Contribution of Samtech www.samcef.com BEGIN
|
|
|
|
//=======================================================================
|
|
|
|
//function : Contains
|
2012-08-09 13:58:02 +06:00
|
|
|
//purpose :
|
2008-03-07 12:45:34 +05:00
|
|
|
//=======================================================================
|
|
|
|
Standard_Boolean Contains(const TopoDS_Face& aF,
|
2012-08-09 13:58:02 +06:00
|
|
|
const TopoDS_Vertex& aV)
|
2008-03-07 12:45:34 +05:00
|
|
|
{
|
|
|
|
Standard_Boolean bRet;
|
|
|
|
TopExp_Explorer aExp;
|
|
|
|
//
|
|
|
|
bRet=Standard_False;
|
|
|
|
aExp.Init(aF, TopAbs_VERTEX);
|
|
|
|
for (; aExp.More(); aExp.Next()) {
|
|
|
|
const TopoDS_Shape& aVF=aExp.Current();
|
|
|
|
if (aVF.IsSame(aV)) {
|
|
|
|
bRet=!bRet;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return bRet;
|
|
|
|
}
|
|
|
|
// Contribution of Samtech www.samcef.com END
|