From 11568f579bc4cc7b8b4035cc6c2949a86057c23d Mon Sep 17 00:00:00 2001 From: jfa Date: Fri, 8 Dec 2006 15:36:07 +0000 Subject: [PATCH] PAL14122: EDF307: GetInPlace --> COMM_FAILURE. A patch by PKV. --- src/GEOMAlgo/GEOMAlgo_BuilderShape.cdl | 17 ++++++--- src/GEOMAlgo/GEOMAlgo_BuilderShape.cxx | 14 ++++++- src/GEOMAlgo/GEOMAlgo_BuilderShape.hxx | 42 +++++++++++++-------- src/GEOMAlgo/GEOMAlgo_Builder_3.cxx | 29 ++++++++++++++- src/GEOMAlgo/GEOMAlgo_Builder_4.cxx | 51 ++++++++++++++++++++------ 5 files changed, 118 insertions(+), 35 deletions(-) diff --git a/src/GEOMAlgo/GEOMAlgo_BuilderShape.cdl b/src/GEOMAlgo/GEOMAlgo_BuilderShape.cdl index 3233fec45..b699831c7 100755 --- a/src/GEOMAlgo/GEOMAlgo_BuilderShape.cdl +++ b/src/GEOMAlgo/GEOMAlgo_BuilderShape.cdl @@ -31,7 +31,8 @@ deferred class BuilderShape from GEOMAlgo uses Shape from TopoDS, ListOfShape from TopTools, - MapOfShape from TopTools + MapOfShape from TopTools, + IndexedDataMapOfShapeListOfShape from TopTools --raises @@ -91,9 +92,13 @@ is PrepareHistory (me:out) ---Purpose: Prepare information for history support - is virtual protected; - - + is virtual protected; + +--modified by NIZNHY-PKV Thu Dec 7 11:13:17 2006f + ImagesResult(me) + returns IndexedDataMapOfShapeListOfShape from TopTools; + ---C++: return const & +--modified by NIZNHY-PKV Thu Dec 7 11:13:20 2006t fields myShape : Shape from TopoDS is protected; -- @@ -102,6 +107,8 @@ fields myHasDeleted : Boolean from Standard is protected; myHasGenerated : Boolean from Standard is protected; myHasModified : Boolean from Standard is protected; - +--modified by NIZNHY-PKV Thu Dec 7 11:13:10 2006f + myImagesResult : IndexedDataMapOfShapeListOfShape from TopTools is protected; +--modified by NIZNHY-PKV Thu Dec 7 11:13:13 2006t end BuilderShape; diff --git a/src/GEOMAlgo/GEOMAlgo_BuilderShape.cxx b/src/GEOMAlgo/GEOMAlgo_BuilderShape.cxx index 7ced26803..9f7cdd501 100755 --- a/src/GEOMAlgo/GEOMAlgo_BuilderShape.cxx +++ b/src/GEOMAlgo/GEOMAlgo_BuilderShape.cxx @@ -115,5 +115,17 @@ myHasDeleted=Standard_False; myHasGenerated=Standard_False; myHasModified=Standard_False; + //modified by NIZNHY-PKV Thu Dec 7 11:14:15 2006 + myImagesResult.Clear(); + //modified by NIZNHY-PKV Thu Dec 7 11:14:17 2006t } - +//modified by NIZNHY-PKV Thu Dec 7 11:57:00 2006f +//======================================================================= +//function : ImagesResult +//purpose : +//======================================================================= + const TopTools_IndexedDataMapOfShapeListOfShape& GEOMAlgo_BuilderShape::ImagesResult()const +{ + return myImagesResult; +} +//modified by NIZNHY-PKV Thu Dec 7 11:57:04 2006t diff --git a/src/GEOMAlgo/GEOMAlgo_BuilderShape.hxx b/src/GEOMAlgo/GEOMAlgo_BuilderShape.hxx index 6d0573564..8639f22a8 100644 --- a/src/GEOMAlgo/GEOMAlgo_BuilderShape.hxx +++ b/src/GEOMAlgo/GEOMAlgo_BuilderShape.hxx @@ -1,21 +1,23 @@ -// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// File generated by CPPExt (Value) // -// 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. +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. // -// 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. -// -// 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 -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. #ifndef _GEOMAlgo_BuilderShape_HeaderFile #define _GEOMAlgo_BuilderShape_HeaderFile @@ -32,11 +34,15 @@ #ifndef _Standard_Boolean_HeaderFile #include #endif +#ifndef _TopTools_IndexedDataMapOfShapeListOfShape_HeaderFile +#include +#endif #ifndef _GEOMAlgo_Algo_HeaderFile #include #endif class TopoDS_Shape; class TopTools_ListOfShape; +class TopTools_IndexedDataMapOfShapeListOfShape; #ifndef _Standard_HeaderFile @@ -93,6 +99,9 @@ Standard_EXPORT Standard_Boolean HasGenerated() const; Standard_EXPORT Standard_Boolean HasModified() const; +Standard_EXPORT const TopTools_IndexedDataMapOfShapeListOfShape& ImagesResult() const; + + @@ -117,6 +126,7 @@ TopTools_MapOfShape myMapShape; Standard_Boolean myHasDeleted; Standard_Boolean myHasGenerated; Standard_Boolean myHasModified; +TopTools_IndexedDataMapOfShapeListOfShape myImagesResult; private: diff --git a/src/GEOMAlgo/GEOMAlgo_Builder_3.cxx b/src/GEOMAlgo/GEOMAlgo_Builder_3.cxx index 5da0c28e1..220cc453f 100755 --- a/src/GEOMAlgo/GEOMAlgo_Builder_3.cxx +++ b/src/GEOMAlgo/GEOMAlgo_Builder_3.cxx @@ -430,10 +430,33 @@ static GEOMAlgo_DataMapOfShapeShapeSet aMSS; GEOMAlgo_ShapeSet aSSi; // - aSB.SetContext(aCtx); + //modified by NIZNHY-PKV Wed Dec 6 17:08:03 2006f + // + // 0. Find same domain solids for non-interferred solids + aNbS=aDS.NumberOfShapesOfTheObject(); + for (i=1; i<=aNbS; ++i) { + const TopoDS_Shape& aS=aDS.Shape(i); + if (aS.ShapeType()!=TopAbs_SOLID) { + continue; + } + if (!aMFence.Add(aS)) { + continue; + } + if(myDraftSolids.Contains(aS)) { + continue; + } + // + aSSi.Clear(); + aSSi.Add(aS, TopAbs_FACE); + // + aMSS.Bind(aS, aSSi); + } //for (i=1; i<=aNbS; ++i) + // + //modified by NIZNHY-PKV Wed Dec 6 17:08:09 2006t // // 1. Build solids for interferred source solids // + aSB.SetContext(aCtx); aNbS=myDraftSolids.Extent(); for (i=1; i<=aNbS; ++i) { const TopoDS_Shape& aS =myDraftSolids.FindKey(i); @@ -525,6 +548,8 @@ static myImages.Bind(aS, aLSR); } } // for (i=1; i<=aNbS; ++i) { + //modified by NIZNHY-PKV Wed Dec 6 17:07:47 2006f + /* // // 2. Find same domain solids for non-interferred solids aNbS=aDS.NumberOfShapesOfTheObject(); @@ -553,6 +578,8 @@ static } } } //for (i=1; i<=aNbS; ++i) + */ + //modified by NIZNHY-PKV Wed Dec 6 17:07:55 2006t } //======================================================================= //function :FillInternalShapes diff --git a/src/GEOMAlgo/GEOMAlgo_Builder_4.cxx b/src/GEOMAlgo/GEOMAlgo_Builder_4.cxx index 3d887107d..080093803 100755 --- a/src/GEOMAlgo/GEOMAlgo_Builder_4.cxx +++ b/src/GEOMAlgo/GEOMAlgo_Builder_4.cxx @@ -39,7 +39,6 @@ #include - static void MapShapes(const TopoDS_Shape& aS, TopTools_MapOfShape& aM); @@ -208,35 +207,61 @@ static //======================================================================= void GEOMAlgo_Builder::PrepareHistory() { - myHistShapes.Clear(); - myMapShape.Clear(); - myHasDeleted=Standard_False; - myHasGenerated=Standard_False; - myHasModified=Standard_False; - // if(myShape.IsNull()) { return; } // - MapShapes(myShape, myMapShape); - // Standard_Boolean bHasImage, bContainsSD; TopAbs_ShapeEnum aType; TopTools_MapOfShape aMS; TopTools_ListIteratorOfListOfShape aIt; TopTools_MapIteratorOfMapOfShape aItM; // + // 1. Clearing + GEOMAlgo_BuilderShape::PrepareHistory(); + // + // 2. myMapShape - all shapes of result with theirs sub-shapes + MapShapes(myShape, myMapShape); + // + // 3. MS - all argument shapes with theirs sub-shapes aIt.Initialize(myShapes); for (; aIt.More(); aIt.Next()) { - const TopoDS_Shape& aS=aIt.Value(); - MapShapes(aS, aMS); + const TopoDS_Shape& aSx=aIt.Value(); + MapShapes(aSx, aMS); } // + // 4. Treatment aItM.Initialize(aMS); for (; aItM.More(); aItM.Next()) { const TopoDS_Shape& aSx=aItM.Key(); aType=aSx.ShapeType(); + //modified by NIZNHY-PKV Thu Dec 7 11:34:05 2006f + // + // 4.1 .myImagesResult + TopTools_ListOfShape aLSx; + // + bHasImage=myImages.HasImage(aSx); + if (!bHasImage) { + if (myMapShape.Contains(aSx)) { + aLSx.Append(aSx); + myImagesResult.Add(aSx, aLSx); + } + } + else { + const TopTools_ListOfShape& aLSp=myImages.Image(aSx); + aIt.Initialize(aLSp); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aSp=aIt.Value(); + if (myMapShape.Contains(aSp)) { + aLSx.Append(aSp); + } + } + myImagesResult.Add(aSx, aLSx); + } + // + //modified by NIZNHY-PKV Thu Dec 7 11:34:10 2006t // + // 4.2 As it was if (!myHasDeleted) { myHasDeleted=IsDeleted(aSx);//xx } @@ -244,7 +269,9 @@ static if (!myHasGenerated || !myHasModified) { if (aType==TopAbs_EDGE || aType==TopAbs_FACE || aType==TopAbs_VERTEX || aType==TopAbs_SOLID) { - bHasImage=myImages.HasImage(aSx); + //modified by NIZNHY-PKV Thu Dec 7 11:53:01 2006f + //bHasImage=myImages.HasImage(aSx); + //modified by NIZNHY-PKV Thu Dec 7 11:53:04 2006t if (bHasImage) { const TopTools_ListOfShape& aLSp=myImages.Image(aSx); aIt.Initialize(aLSp); -- 2.39.2