+// Copyright (C) 2014-2015 EDF-R&D
+// 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, or (at your option) any later version.
+//
+// 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
+//
#include "HYDROData_SplitToZonesTool.h"
#endif
for( int anIndex = 1, aLength = theObjectList.Length(); anIndex <= aLength; anIndex++ )
{
- Handle(HYDROData_Object) aGeomObj =
- Handle(HYDROData_Object)::DownCast( theObjectList.Value( anIndex ) );
- if( aGeomObj.IsNull() )
- continue;
+ Handle(HYDROData_Entity) anObj = theObjectList.Value( anIndex );
+ TopoDS_Shape aShape;
+
+ Handle(HYDROData_Object) aGeomObj = Handle(HYDROData_Object)::DownCast( anObj );
+ if( !aGeomObj.IsNull() ) {
+ aShape = aGeomObj->GetTopShape();
+ }
- TopoDS_Shape aShape = aGeomObj->GetTopShape();
if ( aShape.IsNull() )
continue;
#ifdef DEB_SPLIT_TO_ZONES
for ( ; anExp.More(); anExp.Next() ) {
const TopoDS_Face& aFace = TopoDS::Face( anExp.Current() );
if ( !aFace.IsNull() ) {
- SplitData aSplitData( SplitData::Data_Zone, aFace, aGeomObj->GetName() );
+ SplitData aSplitData( SplitData::Data_Zone, aFace, anObj->GetName() );
anInputSplitDataList.append( aSplitData );
}
}
} else {
- SplitData aSplitData( SplitData::Data_Zone, aShape, aGeomObj->GetName() );
+ SplitData aSplitData( SplitData::Data_Zone, aShape, anObj->GetName() );
anInputSplitDataList.append( aSplitData );
}
}
QStringList aListOfNames;
for (int i=0;i < anInputGroupList.size() ;i++) {
const TopoDS_Shape& aSh = anInputGroupList.at(i).Shape;
- aDM3.Bind(aSh, anInputGroupList.at(i).ObjectNames);
+ aDM3.Add(aSh, anInputGroupList.at(i).ObjectNames);
}
}
aBB.MakeCompound(aCmp);
for (int i=0;i < anInputSplitDataList.size() ;i++) {
const TopoDS_Shape& aSh = anInputSplitDataList.at(i).Shape;
- aDM3.Bind(aSh, anInputSplitDataList.at(i).ObjectNames);
+ aDM3.Add(aSh, anInputSplitDataList.at(i).ObjectNames);
aLS.Append(aSh);
aBB.Add(aCmp,aSh);
#ifdef DEB_SPLIT_TO_ZONES
********************************************************************* */
if(!foundF) // face is not modified
aList.Append (anIt.Value());
- aDM1.Bind(anIt.Value(), aList);
+ aDM1.Add(anIt.Value(), aList);
#ifdef DEB_SPLIT_TO_ZONES
TCollection_AsciiString aName;
#endif
cout << aName.ToCString()<< " = " << exp.Current().TShape() <<endl;
#endif
}
- aDM1.Bind(exp.Current(), aList);
+ aDM1.Add(exp.Current(), aList);
}
}
}
aBndView.Add(anEdge);
QStringList aListOfNames;
aListOfNames.append(aBndName);
- aDM3.Bind(anEdge, aListOfNames);
+ aDM3.Add(anEdge, aListOfNames);
TopTools_ListOfShape aList;
aList.Append(anEdge);
- aDM1.Bind(anEdge,aList);
+ aDM1.Add(anEdge,aList);
}
HYDROData_MapOfShape aView;
exp.Init (aResult, TopAbs_FACE);
const TopTools_ListOfShape& aListOfNew = mkCom.Modified(aFace);
//cout << "Modified: " << aListOfNew.Extent() <<endl;
if(!aListOfNew.IsEmpty()) {
- aDM4.Bind(aFace, aListOfNew);
+ aDM4.Add(aFace, aListOfNew);
#ifdef DEB_SPLIT_TO_ZONES
//TCollection_AsciiString aName = aNam + i + ".brep";
//BRepTools::Write(aListOfNew.Last(), aName.ToCString());
else {
TopTools_ListOfShape aList;
aList.Append(aFace);
- aDM4.Bind(aFace, aList); //the same face - not modified
+ aDM4.Add(aFace, aList); //the same face - not modified
}
}
}
aView.Add(anEdge);
const TopTools_ListOfShape& aListOfNewEd = mkCom.Modified(anEdge);
if(!aListOfNewEd.IsEmpty())
- aDM4.Bind(anEdge, aListOfNewEd);
+ aDM4.Add(anEdge, aListOfNewEd);
else {
if(!mkCom.IsDeleted(anEdge)) {
const TopTools_ListOfShape& aListOfGenEd = mkCom.Generated(anEdge);
} else {
TopTools_ListOfShape aList;
aList.Append(anEdge);
- aDM4.Bind(anEdge, aList);//the same edge - not modified
+ aDM4.Add(anEdge, aList);//the same edge - not modified
}
}
}
}
#endif
if(!aListOfNewEd.IsEmpty())
- aDM4.Bind(anEdge, aListOfNewEd);
+ aDM4.Add(anEdge, aListOfNewEd);
else {
if(!mkCom.IsDeleted(anEdge)) {
const TopTools_ListOfShape& aListOfGenEd = mkCom.Generated(anEdge);
} else {
TopTools_ListOfShape aList;
aList.Append(anEdge);
- aDM4.Bind(anEdge, aList);//the same edge - not modified
+ aDM4.Add(anEdge, aList);//the same edge - not modified
}
}
}
TopTools_ListOfShape aList;
aList.Append(aKey);
const TopTools_ListOfShape& aListOfNew = mIt.Value();
- aDM1.Bind(aKey, aListOfNew);
+ aDM1.Add(aKey, aListOfNew);
TopTools_ListIteratorOfListOfShape it(aListOfNew);
for(;it.More();it.Next()) {
- if(!aDM2.IsBound(it.Value()))
- aDM2.Bind(it.Value(), aList);
+ if(!aDM2.Contains(it.Value()))
+ aDM2.Add(it.Value(), aList);
else {
- TopTools_ListOfShape& aList = aDM2.ChangeFind(it.Value());
+ TopTools_ListOfShape& aList = aDM2.ChangeFromKey(it.Value());
aList.Prepend(aKey);
}
}
const TopTools_ListOfShape& aListOfNew = aMIt.Value();
TopTools_ListIteratorOfListOfShape it(aListOfNew);
for(;it.More();it.Next()) {// iterate new: b1, b2, b3...
- if(!aDM4.IsBound(it.Value())) // bi - is deleted
+ if(!aDM4.Contains(it.Value())) // bi - is deleted
continue; // go to the next bi
else {
- const TopTools_ListOfShape& aListOfNew4 = aDM4.Find(it.Value());
+ const TopTools_ListOfShape& aListOfNew4 = aDM4.FindFromKey(it.Value());
TopTools_ListIteratorOfListOfShape it4(aListOfNew4); // {c1, c2, c3,...}
for(;it4.More();it4.Next()) {
- if(!aDM2.IsBound(it4.Value()))
- aDM2.Bind(it4.Value(), aList);
+ if(!aDM2.Contains(it4.Value()))
+ aDM2.Add(it4.Value(), aList);
else {
- TopTools_ListOfShape& aList = aDM2.ChangeFind(it4.Value());
+ TopTools_ListOfShape& aList = aDM2.ChangeFromKey(it4.Value());
aList.Prepend(aKey);
}
}
const TopTools_ListOfShape& aListOfNew = aMIt.Value();
TopTools_ListIteratorOfListOfShape it(aListOfNew);
for(;it.More();it.Next()) {
- if(!aDM2.IsBound(it.Value()))
- aDM2.Bind(it.Value(), aList);
+ if(!aDM2.Contains(it.Value()))
+ aDM2.Add(it.Value(), aList);
else {
- TopTools_ListOfShape& aList = aDM2.ChangeFind(it.Value());
+ TopTools_ListOfShape& aList = aDM2.ChangeFromKey(it.Value());
aList.Prepend(aKey);
}
}
TopTools_ListIteratorOfListOfShape it(aListOfOld);
for(int j =1;it.More();it.Next(),j++) {
const TopoDS_Shape& aSh = it.Value(); //old
- if(aDM3.IsBound(aSh)) {
- const QStringList& ObjectNames = aDM3.Find(aSh);
+ if(aDM3.Contains(aSh)) {
+ const QStringList& ObjectNames = aDM3.FindFromKey(aSh);
aListOfNames.append(ObjectNames);
#ifdef DEB_SPLIT_TO_ZONES
TCollection_AsciiString aName = aNam4 + i +"_" + j + ".brep";
return anOutputSplitDataList;
}
+HYDROData_SplitToZonesTool::SplitDataList
+ HYDROData_SplitToZonesTool::Split( const HYDROData_SequenceOfObjects& theObjectList )
+{
+ HYDROData_SequenceOfObjects aGeomGroups;
+ Handle(HYDROData_PolylineXY) aPolyline;
+
+ return Split( theObjectList, aGeomGroups, aPolyline );
+}
\ No newline at end of file