This commit is contained in:
jfa 2009-11-04 09:13:23 +00:00
parent 16fc7fed7d
commit 418a6b7ea1

View File

@ -94,7 +94,6 @@
#include "utilities.h" #include "utilities.h"
//======================================================================= //=======================================================================
//function : GetID //function : GetID
//purpose : //purpose :
@ -105,7 +104,6 @@ const Standard_GUID& GEOMImpl_PipeDriver::GetID()
return aPipeDriver; return aPipeDriver;
} }
//======================================================================= //=======================================================================
//function : GEOMImpl_PipeDriver //function : GEOMImpl_PipeDriver
//purpose : //purpose :
@ -114,7 +112,6 @@ GEOMImpl_PipeDriver::GEOMImpl_PipeDriver()
{ {
} }
//======================================================================= //=======================================================================
//function : FillForOtherEdges //function : FillForOtherEdges
//purpose : auxilary for CreatePipeForShellSections() //purpose : auxilary for CreatePipeForShellSections()
@ -191,7 +188,6 @@ static bool FillForOtherEdges(const TopoDS_Shape& F1,
return true; return true;
} }
//======================================================================= //=======================================================================
//function : FillCorrespondingEdges //function : FillCorrespondingEdges
//purpose : auxilary for CreatePipeForShellSections() //purpose : auxilary for CreatePipeForShellSections()
@ -324,7 +320,6 @@ static bool FillCorrespondingEdges(const TopoDS_Shape& FS1,
//return true; //return true;
} }
//======================================================================= //=======================================================================
//function : FillCorrespondingEdges //function : FillCorrespondingEdges
//purpose : auxilary for CreatePipeShellsWithoutPath() //purpose : auxilary for CreatePipeShellsWithoutPath()
@ -427,7 +422,6 @@ static bool FillCorrespondingEdges(const TopoDS_Shape& FS1,
return FillForOtherEdges(FS1,E1,V21,FF); return FillForOtherEdges(FS1,E1,V21,FF);
} }
//======================================================================= //=======================================================================
//function : FindNextPairOfFaces //function : FindNextPairOfFaces
//purpose : auxilary for CreatePipeForShellSections() //purpose : auxilary for CreatePipeForShellSections()
@ -498,7 +492,6 @@ static void FindNextPairOfFaces(const TopoDS_Shape& aCurFace,
} }
} }
//======================================================================= //=======================================================================
//function : FindFirstPairFaces //function : FindFirstPairFaces
//purpose : auxilary for Execute() //purpose : auxilary for Execute()
@ -619,7 +612,6 @@ static void FindFirstPairFaces(const TopoDS_Shape& S1, const TopoDS_Shape& S2,
FS2 = Fs(numface); FS2 = Fs(numface);
} }
//======================================================================= //=======================================================================
//function : CreatePipeForShellSections //function : CreatePipeForShellSections
//purpose : auxilary for Execute() //purpose : auxilary for Execute()
@ -839,7 +831,7 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
//TopTools_SequenceOfShape aSeqFaces; //TopTools_SequenceOfShape aSeqFaces;
TopoDS_Compound aComp; TopoDS_Compound aComp;
B.MakeCompound(aComp); B.MakeCompound(aComp);
for(i=1 ; i<nbBases; i++) { for (i = 1; i < nbBases; i++) {
TopoDS_Wire WPath = TopoDS::Wire(Wires.Value(i)); TopoDS_Wire WPath = TopoDS::Wire(Wires.Value(i));
// 1 section // 1 section
Handle(Standard_Transient) anItem1 = aBasesObjs->Value(i); Handle(Standard_Transient) anItem1 = aBasesObjs->Value(i);
@ -1308,7 +1300,6 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
FindNextPairOfFaces(FS1, aMapEdgeFaces1, aMapEdgeFaces2, FF, aCI); FindNextPairOfFaces(FS1, aMapEdgeFaces1, aMapEdgeFaces2, FF, aCI);
// make pipe for each pair of faces // make pipe for each pair of faces
for(j=1; j<=FF.Extent(); j++) { for(j=1; j<=FF.Extent(); j++) {
TopoDS_Shape F1 = FF.FindKey(j); TopoDS_Shape F1 = FF.FindKey(j);
@ -1382,7 +1373,6 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
return aComp; return aComp;
} }
//======================================================================= //=======================================================================
//function : CreatePipeShellsWithoutPath //function : CreatePipeShellsWithoutPath
//purpose : auxilary for Execute() //purpose : auxilary for Execute()
@ -1407,7 +1397,6 @@ static TopoDS_Shape CreatePipeShellsWithoutPath(GEOMImpl_IPipe* aCI)
Standard_ConstructionError::Raise("Number of shapes for recognition is invalid"); Standard_ConstructionError::Raise("Number of shapes for recognition is invalid");
} }
TopTools_SequenceOfShape SecVs,Bases; TopTools_SequenceOfShape SecVs,Bases;
for(i=1; i<=nbBases; i++) { for(i=1; i<=nbBases; i++) {
// vertex // vertex
@ -1439,7 +1428,7 @@ static TopoDS_Shape CreatePipeShellsWithoutPath(GEOMImpl_IPipe* aCI)
TopoDS_Compound aComp; TopoDS_Compound aComp;
B.MakeCompound(aComp); B.MakeCompound(aComp);
for(i=1 ; i<nbBases; i++) { for (i = 1; i < nbBases; i++) {
MESSAGE ("Make pipe between sections "<<i<<" and "<<i+1); MESSAGE ("Make pipe between sections "<<i<<" and "<<i+1);
TopoDS_Shape aShBase1 = Bases.Value(i); TopoDS_Shape aShBase1 = Bases.Value(i);
TopoDS_Shape aShBase2 = Bases.Value(i+1); TopoDS_Shape aShBase2 = Bases.Value(i+1);
@ -1853,7 +1842,6 @@ static TopoDS_Shape CreatePipeShellsWithoutPath(GEOMImpl_IPipe* aCI)
return aComp; return aComp;
} }
//======================================================================= //=======================================================================
//function : CreatePipeBiNormalAlongVector //function : CreatePipeBiNormalAlongVector
//purpose : auxilary for Execute() //purpose : auxilary for Execute()
@ -1919,7 +1907,6 @@ static TopoDS_Shape CreatePipeBiNormalAlongVector(const TopoDS_Wire& aWirePath,
return PipeBuilder.Shape(); return PipeBuilder.Shape();
} }
//======================================================================= //=======================================================================
//function : Execute //function : Execute
//purpose : //purpose :
@ -2008,7 +1995,7 @@ Standard_Integer GEOMImpl_PipeDriver::Execute(TFunction_Logbook& log) const
TopTools_SequenceOfShape aSeqBases; TopTools_SequenceOfShape aSeqBases;
TopTools_SequenceOfShape aSeqLocs; TopTools_SequenceOfShape aSeqLocs;
TopTools_SequenceOfShape aSeqFaces; TopTools_SequenceOfShape aSeqFaces;
for( ; i <= nbBases; i++) { for (; i <= nbBases; i++) {
Handle(Standard_Transient) anItem = aBasesObjs->Value(i); Handle(Standard_Transient) anItem = aBasesObjs->Value(i);
if(anItem.IsNull()) if(anItem.IsNull())
continue; continue;
@ -2049,7 +2036,7 @@ Standard_Integer GEOMImpl_PipeDriver::Execute(TFunction_Logbook& log) const
//for case one path should be used other type function //for case one path should be used other type function
aSeqFaces.Append(aShapeBase); aSeqFaces.Append(aShapeBase);
TopExp_Explorer aExpW(aShapeBase,TopAbs_WIRE); TopExp_Explorer aExpW(aShapeBase,TopAbs_WIRE);
for( ; aExpW.More(); aExpW.Next()) for (; aExpW.More(); aExpW.Next())
{ {
TopoDS_Shape aWireProf = aExpW.Current(); TopoDS_Shape aWireProf = aExpW.Current();
aSeqBases.Append(aWireProf); aSeqBases.Append(aWireProf);
@ -2311,15 +2298,15 @@ Standard_Integer GEOMImpl_PipeDriver::Execute(TFunction_Logbook& log) const
Standard_Integer nbShapes = aSeqBases.Length(); Standard_Integer nbShapes = aSeqBases.Length();
Standard_Integer step = nbShapes/nbBases; Standard_Integer step = nbShapes/nbBases;
if(nbShapes < nbBases || fmod((double)nbShapes, (double)nbBases)) { if (nbShapes < nbBases || fmod((double)nbShapes, (double)nbBases)) {
if(aCI) delete aCI; if(aCI) delete aCI;
Standard_ConstructionError::Raise("Invalid sections were specified for building pipe"); Standard_ConstructionError::Raise("Invalid sections were specified for building pipe");
} }
Standard_Integer ind =0; Standard_Integer ind =0;
for( i=1; i <= nbShapes && ind < nbShapes; i++) { //i+nbBases <= nbShapes for (i = 1; i <= nbShapes && ind < nbShapes; i++) { //i+nbBases <= nbShapes
TopTools_SequenceOfShape usedBases; TopTools_SequenceOfShape usedBases;
Standard_Integer j = 1; Standard_Integer j = 1;
for( ; j <= nbBases ; j++) { for (; j <= nbBases; j++) {
ind = i + (j-1)*step; ind = i + (j-1)*step;
TopoDS_Shape aWireProf = aSeqBases.Value(ind); TopoDS_Shape aWireProf = aSeqBases.Value(ind);
usedBases.Append(aWireProf); usedBases.Append(aWireProf);
@ -2402,7 +2389,6 @@ Standard_Integer GEOMImpl_PipeDriver::Execute(TFunction_Logbook& log) const
return 1; return 1;
} }
//======================================================================= //=======================================================================
//function : GEOMImpl_PipeDriver_Type_ //function : GEOMImpl_PipeDriver_Type_
//purpose : //purpose :
@ -2417,7 +2403,6 @@ Standard_EXPORT Handle_Standard_Type& GEOMImpl_PipeDriver_Type_()
static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient); if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_PipeDriver", static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_PipeDriver",
sizeof(GEOMImpl_PipeDriver), sizeof(GEOMImpl_PipeDriver),
@ -2442,6 +2427,5 @@ const Handle(GEOMImpl_PipeDriver) Handle(GEOMImpl_PipeDriver)::DownCast(const Ha
} }
} }
return _anOtherObject ; return _anOtherObject;
} }