uses
Shape from TopoDS,
ListOfShape from TopTools,
- MapOfShape from TopTools
+ MapOfShape from TopTools,
+ IndexedDataMapOfShapeListOfShape from TopTools
--raises
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;
--
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;
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
-// 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
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
+#ifndef _TopTools_IndexedDataMapOfShapeListOfShape_HeaderFile
+#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
+#endif
#ifndef _GEOMAlgo_Algo_HeaderFile
#include <GEOMAlgo_Algo.hxx>
#endif
class TopoDS_Shape;
class TopTools_ListOfShape;
+class TopTools_IndexedDataMapOfShapeListOfShape;
#ifndef _Standard_HeaderFile
Standard_EXPORT Standard_Boolean HasModified() const;
+Standard_EXPORT const TopTools_IndexedDataMapOfShapeListOfShape& ImagesResult() const;
+
+
Standard_Boolean myHasDeleted;
Standard_Boolean myHasGenerated;
Standard_Boolean myHasModified;
+TopTools_IndexedDataMapOfShapeListOfShape myImagesResult;
private:
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);
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();
}
}
} //for (i=1; i<=aNbS; ++i)
+ */
+ //modified by NIZNHY-PKV Wed Dec 6 17:07:55 2006t
}
//=======================================================================
//function :FillInternalShapes
#include <GEOMAlgo_Tools3D.hxx>
-
static
void MapShapes(const TopoDS_Shape& aS,
TopTools_MapOfShape& aM);
//=======================================================================
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
}
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);