22852: EDF 9937 GEOM: Kind of shape unrecognized when importing step files

This commit is contained in:
eap 2015-04-27 17:03:33 +03:00
parent 59b5446863
commit 7760eb2714
21 changed files with 789 additions and 733 deletions

View File

@ -59,7 +59,10 @@ SET(GEOMAlgo_HEADERS
GEOMAlgo_DataMapOfPassKeyInteger.hxx GEOMAlgo_DataMapOfPassKeyInteger.hxx
GEOMAlgo_DataMapOfShapeMapOfShape.hxx GEOMAlgo_DataMapOfShapeMapOfShape.hxx
GEOMAlgo_DataMapOfShapePnt.hxx GEOMAlgo_DataMapOfShapePnt.hxx
GEOMAlgo_FinderShapeOn.hxx
GEOMAlgo_FinderShapeOn1.hxx
GEOMAlgo_FinderShapeOn2.hxx GEOMAlgo_FinderShapeOn2.hxx
GEOMAlgo_FinderShapeOnQuad.hxx
GEOMAlgo_GetInPlace.hxx GEOMAlgo_GetInPlace.hxx
GEOMAlgo_GetInPlaceAPI.hxx GEOMAlgo_GetInPlaceAPI.hxx
GEOMAlgo_GlueAnalyser.hxx GEOMAlgo_GlueAnalyser.hxx
@ -77,6 +80,7 @@ SET(GEOMAlgo_HEADERS
GEOMAlgo_IndexedDataMapOfShapeState.hxx GEOMAlgo_IndexedDataMapOfShapeState.hxx
GEOMAlgo_KindOfBounds.hxx GEOMAlgo_KindOfBounds.hxx
GEOMAlgo_KindOfClosed.hxx GEOMAlgo_KindOfClosed.hxx
GEOMAlgo_KindOfDef.hxx
GEOMAlgo_KindOfName.hxx GEOMAlgo_KindOfName.hxx
GEOMAlgo_KindOfShape.hxx GEOMAlgo_KindOfShape.hxx
GEOMAlgo_ListIteratorOfListOfCoupleOfShapes.hxx GEOMAlgo_ListIteratorOfListOfCoupleOfShapes.hxx

View File

@ -11,25 +11,28 @@ GEOMAlgo_ShellSolid.cxx
GEOMAlgo_AlgoTools.hxx GEOMAlgo_AlgoTools.hxx
GEOMAlgo_AlgoTools.cxx GEOMAlgo_AlgoTools.cxx
GEOMAlgo_AlgoTools_1.cxx GEOMAlgo_AlgoTools_1.cxx
GEOMAlgo_AlgoTools_2.cxx
GEOMAlgo_SolidSolid.hxx GEOMAlgo_SolidSolid.hxx
GEOMAlgo_SolidSolid.cxx GEOMAlgo_SolidSolid.cxx
GEOMAlgo_ShapeAlgo.hxx GEOMAlgo_ShapeAlgo.hxx
GEOMAlgo_ShapeAlgo.cxx GEOMAlgo_ShapeAlgo.cxx
GEOMAlgo_FinderShapeOn.hxx
GEOMAlgo_FinderShapeOn.cxx
GEOMAlgo_FinderShapeOn1.hxx
GEOMAlgo_FinderShapeOn1.cxx
GEOMAlgo_HAlgo.hxx GEOMAlgo_HAlgo.hxx
GEOMAlgo_HAlgo.cxx GEOMAlgo_HAlgo.cxx
GEOMAlgo_Clsf.hxx GEOMAlgo_Clsf.hxx
GEOMAlgo_Clsf.cxx GEOMAlgo_Clsf.cxx
GEOMAlgo_ClsfBox.hxx GEOMAlgo_ClsfBox.hxx
GEOMAlgo_ClsfBox.cxx GEOMAlgo_ClsfBox.cxx
GEOMAlgo_ClsfQuad.hxx
GEOMAlgo_ClsfQuad.cxx
GEOMAlgo_ClsfSolid.hxx GEOMAlgo_ClsfSolid.hxx
GEOMAlgo_ClsfSolid.cxx GEOMAlgo_ClsfSolid.cxx
GEOMAlgo_ClsfSurf.hxx GEOMAlgo_ClsfSurf.hxx
GEOMAlgo_ClsfSurf.cxx GEOMAlgo_ClsfSurf.cxx
GEOMAlgo_FinderShapeOn2.hxx GEOMAlgo_FinderShapeOn2.hxx
GEOMAlgo_FinderShapeOn2.cxx GEOMAlgo_FinderShapeOn2.cxx
GEOMAlgo_FinderShapeOnQuad.hxx
GEOMAlgo_FinderShapeOnQuad.cxx
GEOMAlgo_Gluer.hxx GEOMAlgo_Gluer.hxx
GEOMAlgo_Gluer.cxx GEOMAlgo_Gluer.cxx
GEOMAlgo_GlueAnalyser.hxx GEOMAlgo_GlueAnalyser.hxx
@ -50,8 +53,6 @@ GEOMAlgo_GetInPlace.cxx
GEOMAlgo_GetInPlace_1.cxx GEOMAlgo_GetInPlace_1.cxx
GEOMAlgo_GetInPlace_2.cxx GEOMAlgo_GetInPlace_2.cxx
GEOMAlgo_GetInPlace_3.cxx GEOMAlgo_GetInPlace_3.cxx
GEOMAlgo_GetInPlaceAPI.hxx
GEOMAlgo_GetInPlaceAPI.cxx
GEOMAlgo_Splitter.hxx GEOMAlgo_Splitter.hxx
GEOMAlgo_Splitter.cxx GEOMAlgo_Splitter.cxx
GEOMAlgo_ShapeInfoFiller.hxx GEOMAlgo_ShapeInfoFiller.hxx
@ -106,3 +107,5 @@ GEOMAlgo_ShapeInfo.cxx
GEOMAlgo_IndexedDataMapOfShapeShapeInfo.hxx GEOMAlgo_IndexedDataMapOfShapeShapeInfo.hxx
Basics_OCCTVersion.hxx Basics_OCCTVersion.hxx
GEOMAlgo_KindOfDef.hxx

0
src/GEOMAlgo/GEOMAlgo.cdl Executable file → Normal file
View File

95
src/GEOMAlgo/GEOMAlgo_AlgoTools.cxx Executable file → Normal file
View File

@ -93,15 +93,15 @@ static
Standard_Integer& iCnt); Standard_Integer& iCnt);
static static
void CopySource(const TopoDS_Shape& aS, void CopySource(const TopoDS_Shape& aS,
TopTools_IndexedDataMapOfShapeShape& aMapSS, TopTools_IndexedDataMapOfShapeShape& aMapSS,
TopoDS_Shape& aSC); TopoDS_Shape& aSC);
//======================================================================= //=======================================================================
//function : CopyShape //function : CopyShape
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_AlgoTools::CopyShape(const TopoDS_Shape& aS, void GEOMAlgo_AlgoTools::CopyShape(const TopoDS_Shape& aS,
TopoDS_Shape& aSC) TopoDS_Shape& aSC)
{ {
TopTools_IndexedDataMapOfShapeShape aMapSS; TopTools_IndexedDataMapOfShapeShape aMapSS;
// //
@ -112,8 +112,8 @@ void GEOMAlgo_AlgoTools::CopyShape(const TopoDS_Shape& aS,
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_AlgoTools::CopyShape(const TopoDS_Shape& aS, void GEOMAlgo_AlgoTools::CopyShape(const TopoDS_Shape& aS,
TopoDS_Shape& aSC, TopoDS_Shape& aSC,
TopTools_IndexedDataMapOfShapeShape& aMapSS) TopTools_IndexedDataMapOfShapeShape& aMapSS)
{ {
CopySource(aS, aMapSS, aSC); CopySource(aS, aMapSS, aSC);
} }
@ -172,9 +172,9 @@ void CopySource(const TopoDS_Shape& aS,
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_AlgoTools::FaceNormal (const TopoDS_Face& aF, void GEOMAlgo_AlgoTools::FaceNormal (const TopoDS_Face& aF,
const Standard_Real U, const Standard_Real U,
const Standard_Real V, const Standard_Real V,
gp_Vec& aN) gp_Vec& aN)
{ {
gp_Pnt aPnt ; gp_Pnt aPnt ;
gp_Vec aD1U, aD1V; gp_Vec aD1U, aD1V;
@ -330,7 +330,7 @@ Standard_Integer GEOMAlgo_AlgoTools::BuildPCurveForEdgeOnFace
// purpose: // purpose:
//======================================================================= //=======================================================================
void GEOMAlgo_AlgoTools::MakeContainer(const TopAbs_ShapeEnum theType, void GEOMAlgo_AlgoTools::MakeContainer(const TopAbs_ShapeEnum theType,
TopoDS_Shape& theC) TopoDS_Shape& theC)
{ {
BRep_Builder aBB; BRep_Builder aBB;
// //
@ -399,9 +399,9 @@ Standard_Boolean GEOMAlgo_AlgoTools::IsUPeriodic(const Handle(Geom_Surface) &aS
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_AlgoTools::RefinePCurveForEdgeOnFace(const TopoDS_Edge& aE, void GEOMAlgo_AlgoTools::RefinePCurveForEdgeOnFace(const TopoDS_Edge& aE,
const TopoDS_Face& aF, const TopoDS_Face& aF,
const Standard_Real aUMin, const Standard_Real aUMin,
const Standard_Real aUMax) const Standard_Real aUMax)
{ {
Standard_Real aT1, aT2, aTx, aUx, aTol; Standard_Real aT1, aT2, aTx, aUx, aTol;
gp_Pnt2d aP2D; gp_Pnt2d aP2D;
@ -546,7 +546,7 @@ Standard_Boolean GEOMAlgo_AlgoTools::ProjectPointOnShape
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_AlgoTools::PointOnEdge(const TopoDS_Edge& aE, void GEOMAlgo_AlgoTools::PointOnEdge(const TopoDS_Edge& aE,
gp_Pnt& aP3D) gp_Pnt& aP3D)
{ {
Standard_Real aTx, aT1, aT2; Standard_Real aTx, aT1, aT2;
// //
@ -559,8 +559,8 @@ void GEOMAlgo_AlgoTools::PointOnEdge(const TopoDS_Edge& aE,
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_AlgoTools::PointOnEdge(const TopoDS_Edge& aE, void GEOMAlgo_AlgoTools::PointOnEdge(const TopoDS_Edge& aE,
const Standard_Real aT, const Standard_Real aT,
gp_Pnt& aP3D) gp_Pnt& aP3D)
{ {
Standard_Real aT1, aT2; Standard_Real aT1, aT2;
Handle(Geom_Curve) aC3D; Handle(Geom_Curve) aC3D;
@ -573,9 +573,9 @@ void GEOMAlgo_AlgoTools::PointOnEdge(const TopoDS_Edge& aE,
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_AlgoTools::PointOnFace(const TopoDS_Face& aF, void GEOMAlgo_AlgoTools::PointOnFace(const TopoDS_Face& aF,
const Standard_Real aU, const Standard_Real aU,
const Standard_Real aV, const Standard_Real aV,
gp_Pnt& aP3D) gp_Pnt& aP3D)
{ {
Handle(Geom_Surface) aS; Handle(Geom_Surface) aS;
// //
@ -587,7 +587,7 @@ void GEOMAlgo_AlgoTools::PointOnFace(const TopoDS_Face& aF,
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_AlgoTools::PointOnFace(const TopoDS_Face& aF, void GEOMAlgo_AlgoTools::PointOnFace(const TopoDS_Face& aF,
gp_Pnt& aP3D) gp_Pnt& aP3D)
{ {
Standard_Real aU, aV, aUMin, aUMax, aVMin, aVMax; Standard_Real aU, aV, aUMin, aUMax, aVMin, aVMax;
// //
@ -603,7 +603,7 @@ void GEOMAlgo_AlgoTools::PointOnFace(const TopoDS_Face& aF,
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_AlgoTools::PointOnShape(const TopoDS_Shape& aS, void GEOMAlgo_AlgoTools::PointOnShape(const TopoDS_Shape& aS,
gp_Pnt& aP3D) gp_Pnt& aP3D)
{ {
TopAbs_ShapeEnum aType; TopAbs_ShapeEnum aType;
// //
@ -700,7 +700,7 @@ Standard_Integer GEOMAlgo_AlgoTools::FindSDShapes
return 0; // Nothing to do return 0; // Nothing to do
} }
// //
while(1) { for(;;) {
aNbEProcessed=aMProcessed.Extent(); aNbEProcessed=aMProcessed.Extent();
if (aNbEProcessed==aNbE) { if (aNbEProcessed==aNbE) {
break; break;
@ -909,8 +909,8 @@ void GetCount(const TopoDS_Shape& aS,
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Integer GEOMAlgo_AlgoTools::PntInFace(const TopoDS_Face& aF, Standard_Integer GEOMAlgo_AlgoTools::PntInFace(const TopoDS_Face& aF,
gp_Pnt& theP, gp_Pnt& theP,
gp_Pnt2d& theP2D) gp_Pnt2d& theP2D)
{ {
Standard_Boolean bIsDone, bHasFirstPoint, bHasSecondPoint; Standard_Boolean bIsDone, bHasFirstPoint, bHasSecondPoint;
Standard_Integer iErr, aIx, aNbDomains, i; Standard_Integer iErr, aIx, aNbDomains, i;
@ -935,8 +935,8 @@ Standard_Integer GEOMAlgo_AlgoTools::PntInFace(const TopoDS_Face& aF,
// //
Geom2dHatch_Intersector aIntr(aTotArcIntr, aTolTangfIntr); Geom2dHatch_Intersector aIntr(aTotArcIntr, aTolTangfIntr);
Geom2dHatch_Hatcher aHatcher(aIntr, Geom2dHatch_Hatcher aHatcher(aIntr,
aTolHatch2D, aTolHatch3D, aTolHatch2D, aTolHatch3D,
Standard_True, Standard_False); Standard_True, Standard_False);
// //
iErr=0; iErr=0;
aEpsT=1.e-12; aEpsT=1.e-12;
@ -991,30 +991,33 @@ Standard_Integer GEOMAlgo_AlgoTools::PntInFace(const TopoDS_Face& aF,
} }
// //
// 4. // 4.
aVx=aVMin;
aNbDomains=aHatcher.NbDomains(aIx); aNbDomains=aHatcher.NbDomains(aIx);
for (i=1; i<=aNbDomains; ++i) { if (!aNbDomains) {
const HatchGen_Domain& aDomain=aHatcher.Domain (aIx, i) ; iErr=5;
bHasFirstPoint=aDomain.HasFirstPoint(); return iErr;
if (!bHasFirstPoint) {
iErr=5;
return iErr;
}
//
aV1=aDomain.FirstPoint().Parameter();
//
bHasSecondPoint=aDomain.HasSecondPoint();
if (!bHasSecondPoint) {
iErr=6;
return iErr;
}
//
aV2=aDomain.SecondPoint().Parameter();
//
aVx=IntTools_Tools::IntermediatePoint(aV1, aV2);
//
break;
} }
// //
i=1;
const HatchGen_Domain& aDomain=aHatcher.Domain (aIx, i) ;
bHasFirstPoint=aDomain.HasFirstPoint();
if (!bHasFirstPoint) {
iErr=5;
return iErr;
}
//
aV1=aDomain.FirstPoint().Parameter();
//
bHasSecondPoint=aDomain.HasSecondPoint();
if (!bHasSecondPoint) {
iErr=6;
return iErr;
}
//
aV2=aDomain.SecondPoint().Parameter();
//
aVx=IntTools_Tools::IntermediatePoint(aV1, aV2);
//
aS->D0(aUx, aVx, aPx); aS->D0(aUx, aVx, aPx);
// //
theP2D.SetCoord(aUx, aVx); theP2D.SetCoord(aUx, aVx);

View File

@ -62,7 +62,6 @@
#include <BRepLib_MakeFace.hxx> #include <BRepLib_MakeFace.hxx>
#include <BRepLib_FaceError.hxx> #include <BRepLib_FaceError.hxx>
//#include <BOPTools_DSFiller.hxx>
#include <GEOMAlgo_WireSolid.hxx> #include <GEOMAlgo_WireSolid.hxx>
#include <GEOMAlgo_ShellSolid.hxx> #include <GEOMAlgo_ShellSolid.hxx>
@ -300,7 +299,6 @@ void GEOMAlgo_FinderShapeOn::Find(const TopoDS_Shape& aS)
{ {
myErrorStatus=0; myErrorStatus=0;
// //
Standard_Boolean bIsDone;
Standard_Integer i, iErr; Standard_Integer i, iErr;
TopAbs_State aSts[]={TopAbs_IN, TopAbs_OUT, TopAbs_ON}; TopAbs_State aSts[]={TopAbs_IN, TopAbs_OUT, TopAbs_ON};
TopTools_ListIteratorOfListOfShape aIt; TopTools_ListIteratorOfListOfShape aIt;

View File

@ -309,6 +309,9 @@ void GEOMAlgo_FinderShapeOn1::ProcessEdges()
aType1=myGAS.GetType(); aType1=myGAS.GetType();
// //
TopExp::MapShapes(myShape, TopAbs_EDGE, aM); TopExp::MapShapes(myShape, TopAbs_EDGE, aM);
//
bIsConformState=Standard_False;
//
aNb=aM.Extent(); aNb=aM.Extent();
for (i=1; i<=aNb; ++i) { for (i=1; i<=aNb; ++i) {
GEOMAlgo_ListOfPnt aLP; GEOMAlgo_ListOfPnt aLP;
@ -427,6 +430,8 @@ void GEOMAlgo_FinderShapeOn1::ProcessFaces()
} }
} }
// //
bIsConformState=Standard_False;
//
aExp.Init(aF, TopAbs_EDGE); aExp.Init(aF, TopAbs_EDGE);
for (; aExp.More(); aExp.Next()) { for (; aExp.More(); aExp.Next()) {
const TopoDS_Shape& aE=aExp.Current(); const TopoDS_Shape& aE=aExp.Current();
@ -500,6 +505,9 @@ void GEOMAlgo_FinderShapeOn1::ProcessSolids()
const TopoDS_Shape& aSd=aM(i); const TopoDS_Shape& aSd=aM(i);
aMF.Clear(); aMF.Clear();
TopExp::MapShapes(aSd, TopAbs_FACE, aMF); TopExp::MapShapes(aSd, TopAbs_FACE, aMF);
//
bIsConformState=Standard_False;
//
aNbF=aMF.Extent(); aNbF=aMF.Extent();
for (j=1; j<=aNbF; ++j) { for (j=1; j<=aNbF; ++j) {
const TopoDS_Shape& aF=aMF(j); const TopoDS_Shape& aF=aMF(j);
@ -660,7 +668,6 @@ void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Face& aF,
}// if (aType==GeomAbs_Plane || aType==GeomAbs_Cylinder) }// if (aType==GeomAbs_Plane || aType==GeomAbs_Cylinder)
}// if (!aNb && myNbPntsMin) { }// if (!aNb && myNbPntsMin) {
} }
//modified by NIZNHY-PKV Thu Jan 26 09:56:20 2012f
//======================================================================= //=======================================================================
//function : InnerPoints //function : InnerPoints
//purpose : //purpose :
@ -676,7 +683,6 @@ void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Edge& aE,
aLP.Clear(); aLP.Clear();
InnerPoints(aE, aNbPntsMin, aLP); InnerPoints(aE, aNbPntsMin, aLP);
} }
//modified by NIZNHY-PKV Thu Jan 26 09:56:32 2012t
//======================================================================= //=======================================================================
//function : InnerPoints //function : InnerPoints
//purpose : //purpose :
@ -702,16 +708,6 @@ void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Edge& aE,
return; return;
} }
// //
//modified by NIZNHY-PKV Thu Jan 26 09:51:20 2012f
/*
aNbT=myNbPntsMin+1;
dT=(aT2-aT1)/aNbT;
for (j=1; j<=aNbPntsMin; ++j) {
aT=aT1+j*dT;
aC3D->D0(aT, aP);
aLP.Append(aP);
}
*/
aNbT=aNbPntsMin+1; aNbT=aNbPntsMin+1;
dT=(aT2-aT1)/aNbT; dT=(aT2-aT1)/aNbT;
for (j=1; j<aNbT; ++j) { for (j=1; j<aNbT; ++j) {
@ -719,7 +715,6 @@ void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Edge& aE,
aC3D->D0(aT, aP); aC3D->D0(aT, aP);
aLP.Append(aP); aLP.Append(aP);
} }
//modified by NIZNHY-PKV Thu Jan 26 09:51:24 2012t
} }
//======================================================================= //=======================================================================

View File

@ -362,6 +362,8 @@ void GEOMAlgo_FinderShapeOn2::ProcessEdges()
// //
const TopoDS_Edge& aE=TopoDS::Edge(aM(i)); const TopoDS_Edge& aE=TopoDS::Edge(aM(i));
// //
bIsConformState=Standard_False;
//
aExp.Init(aE, TopAbs_VERTEX); aExp.Init(aE, TopAbs_VERTEX);
for (; aExp.More(); aExp.Next()) { for (; aExp.More(); aExp.Next()) {
const TopoDS_Shape& aV=aExp.Current(); const TopoDS_Shape& aV=aExp.Current();
@ -475,6 +477,9 @@ void GEOMAlgo_FinderShapeOn2::ProcessFaces()
} }
} }
// //
//
bIsConformState=Standard_False;
//
aExp.Init(aF, TopAbs_EDGE); aExp.Init(aF, TopAbs_EDGE);
for (; aExp.More(); aExp.Next()) { for (; aExp.More(); aExp.Next()) {
const TopoDS_Shape& aE=aExp.Current(); const TopoDS_Shape& aE=aExp.Current();
@ -558,6 +563,9 @@ void GEOMAlgo_FinderShapeOn2::ProcessSolids()
const TopoDS_Shape& aSd=aM(i); const TopoDS_Shape& aSd=aM(i);
aMF.Clear(); aMF.Clear();
TopExp::MapShapes(aSd, TopAbs_FACE, aMF); TopExp::MapShapes(aSd, TopAbs_FACE, aMF);
//
bIsConformState=Standard_False;
//
aNbF=aMF.Extent(); aNbF=aMF.Extent();
for (j=1; j<=aNbF; ++j) { for (j=1; j<=aNbF; ++j) {
const TopoDS_Shape& aF=aMF(j); const TopoDS_Shape& aF=aMF(j);

View File

@ -239,7 +239,6 @@ Standard_Integer PntInSolid(const TopoDS_Solid& aZ,
gp_Pnt aPx; gp_Pnt aPx;
gp_Pnt2d aP2Dx; gp_Pnt2d aP2Dx;
gp_Vec aDNx; gp_Vec aDNx;
TopoDS_Face aF; TopoDS_Face aF;
TopExp_Explorer aExp; TopExp_Explorer aExp;
// //
@ -247,9 +246,8 @@ Standard_Integer PntInSolid(const TopoDS_Solid& aZ,
aCoef=10.; aCoef=10.;
// //
aExp.Init (aZ, TopAbs_FACE); aExp.Init (aZ, TopAbs_FACE);
for (; aExp.More() ; aExp.Next()) { if (aExp.More()) {
aF=*((TopoDS_Face*)&aExp.Current()); aF=*((TopoDS_Face*)&aExp.Current());
break;
} }
// //
iErr=PntInFace(aF, aPx, aP2Dx); iErr=PntInFace(aF, aPx, aP2Dx);
@ -368,29 +366,31 @@ Standard_Integer PntInFace(const TopoDS_Face& aF,
// //
// 4. // 4.
aNbDomains=aHatcher.NbDomains(aIx); aNbDomains=aHatcher.NbDomains(aIx);
for (i=1; i<=aNbDomains; ++i) { if (!aNbDomains) {
const HatchGen_Domain& aDomain=aHatcher.Domain (aIx, i) ; iErr=5;
bHasFirstPoint=aDomain.HasFirstPoint(); return iErr;
if (!bHasFirstPoint) {
iErr=5;
return iErr;
}
//
aV1=aDomain.FirstPoint().Parameter();
//
bHasSecondPoint=aDomain.HasSecondPoint();
if (!bHasSecondPoint) {
iErr=6;
return iErr;
}
//
aV2=aDomain.SecondPoint().Parameter();
//
aVx=IntTools_Tools::IntermediatePoint(aV1, aV2);
//
break;
} }
// //
i=1;
const HatchGen_Domain& aDomain=aHatcher.Domain (aIx, i) ;
bHasFirstPoint=aDomain.HasFirstPoint();
if (!bHasFirstPoint) {
iErr=5;
return iErr;
}
//
aV1=aDomain.FirstPoint().Parameter();
//
bHasSecondPoint=aDomain.HasSecondPoint();
if (!bHasSecondPoint) {
iErr=6;
return iErr;
}
//
aV2=aDomain.SecondPoint().Parameter();
//
aVx=IntTools_Tools::IntermediatePoint(aV1, aV2);
//
aS->D0(aUx, aVx, aPx); aS->D0(aUx, aVx, aPx);
// //
theP2D.SetCoord(aUx, aVx); theP2D.SetCoord(aUx, aVx);

View File

@ -90,7 +90,6 @@ GEOMAlgo_GlueDetector::GEOMAlgo_GlueDetector()
//======================================================================= //=======================================================================
GEOMAlgo_GlueDetector::~GEOMAlgo_GlueDetector() GEOMAlgo_GlueDetector::~GEOMAlgo_GlueDetector()
{} {}
//modified by NIZNHY-PKV Tue Mar 13 12:26:50 2012f
//======================================================================= //=======================================================================
//function : StickedShapes //function : StickedShapes
//purpose : //purpose :
@ -100,7 +99,6 @@ const TopTools_IndexedDataMapOfShapeListOfShape&
{ {
return myStickedShapes; return myStickedShapes;
} }
//modified by NIZNHY-PKV Tue Mar 13 12:26:54 2012t
//======================================================================= //=======================================================================
//function : Perform //function : Perform
//purpose : //purpose :
@ -124,12 +122,10 @@ void GEOMAlgo_GlueDetector::Perform()
return; return;
} }
// //
//modified by NIZNHY-PKV Wed Mar 14 08:00:09 2012f
CheckDetected(); CheckDetected();
if (myErrorStatus) { if (myErrorStatus) {
return; return;
} }
//modified by NIZNHY-PKV Wed Mar 14 08:00:12 2012t
// //
DetectEdges(); DetectEdges();
if (myErrorStatus) { if (myErrorStatus) {
@ -206,7 +202,7 @@ void GEOMAlgo_GlueDetector::DetectVertices()
TColStd_MapIteratorOfMapOfInteger aIt1; TColStd_MapIteratorOfMapOfInteger aIt1;
// //
aMIP.Add(i); aMIP.Add(i);
while(1) { for(;;) {
aNbIP=aMIP.Extent(); aNbIP=aMIP.Extent();
aIt1.Initialize(aMIP); aIt1.Initialize(aMIP);
for(; aIt1.More(); aIt1.Next()) { for(; aIt1.More(); aIt1.Next()) {
@ -460,7 +456,6 @@ void GEOMAlgo_GlueDetector::EdgePassKey(const TopoDS_Edge& aE,
// //
aPK.SetShapes(aLV); aPK.SetShapes(aLV);
} }
//modified by NIZNHY-PKV Tue Mar 13 09:54:18 2012f
//======================================================================= //=======================================================================
//function : CheckDetected //function : CheckDetected
//purpose : //purpose :
@ -607,4 +602,3 @@ Standard_Integer CheckAncesstors
// //
return iRet; return iRet;
} }
//modified by NIZNHY-PKV Tue Mar 13 09:54:59 2012t

189
src/GEOMAlgo/GEOMAlgo_Gluer.cxx Executable file → Normal file
View File

@ -20,10 +20,10 @@
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
// File: GEOMAlgo_Gluer.cxx // File: GEOMAlgo_Gluer.cxx
// Created: Sat Dec 04 12:45:53 2004 // Created: Sat Dec 04 12:45:53 2004
// Author: Peter KURNEV // Author: Peter KURNEV
// <peter@PREFEX> // <peter@PREFEX>
// //
#include <GEOMAlgo_Gluer.hxx> #include <GEOMAlgo_Gluer.hxx>
@ -100,7 +100,7 @@
// //
static static
void GetSubShapes(const TopoDS_Shape& aS, void GetSubShapes(const TopoDS_Shape& aS,
TopTools_IndexedMapOfShape& aMSS); TopTools_IndexedMapOfShape& aMSS);
//======================================================================= //=======================================================================
//function : GEOMAlgo_Gluer //function : GEOMAlgo_Gluer
@ -228,10 +228,7 @@ void GEOMAlgo_Gluer::MakeVertices()
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItIm; TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItIm;
TopTools_DataMapOfShapeListOfShape aMVV; TopTools_DataMapOfShapeListOfShape aMVV;
GEOMAlgo_IndexedDataMapOfIntegerShape aMIS; GEOMAlgo_IndexedDataMapOfIntegerShape aMIS;
//modified by NIZNHY-PKV Thu Jan 21 10:03:07 2010f
//GEOMAlgo_IndexedDataMapOfShapeBox aMSB;
GEOMAlgo_IndexedDataMapOfShapeBndSphere aMSB; GEOMAlgo_IndexedDataMapOfShapeBndSphere aMSB;
//modified by NIZNHY-PKV Thu Jan 21 10:03:10 2010t
// //
GEOMAlgo_BndSphereTreeSelector aSelector; GEOMAlgo_BndSphereTreeSelector aSelector;
GEOMAlgo_BndSphereTree aBBTree; GEOMAlgo_BndSphereTree aBBTree;
@ -278,57 +275,54 @@ void GEOMAlgo_Gluer::MakeVertices()
TColStd_MapIteratorOfMapOfInteger aIt1; TColStd_MapIteratorOfMapOfInteger aIt1;
// //
aMIP.Add(i); aMIP.Add(i);
while(1) { for(;;) {
aNbIP=aMIP.Extent(); aNbIP=aMIP.Extent();
aIt1.Initialize(aMIP); aIt1.Initialize(aMIP);
for(; aIt1.More(); aIt1.Next()) { for(; aIt1.More(); aIt1.Next()) {
aIP=aIt1.Key(); aIP=aIt1.Key();
if (aMIPC.Contains(aIP)) { if (aMIPC.Contains(aIP)) {
continue; continue;
} }
// //
const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP); const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
//modified by NIZNHY-PKV Thu Jan 21 10:04:09 2010f const GEOMAlgo_BndSphere& aBoxVP=aMSB.FindFromKey(aVP);
const GEOMAlgo_BndSphere& aBoxVP=aMSB.FindFromKey(aVP); //
//const Bnd_Box& aBoxVP=aMSB.FindFromKey(aVP); aSelector.Clear();
//modified by NIZNHY-PKV Thu Jan 21 10:04:11 2010t aSelector.SetBox(aBoxVP);
// //
aSelector.Clear(); aNbVSD=aBBTree.Select(aSelector);
aSelector.SetBox(aBoxVP); if (!aNbVSD) {
// continue; // it must not be
aNbVSD=aBBTree.Select(aSelector); }
if (!aNbVSD) { //
continue; // it must not be const TColStd_ListOfInteger& aLI=aSelector.Indices();
} //
// aIt.Initialize(aLI);
const TColStd_ListOfInteger& aLI=aSelector.Indices(); for (; aIt.More(); aIt.Next()) {
// aIP1=aIt.Value();
aIt.Initialize(aLI); if (aMIP.Contains(aIP1)) {
for (; aIt.More(); aIt.Next()) { continue;
aIP1=aIt.Value(); }
if (aMIP.Contains(aIP1)) { aMIP1.Add(aIP1);
continue; } //for (; aIt.More(); aIt.Next()) {
}
aMIP1.Add(aIP1);
} //for (; aIt.More(); aIt.Next()) {
}//for(; aIt1.More(); aIt1.Next()) { }//for(; aIt1.More(); aIt1.Next()) {
// //
aNbIP1=aMIP1.Extent(); aNbIP1=aMIP1.Extent();
if (!aNbIP1) { if (!aNbIP1) {
break; break;
} }
// //
aIt1.Initialize(aMIP); aIt1.Initialize(aMIP);
for(; aIt1.More(); aIt1.Next()) { for(; aIt1.More(); aIt1.Next()) {
aIP=aIt1.Key(); aIP=aIt1.Key();
aMIPC.Add(aIP); aMIPC.Add(aIP);
} }
// //
aMIP.Clear(); aMIP.Clear();
aIt1.Initialize(aMIP1); aIt1.Initialize(aMIP1);
for(; aIt1.More(); aIt1.Next()) { for(; aIt1.More(); aIt1.Next()) {
aIP=aIt1.Key(); aIP=aIt1.Key();
aMIP.Add(aIP); aMIP.Add(aIP);
} }
aMIP1.Clear(); aMIP1.Clear();
}// while(1) }// while(1)
@ -344,13 +338,13 @@ void GEOMAlgo_Gluer::MakeVertices()
else { // SD vertices founded [ aMIPC ] else { // SD vertices founded [ aMIPC ]
aIt1.Initialize(aMIPC); aIt1.Initialize(aMIPC);
for(j=0; aIt1.More(); aIt1.Next(), ++j) { for(j=0; aIt1.More(); aIt1.Next(), ++j) {
aIP=aIt1.Key(); aIP=aIt1.Key();
const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP); const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
if (!j) { if (!j) {
aVF=aVP; aVF=aVP;
} }
aLVSD.Append(aVP); aLVSD.Append(aVP);
aMVProcessed.Add(aVP); aMVProcessed.Add(aVP);
} }
} }
myImages.Bind(aVF, aLVSD); myImages.Bind(aVF, aLVSD);
@ -395,7 +389,7 @@ void GEOMAlgo_Gluer::MakeVertices()
for (; aItS.More(); aItS.Next()) { for (; aItS.More(); aItS.Next()) {
const TopoDS_Shape& aVSD=aItS.Value(); const TopoDS_Shape& aVSD=aItS.Value();
if (!myOrigins.IsBound(aVSD)) { if (!myOrigins.IsBound(aVSD)) {
myOrigins.Bind(aVSD, aV); myOrigins.Bind(aVSD, aV);
} }
} }
} }
@ -468,7 +462,8 @@ void GEOMAlgo_Gluer::MakeSubShapes (const TopoDS_Shape& theShape,
aER.Orientation(TopAbs_FORWARD); aER.Orientation(TopAbs_FORWARD);
if (!BRep_Tool::Degenerated(aER)) { if (!BRep_Tool::Degenerated(aER)) {
// orient image // orient image
Standard_Boolean bIsToReverse=GEOMAlgo_AlgoTools::IsSplitToReverse(aER, aE, myContext); Standard_Boolean bIsToReverse=
GEOMAlgo_AlgoTools::IsSplitToReverse(aER, aE, myContext);
if (bIsToReverse) { if (bIsToReverse) {
aER.Reverse(); aER.Reverse();
} }
@ -490,8 +485,7 @@ void GEOMAlgo_Gluer::MakeSubShapes (const TopoDS_Shape& theShape,
aBB.Add(theResult, aShapeR); aBB.Add(theResult, aShapeR);
} }
} }
else else {
{
if (myKeepNonSolids) { if (myKeepNonSolids) {
// just add image // just add image
const TopoDS_Shape& aShapeR = myOrigins.Find(theShape); const TopoDS_Shape& aShapeR = myOrigins.Find(theShape);
@ -554,12 +548,12 @@ void GEOMAlgo_Gluer::MakeShells()
const TopoDS_Face& aF=TopoDS::Face(aExp.Current()); const TopoDS_Face& aF=TopoDS::Face(aExp.Current());
aFR=TopoDS::Face(myOrigins.Find(aF)); aFR=TopoDS::Face(myOrigins.Find(aF));
if (aFR.IsSame(aF)) { if (aFR.IsSame(aF)) {
aBB.Add(aNewShell, aF); aBB.Add(aNewShell, aF);
continue; continue;
} }
bIsToReverse=IsToReverse(aFR, aF); bIsToReverse=IsToReverse(aFR, aF);
if (bIsToReverse) { if (bIsToReverse) {
aFR.Reverse(); aFR.Reverse();
} }
aBB.Add(aNewShell, aFR); aBB.Add(aNewShell, aFR);
} }
@ -660,25 +654,25 @@ void GEOMAlgo_Gluer::MakeShapes(const TopAbs_ShapeEnum aType)
if (aNbSDF==1) { if (aNbSDF==1) {
bHasNewSubShape=HasNewSubShape(aS1); bHasNewSubShape=HasNewSubShape(aS1);
if (!bHasNewSubShape) { if (!bHasNewSubShape) {
aNewShape=aS1; aNewShape=aS1;
aNewShape.Orientation(TopAbs_FORWARD); aNewShape.Orientation(TopAbs_FORWARD);
} }
} }
// //
if (bHasNewSubShape) { if (bHasNewSubShape) {
if (aType==TopAbs_FACE) { if (aType==TopAbs_FACE) {
TopoDS_Face aNewFace; TopoDS_Face aNewFace;
// //
const TopoDS_Face& aF1=TopoDS::Face(aS1); const TopoDS_Face& aF1=TopoDS::Face(aS1);
MakeFace(aF1, aNewFace); MakeFace(aF1, aNewFace);
aNewShape=aNewFace; aNewShape=aNewFace;
} }
else if (aType==TopAbs_EDGE) { else if (aType==TopAbs_EDGE) {
TopoDS_Edge aNewEdge; TopoDS_Edge aNewEdge;
// //
const TopoDS_Edge& aE1=TopoDS::Edge(aS1); const TopoDS_Edge& aE1=TopoDS::Edge(aS1);
MakeEdge(aE1, aNewEdge); MakeEdge(aE1, aNewEdge);
aNewShape=aNewEdge; aNewShape=aNewEdge;
} }
} }
// //
@ -688,7 +682,7 @@ void GEOMAlgo_Gluer::MakeShapes(const TopAbs_ShapeEnum aType)
for (; aItS.More(); aItS.Next()) { for (; aItS.More(); aItS.Next()) {
const TopoDS_Shape& aFSD=aItS.Value(); const TopoDS_Shape& aFSD=aItS.Value();
if (!myOrigins.IsBound(aFSD)) { if (!myOrigins.IsBound(aFSD)) {
myOrigins.Bind(aFSD, aNewShape); myOrigins.Bind(aFSD, aNewShape);
} }
} }
} }
@ -728,12 +722,12 @@ void GEOMAlgo_Gluer::CheckResult()
for (j=1; j<=aNbFS; ++j) { for (j=1; j<=aNbFS; ++j) {
const TopoDS_Shape& aFS=aMFS(j); const TopoDS_Shape& aFS=aMFS(j);
if (aMFR.Contains(aFS)) { if (aMFR.Contains(aFS)) {
const TopTools_ListOfShape& aLSx=aMFR.FindFromKey(aFS); const TopTools_ListOfShape& aLSx=aMFR.FindFromKey(aFS);
aNbSx=aLSx.Extent(); aNbSx=aLSx.Extent();
if (aNbSx==2) { if (aNbSx==2) {
bFound=!bFound; bFound=!bFound;
break; break;
} }
} }
} }
// //
@ -795,7 +789,7 @@ void GEOMAlgo_Gluer::InnerTolerance()
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_Gluer::FacePassKey(const TopoDS_Face& aF, void GEOMAlgo_Gluer::FacePassKey(const TopoDS_Face& aF,
GEOMAlgo_PassKeyShape& aPK) GEOMAlgo_PassKeyShape& aPK)
{ {
Standard_Integer i, aNbE; Standard_Integer i, aNbE;
TopTools_ListOfShape aLE; TopTools_ListOfShape aLE;
@ -820,7 +814,7 @@ void GEOMAlgo_Gluer::FacePassKey(const TopoDS_Face& aF,
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_Gluer::EdgePassKey(const TopoDS_Edge& aE, void GEOMAlgo_Gluer::EdgePassKey(const TopoDS_Edge& aE,
GEOMAlgo_PassKeyShape& aPK) GEOMAlgo_PassKeyShape& aPK)
{ {
TopoDS_Vertex aV1, aV2; TopoDS_Vertex aV1, aV2;
// //
@ -839,7 +833,7 @@ void GEOMAlgo_Gluer::EdgePassKey(const TopoDS_Edge& aE,
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_Gluer::MakeVertex(const TopTools_ListOfShape& aLV, void GEOMAlgo_Gluer::MakeVertex(const TopTools_ListOfShape& aLV,
TopoDS_Vertex& aNewVertex) TopoDS_Vertex& aNewVertex)
{ {
Standard_Integer aNbV; Standard_Integer aNbV;
Standard_Real aTolV, aD, aDmax; Standard_Real aTolV, aD, aDmax;
@ -885,7 +879,7 @@ void GEOMAlgo_Gluer::MakeVertex(const TopTools_ListOfShape& aLV,
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_Gluer::MakeEdge(const TopoDS_Edge& aE, void GEOMAlgo_Gluer::MakeEdge(const TopoDS_Edge& aE,
TopoDS_Edge& aNewEdge) TopoDS_Edge& aNewEdge)
{ {
myErrorStatus=0; myErrorStatus=0;
// //
@ -939,7 +933,7 @@ void GEOMAlgo_Gluer::MakeEdge(const TopoDS_Edge& aE,
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_Gluer::MakeFace(const TopoDS_Face& aF, void GEOMAlgo_Gluer::MakeFace(const TopoDS_Face& aF,
TopoDS_Face& aNewFace) TopoDS_Face& aNewFace)
{ {
myErrorStatus=0; myErrorStatus=0;
// //
@ -975,20 +969,20 @@ void GEOMAlgo_Gluer::MakeFace(const TopoDS_Face& aF,
// //
aER.Orientation(TopAbs_FORWARD); aER.Orientation(TopAbs_FORWARD);
if (!BRep_Tool::Degenerated(aER)) { if (!BRep_Tool::Degenerated(aER)) {
// build p-curve // build p-curve
if (bIsUPeriodic) { if (bIsUPeriodic) {
GEOMAlgo_AlgoTools::RefinePCurveForEdgeOnFace(aER, aFFWD, aUMin, aUMax); GEOMAlgo_AlgoTools::RefinePCurveForEdgeOnFace(aER, aFFWD, aUMin, aUMax);
} }
BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace(aER, aFFWD); BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace(aER, aFFWD);
// orient image // orient image
bIsToReverse=GEOMAlgo_AlgoTools::IsSplitToReverse(aER, aE, myContext); bIsToReverse=GEOMAlgo_AlgoTools::IsSplitToReverse(aER, aE, myContext);
if (bIsToReverse) { if (bIsToReverse) {
aER.Reverse(); aER.Reverse();
} }
} }
else { else {
aER.Orientation(aE.Orientation()); aER.Orientation(aE.Orientation());
} }
// //
aBB.Add(newWire, aER); aBB.Add(newWire, aER);
@ -1009,7 +1003,7 @@ void GEOMAlgo_Gluer::MakeFace(const TopoDS_Face& aF,
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean GEOMAlgo_Gluer::IsToReverse(const TopoDS_Face& aFR, Standard_Boolean GEOMAlgo_Gluer::IsToReverse(const TopoDS_Face& aFR,
const TopoDS_Face& aF) const TopoDS_Face& aF)
{ {
Standard_Boolean bRet; Standard_Boolean bRet;
Standard_Real aT, aT1, aT2, aTR, aScPr; Standard_Real aT, aT1, aT2, aTR, aScPr;
@ -1088,7 +1082,7 @@ Standard_Boolean GEOMAlgo_Gluer::HasNewSubShape(const TopoDS_Shape& aS)const
//purpose : //purpose :
//======================================================================= //=======================================================================
void GetSubShapes(const TopoDS_Shape& aS, void GetSubShapes(const TopoDS_Shape& aS,
TopTools_IndexedMapOfShape& aMSS) TopTools_IndexedMapOfShape& aMSS)
{ {
Standard_Integer aR; Standard_Integer aR;
TopAbs_ShapeEnum aType; TopAbs_ShapeEnum aType;
@ -1111,7 +1105,8 @@ void GetSubShapes(const TopoDS_Shape& aS,
//function : Modified //function : Modified
//purpose : //purpose :
//======================================================================= //=======================================================================
const TopTools_ListOfShape& GEOMAlgo_Gluer::Modified (const TopoDS_Shape& aS) const TopTools_ListOfShape& GEOMAlgo_Gluer::Modified
(const TopoDS_Shape& aS)
{ {
TopAbs_ShapeEnum aType; TopAbs_ShapeEnum aType;
// //
@ -1127,7 +1122,7 @@ const TopTools_ListOfShape& GEOMAlgo_Gluer::Modified (const TopoDS_Shape& aS)
if(myOrigins.IsBound(aS)) { if(myOrigins.IsBound(aS)) {
const TopoDS_Shape& aSnew=myOrigins.Find(aS); const TopoDS_Shape& aSnew=myOrigins.Find(aS);
if (!aSnew.IsSame(aS)) { if (!aSnew.IsSame(aS)) {
myGenerated.Append(aSnew); myGenerated.Append(aSnew);
} }
} }
} }

View File

@ -84,11 +84,8 @@ void GEOMAlgo_Gluer2::Clear()
myImagesToWork.Clear(); myImagesToWork.Clear();
myOriginsToWork.Clear(); myOriginsToWork.Clear();
myKeepNonSolids=Standard_False; myKeepNonSolids=Standard_False;
//modified by NIZNHY-PKV Tue Mar 13 13:38:28 2012f
myDetector.Clear(); myDetector.Clear();
//modified by NIZNHY-PKV Tue Mar 13 13:38:30 2012t
} }
//modified by NIZNHY-PKV Tue Mar 13 12:26:50 2012f
//======================================================================= //=======================================================================
//function : StickedShapes //function : StickedShapes
//purpose : //purpose :
@ -98,12 +95,12 @@ const TopTools_IndexedDataMapOfShapeListOfShape&
{ {
return myDetector.StickedShapes(); return myDetector.StickedShapes();
} }
//modified by NIZNHY-PKV Tue Mar 13 12:26:54 2012t
//======================================================================= //=======================================================================
//function : SetShapesToGlue //function : SetShapesToGlue
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_Gluer2::SetShapesToGlue(const TopTools_DataMapOfShapeListOfShape& aM) void GEOMAlgo_Gluer2::SetShapesToGlue
(const TopTools_DataMapOfShapeListOfShape& aM)
{ {
myShapesToGlue=aM; myShapesToGlue=aM;
} }
@ -241,6 +238,7 @@ void GEOMAlgo_Gluer2::CheckData()
myWarningStatus=0; myWarningStatus=0;
// //
aNbSG=myShapesToGlue.Extent(); aNbSG=myShapesToGlue.Extent();
aType=TopAbs_SHAPE;
if (aNbSG) { if (aNbSG) {
// Check myShapesToGlue // Check myShapesToGlue
aItDMSLS.Initialize(myShapesToGlue); aItDMSLS.Initialize(myShapesToGlue);
@ -587,6 +585,7 @@ void GEOMAlgo_Gluer2::BuildResult()
myErrorStatus=0; myErrorStatus=0;
myWarningStatus=0; myWarningStatus=0;
// //
bHasImage=Standard_False;
aItC.Initialize(myArgument); aItC.Initialize(myArgument);
for (; aItC.More(); aItC.Next()) { for (; aItC.More(); aItC.Next()) {
const TopoDS_Shape& aCx=aItC.Value(); const TopoDS_Shape& aCx=aItC.Value();

View File

@ -0,0 +1,37 @@
// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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
//
//GEOMAlgo_KindOfDef
#ifndef _GEOMAlgo_KindOfDef_HeaderFile
#define _GEOMAlgo_KindOfDef_HeaderFile
enum GEOMAlgo_KindOfDef {
GEOMAlgo_KD_UNKNOWN,
GEOMAlgo_KD_SPECIFIED,
GEOMAlgo_KD_ARBITRARY
};
#ifndef _Standard_PrimitiveTypes_HeaderFile
#include <Standard_PrimitiveTypes.hxx>
#endif
#endif

View File

@ -44,7 +44,8 @@ GEOMAlgo_KN_DISKELLIPSE,
GEOMAlgo_KN_RECTANGLE, GEOMAlgo_KN_RECTANGLE,
GEOMAlgo_KN_TRIANGLE, GEOMAlgo_KN_TRIANGLE,
GEOMAlgo_KN_QUADRANGLE, GEOMAlgo_KN_QUADRANGLE,
GEOMAlgo_KN_ARCELLIPSE GEOMAlgo_KN_ARCELLIPSE,
GEOMAlgo_KN_SOLID
}; };
#ifndef _Standard_PrimitiveTypes_HeaderFile #ifndef _Standard_PrimitiveTypes_HeaderFile

View File

@ -35,9 +35,7 @@ GEOMAlgo_KS_PLANE,
GEOMAlgo_KS_CIRCLE, GEOMAlgo_KS_CIRCLE,
GEOMAlgo_KS_LINE, GEOMAlgo_KS_LINE,
GEOMAlgo_KS_DEGENERATED, GEOMAlgo_KS_DEGENERATED,
//modified by NIZNHY-PKV Tue Jul 03 10:28:09 2012f
GEOMAlgo_KS_BSPLINE GEOMAlgo_KS_BSPLINE
//modified by NIZNHY-PKV Tue Jul 03 10:28:11 2012t
}; };
#ifndef _Standard_PrimitiveTypes_HeaderFile #ifndef _Standard_PrimitiveTypes_HeaderFile

View File

@ -29,6 +29,8 @@ static
void DumpKindOfBounds(const GEOMAlgo_KindOfBounds aKB); void DumpKindOfBounds(const GEOMAlgo_KindOfBounds aKB);
static static
void DumpKindOfName(const GEOMAlgo_KindOfName aKS); void DumpKindOfName(const GEOMAlgo_KindOfName aKS);
static
void DumpKindOfDef(const GEOMAlgo_KindOfDef aKD);
static static
void DumpPosition(const gp_Ax3& aAx3); void DumpPosition(const gp_Ax3& aAx3);
static static
@ -39,7 +41,7 @@ static
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
GEOMAlgo_ShapeInfo::GEOMAlgo_ShapeInfo() GEOMAlgo_ShapeInfo::GEOMAlgo_ShapeInfo()
{ {
Reset(); Reset();
} }
@ -47,14 +49,14 @@ static
//function : ~ //function : ~
//purpose : //purpose :
//======================================================================= //=======================================================================
GEOMAlgo_ShapeInfo::~GEOMAlgo_ShapeInfo() GEOMAlgo_ShapeInfo::~GEOMAlgo_ShapeInfo()
{ {
} }
//======================================================================= //=======================================================================
//function : Reset //function : Reset
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfo::Reset() void GEOMAlgo_ShapeInfo::Reset()
{ {
Standard_Integer i; Standard_Integer i;
// //
@ -69,6 +71,7 @@ static
myKindOfBounds=GEOMAlgo_KB_UNKNOWN; myKindOfBounds=GEOMAlgo_KB_UNKNOWN;
myKindOfClosed=GEOMAlgo_KC_UNKNOWN; myKindOfClosed=GEOMAlgo_KC_UNKNOWN;
myKindOfName=GEOMAlgo_KN_UNKNOWN; myKindOfName=GEOMAlgo_KN_UNKNOWN;
myKindOfDef=GEOMAlgo_KD_UNKNOWN;
// //
myLocation.SetCoord(99., 99., 99.); myLocation.SetCoord(99., 99., 99.);
myDirection.SetCoord(1.,0.,0.); myDirection.SetCoord(1.,0.,0.);
@ -83,7 +86,7 @@ static
//function : SetType //function : SetType
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfo::SetType(const TopAbs_ShapeEnum aType) void GEOMAlgo_ShapeInfo::SetType(const TopAbs_ShapeEnum aType)
{ {
myType=aType; myType=aType;
} }
@ -91,7 +94,7 @@ static
//function : Type //function : Type
//purpose : //purpose :
//======================================================================= //=======================================================================
TopAbs_ShapeEnum GEOMAlgo_ShapeInfo::Type() const TopAbs_ShapeEnum GEOMAlgo_ShapeInfo::Type() const
{ {
return myType; return myType;
} }
@ -99,8 +102,8 @@ static
//function : SetNbSubShapes //function : SetNbSubShapes
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfo::SetNbSubShapes(const TopAbs_ShapeEnum aType, void GEOMAlgo_ShapeInfo::SetNbSubShapes(const TopAbs_ShapeEnum aType,
const Standard_Integer aNb) const Standard_Integer aNb)
{ {
Standard_Integer iN; Standard_Integer iN;
@ -113,7 +116,8 @@ static
//function : NbSubShapes //function : NbSubShapes
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Integer GEOMAlgo_ShapeInfo::NbSubShapes(const TopAbs_ShapeEnum aType) const Standard_Integer GEOMAlgo_ShapeInfo::NbSubShapes
(const TopAbs_ShapeEnum aType) const
{ {
Standard_Integer iN; Standard_Integer iN;
@ -127,7 +131,7 @@ static
//function : SetKindOfShape //function : SetKindOfShape
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfo::SetKindOfShape(const GEOMAlgo_KindOfShape aT) void GEOMAlgo_ShapeInfo::SetKindOfShape(const GEOMAlgo_KindOfShape aT)
{ {
myKindOfShape=aT; myKindOfShape=aT;
} }
@ -135,7 +139,7 @@ static
//function : KindOfShape //function : KindOfShape
//purpose : //purpose :
//======================================================================= //=======================================================================
GEOMAlgo_KindOfShape GEOMAlgo_ShapeInfo::KindOfShape() const GEOMAlgo_KindOfShape GEOMAlgo_ShapeInfo::KindOfShape() const
{ {
return myKindOfShape; return myKindOfShape;
} }
@ -143,7 +147,7 @@ static
//function : SetKindOfName //function : SetKindOfName
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfo::SetKindOfName(const GEOMAlgo_KindOfName aT) void GEOMAlgo_ShapeInfo::SetKindOfName(const GEOMAlgo_KindOfName aT)
{ {
myKindOfName=aT; myKindOfName=aT;
} }
@ -151,7 +155,7 @@ static
//function : KindOfName //function : KindOfName
//purpose : //purpose :
//======================================================================= //=======================================================================
GEOMAlgo_KindOfName GEOMAlgo_ShapeInfo::KindOfName() const GEOMAlgo_KindOfName GEOMAlgo_ShapeInfo::KindOfName() const
{ {
return myKindOfName; return myKindOfName;
} }
@ -159,7 +163,7 @@ static
//function : SetKindOfBounds //function : SetKindOfBounds
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfo::SetKindOfBounds(const GEOMAlgo_KindOfBounds aT) void GEOMAlgo_ShapeInfo::SetKindOfBounds(const GEOMAlgo_KindOfBounds aT)
{ {
myKindOfBounds=aT; myKindOfBounds=aT;
} }
@ -167,7 +171,7 @@ static
//function : KindOfBounds //function : KindOfBounds
//purpose : //purpose :
//======================================================================= //=======================================================================
GEOMAlgo_KindOfBounds GEOMAlgo_ShapeInfo::KindOfBounds() const GEOMAlgo_KindOfBounds GEOMAlgo_ShapeInfo::KindOfBounds() const
{ {
return myKindOfBounds; return myKindOfBounds;
} }
@ -175,7 +179,7 @@ static
//function : SetKindOfClosed //function : SetKindOfClosed
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfo::SetKindOfClosed(const GEOMAlgo_KindOfClosed aT) void GEOMAlgo_ShapeInfo::SetKindOfClosed(const GEOMAlgo_KindOfClosed aT)
{ {
myKindOfClosed=aT; myKindOfClosed=aT;
} }
@ -183,15 +187,31 @@ static
//function : KindOfClosed //function : KindOfClosed
//purpose : //purpose :
//======================================================================= //=======================================================================
GEOMAlgo_KindOfClosed GEOMAlgo_ShapeInfo::KindOfClosed() const GEOMAlgo_KindOfClosed GEOMAlgo_ShapeInfo::KindOfClosed() const
{ {
return myKindOfClosed; return myKindOfClosed;
} }
//======================================================================= //=======================================================================
//function : SetKindOfDef
//purpose :
//=======================================================================
void GEOMAlgo_ShapeInfo::SetKindOfDef(const GEOMAlgo_KindOfDef aT)
{
myKindOfDef=aT;
}
//=======================================================================
//function : KindOfDef
//purpose :
//=======================================================================
GEOMAlgo_KindOfDef GEOMAlgo_ShapeInfo::KindOfDef() const
{
return myKindOfDef;
}
//=======================================================================
//function : SetLocation //function : SetLocation
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfo::SetLocation(const gp_Pnt& aP) void GEOMAlgo_ShapeInfo::SetLocation(const gp_Pnt& aP)
{ {
myLocation=aP; myLocation=aP;
} }
@ -199,7 +219,7 @@ static
//function : Location //function : Location
//purpose : //purpose :
//======================================================================= //=======================================================================
const gp_Pnt& GEOMAlgo_ShapeInfo::Location() const const gp_Pnt& GEOMAlgo_ShapeInfo::Location() const
{ {
return myLocation; return myLocation;
} }
@ -207,7 +227,7 @@ static
//function : SetDirection //function : SetDirection
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfo::SetDirection(const gp_Dir& aD) void GEOMAlgo_ShapeInfo::SetDirection(const gp_Dir& aD)
{ {
myDirection=aD; myDirection=aD;
} }
@ -215,7 +235,7 @@ static
//function : Direction //function : Direction
//purpose : //purpose :
//======================================================================= //=======================================================================
const gp_Dir& GEOMAlgo_ShapeInfo::Direction() const const gp_Dir& GEOMAlgo_ShapeInfo::Direction() const
{ {
return myDirection; return myDirection;
} }
@ -223,7 +243,7 @@ static
//function : SetPosition //function : SetPosition
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfo::SetPosition(const gp_Ax2& aAx2) void GEOMAlgo_ShapeInfo::SetPosition(const gp_Ax2& aAx2)
{ {
gp_Ax3 aAx3(aAx2); gp_Ax3 aAx3(aAx2);
SetPosition(aAx3); SetPosition(aAx3);
@ -232,7 +252,7 @@ static
//function : SetPosition //function : SetPosition
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfo::SetPosition(const gp_Ax3& aAx3) void GEOMAlgo_ShapeInfo::SetPosition(const gp_Ax3& aAx3)
{ {
myPosition=aAx3; myPosition=aAx3;
} }
@ -240,7 +260,7 @@ static
//function : Position //function : Position
//purpose : //purpose :
//======================================================================= //=======================================================================
const gp_Ax3& GEOMAlgo_ShapeInfo::Position() const const gp_Ax3& GEOMAlgo_ShapeInfo::Position() const
{ {
return myPosition; return myPosition;
} }
@ -249,7 +269,7 @@ static
//function : SetPnt1 //function : SetPnt1
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfo::SetPnt1(const gp_Pnt& aP) void GEOMAlgo_ShapeInfo::SetPnt1(const gp_Pnt& aP)
{ {
myPnt1=aP; myPnt1=aP;
} }
@ -257,7 +277,7 @@ static
//function : Pnt1 //function : Pnt1
//purpose : //purpose :
//======================================================================= //=======================================================================
const gp_Pnt& GEOMAlgo_ShapeInfo::Pnt1() const const gp_Pnt& GEOMAlgo_ShapeInfo::Pnt1() const
{ {
return myPnt1; return myPnt1;
} }
@ -265,7 +285,7 @@ static
//function : SetPnt2 //function : SetPnt2
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfo::SetPnt2(const gp_Pnt& aP) void GEOMAlgo_ShapeInfo::SetPnt2(const gp_Pnt& aP)
{ {
myPnt2=aP; myPnt2=aP;
} }
@ -273,7 +293,7 @@ static
//function : Pnt2 //function : Pnt2
//purpose : //purpose :
//======================================================================= //=======================================================================
const gp_Pnt& GEOMAlgo_ShapeInfo::Pnt2() const const gp_Pnt& GEOMAlgo_ShapeInfo::Pnt2() const
{ {
return myPnt2; return myPnt2;
} }
@ -281,7 +301,7 @@ static
//function : SetRadius1 //function : SetRadius1
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfo::SetRadius1(const Standard_Real aR) void GEOMAlgo_ShapeInfo::SetRadius1(const Standard_Real aR)
{ {
myRadius1=aR; myRadius1=aR;
} }
@ -289,7 +309,7 @@ static
//function : Radius1 //function : Radius1
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Real GEOMAlgo_ShapeInfo::Radius1() const Standard_Real GEOMAlgo_ShapeInfo::Radius1() const
{ {
return myRadius1; return myRadius1;
} }
@ -297,7 +317,7 @@ static
//function : SetRadius2 //function : SetRadius2
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfo::SetRadius2(const Standard_Real aR) void GEOMAlgo_ShapeInfo::SetRadius2(const Standard_Real aR)
{ {
myRadius2=aR; myRadius2=aR;
} }
@ -305,7 +325,7 @@ static
//function : Radius2 //function : Radius2
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Real GEOMAlgo_ShapeInfo::Radius2() const Standard_Real GEOMAlgo_ShapeInfo::Radius2() const
{ {
return myRadius2; return myRadius2;
} }
@ -313,7 +333,7 @@ static
//function : SetLength //function : SetLength
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfo::SetLength(const Standard_Real aL) void GEOMAlgo_ShapeInfo::SetLength(const Standard_Real aL)
{ {
myLength=aL; myLength=aL;
} }
@ -321,7 +341,7 @@ static
//function : Length //function : Length
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Real GEOMAlgo_ShapeInfo::Length() const Standard_Real GEOMAlgo_ShapeInfo::Length() const
{ {
return myLength; return myLength;
} }
@ -329,7 +349,7 @@ static
//function : SetWidth //function : SetWidth
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfo::SetWidth(const Standard_Real aW) void GEOMAlgo_ShapeInfo::SetWidth(const Standard_Real aW)
{ {
myWidth=aW; myWidth=aW;
} }
@ -337,7 +357,7 @@ static
//function : Width //function : Width
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Real GEOMAlgo_ShapeInfo::Width() const Standard_Real GEOMAlgo_ShapeInfo::Width() const
{ {
return myWidth; return myWidth;
} }
@ -345,7 +365,7 @@ static
//function : SetHeight //function : SetHeight
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfo::SetHeight(const Standard_Real aH) void GEOMAlgo_ShapeInfo::SetHeight(const Standard_Real aH)
{ {
myHeight=aH; myHeight=aH;
} }
@ -353,7 +373,7 @@ static
//function : Height //function : Height
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Real GEOMAlgo_ShapeInfo::Height() const Standard_Real GEOMAlgo_ShapeInfo::Height() const
{ {
return myHeight; return myHeight;
} }
@ -372,7 +392,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
//function : Dump //function : Dump
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfo::Dump()const void GEOMAlgo_ShapeInfo::Dump()const
{ {
switch (myType) { switch (myType) {
// //
@ -417,7 +437,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
//function : DumpCompound //function : DumpCompound
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfo::DumpCompound()const void GEOMAlgo_ShapeInfo::DumpCompound()const
{ {
Standard_Integer aNbV, aNbE, aNbF, aNbS, aNbC, aNbP; Standard_Integer aNbV, aNbE, aNbF, aNbS, aNbC, aNbP;
GEOMAlgo_KindOfShape aKS; GEOMAlgo_KindOfShape aKS;
@ -452,7 +472,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
//function : DumpCompSolid //function : DumpCompSolid
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfo::DumpCompSolid()const void GEOMAlgo_ShapeInfo::DumpCompSolid()const
{ {
Standard_Integer aNbV, aNbE, aNbF, aNbS; Standard_Integer aNbV, aNbE, aNbF, aNbS;
GEOMAlgo_KindOfShape aKS; GEOMAlgo_KindOfShape aKS;
@ -479,12 +499,11 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
DumpKindOfBounds(aKB); DumpKindOfBounds(aKB);
DumpKindOfClosed(aKC); DumpKindOfClosed(aKC);
} }
//======================================================================= //=======================================================================
//function : DumpSolid //function : DumpSolid
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfo::DumpSolid()const void GEOMAlgo_ShapeInfo::DumpSolid()const
{ {
Standard_Integer aNbV, aNbE, aNbF; Standard_Integer aNbV, aNbE, aNbF;
GEOMAlgo_KindOfShape aKS; GEOMAlgo_KindOfShape aKS;
@ -545,18 +564,18 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
printf(" Height : %.3lf\n", myHeight); printf(" Height : %.3lf\n", myHeight);
} }
} }
//======================================================================= //=======================================================================
//function : DumpFace //function : DumpFace
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfo::DumpFace()const void GEOMAlgo_ShapeInfo::DumpFace()const
{ {
Standard_Integer aNbV, aNbE; Standard_Integer aNbV, aNbE;
GEOMAlgo_KindOfShape aKS; GEOMAlgo_KindOfShape aKS;
GEOMAlgo_KindOfName aKN; GEOMAlgo_KindOfName aKN;
GEOMAlgo_KindOfBounds aKB; GEOMAlgo_KindOfBounds aKB;
GEOMAlgo_KindOfClosed aKC; GEOMAlgo_KindOfClosed aKC;
GEOMAlgo_KindOfDef aKD;
// //
aNbV=NbSubShapes(TopAbs_VERTEX); aNbV=NbSubShapes(TopAbs_VERTEX);
aNbE=NbSubShapes(TopAbs_EDGE); aNbE=NbSubShapes(TopAbs_EDGE);
@ -564,6 +583,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
aKN=KindOfName(); aKN=KindOfName();
aKB=KindOfBounds(); aKB=KindOfBounds();
aKC=KindOfClosed(); aKC=KindOfClosed();
aKD=KindOfDef();
// //
printf(" *FACE\n"); printf(" *FACE\n");
printf(" number of vertices: %d\n", aNbV); printf(" number of vertices: %d\n", aNbV);
@ -572,6 +592,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
DumpKindOfName (aKN); DumpKindOfName (aKN);
DumpKindOfBounds(aKB); DumpKindOfBounds(aKB);
DumpKindOfClosed(aKC); DumpKindOfClosed(aKC);
DumpKindOfDef(aKD);
// //
// PLANE // PLANE
if (aKN==GEOMAlgo_KN_PLANE) { if (aKN==GEOMAlgo_KN_PLANE) {
@ -641,7 +662,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
//function : DumpShell //function : DumpShell
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfo::DumpShell()const void GEOMAlgo_ShapeInfo::DumpShell()const
{ {
Standard_Integer aNbV, aNbE, aNbF; Standard_Integer aNbV, aNbE, aNbF;
GEOMAlgo_KindOfClosed aKC; GEOMAlgo_KindOfClosed aKC;
@ -662,7 +683,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
//function : DumpWire //function : DumpWire
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfo::DumpWire()const void GEOMAlgo_ShapeInfo::DumpWire()const
{ {
Standard_Integer aNbV, aNbE; Standard_Integer aNbV, aNbE;
GEOMAlgo_KindOfClosed aKC; GEOMAlgo_KindOfClosed aKC;
@ -682,7 +703,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
//function : DumpEdge //function : DumpEdge
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfo::DumpEdge()const void GEOMAlgo_ShapeInfo::DumpEdge()const
{ {
Standard_Integer aNbV; Standard_Integer aNbV;
Standard_Real aX, aY, aZ; Standard_Real aX, aY, aZ;
@ -755,7 +776,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
//function : DumpVertex //function : DumpVertex
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfo::DumpVertex()const void GEOMAlgo_ShapeInfo::DumpVertex()const
{ {
printf(" *VERTEX\n"); printf(" *VERTEX\n");
DumpLocation(myLocation); DumpLocation(myLocation);
@ -764,7 +785,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
//function : DumpLocation //function : DumpLocation
//purpose : //purpose :
//======================================================================= //=======================================================================
void DumpLocation(const gp_Pnt& aP) void DumpLocation(const gp_Pnt& aP)
{ {
Standard_Real aX, aY, aZ; Standard_Real aX, aY, aZ;
// //
@ -775,7 +796,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
//function : DumpDirection //function : DumpDirection
//purpose : //purpose :
//======================================================================= //=======================================================================
void DumpDirection(const gp_Dir& aD) void DumpDirection(const gp_Dir& aD)
{ {
Standard_Real aX, aY, aZ; Standard_Real aX, aY, aZ;
// //
@ -881,10 +902,27 @@ void DumpKindOfName(const GEOMAlgo_KindOfName aKS)
"KN_RECTANGLE", "KN_RECTANGLE",
"KN_TRIANGLE", "KN_TRIANGLE",
"KN_QUADRANGLE", "KN_QUADRANGLE",
"KN_ARCELLIPSE" "KN_ARCELLIPSE",
"KN_SOLID"
}; };
int i; int i;
// //
i=(Standard_Integer)aKS; i=(Standard_Integer)aKS;
printf(" KindOfName : %s\n", pStr[i]); printf(" KindOfName : %s\n", pStr[i]);
} }
//=======================================================================
//function : DumpKindOfDef
//purpose :
//=======================================================================
void DumpKindOfDef(const GEOMAlgo_KindOfDef aKD)
{
const char *pStr[]={
"KD_UNKNOWN",
"KD_SPECIFIED",
"KB_ARBITRARY"
};
int i;
//
i=(Standard_Integer)aKD;
printf(" KindOfDef: %s\n", pStr[i]);
}

View File

@ -37,6 +37,7 @@
#include <GEOMAlgo_KindOfName.hxx> #include <GEOMAlgo_KindOfName.hxx>
#include <GEOMAlgo_KindOfBounds.hxx> #include <GEOMAlgo_KindOfBounds.hxx>
#include <GEOMAlgo_KindOfClosed.hxx> #include <GEOMAlgo_KindOfClosed.hxx>
#include <GEOMAlgo_KindOfDef.hxx>
//======================================================================= //=======================================================================
@ -62,7 +63,8 @@ class GEOMAlgo_ShapeInfo
TopAbs_ShapeEnum Type() const; TopAbs_ShapeEnum Type() const;
Standard_EXPORT Standard_EXPORT
void SetNbSubShapes(const TopAbs_ShapeEnum aType,const Standard_Integer aNb) ; void SetNbSubShapes(const TopAbs_ShapeEnum aType,
const Standard_Integer aNb) ;
Standard_EXPORT Standard_EXPORT
Standard_Integer NbSubShapes(const TopAbs_ShapeEnum aType) const; Standard_Integer NbSubShapes(const TopAbs_ShapeEnum aType) const;
@ -91,6 +93,12 @@ class GEOMAlgo_ShapeInfo
Standard_EXPORT Standard_EXPORT
GEOMAlgo_KindOfClosed KindOfClosed() const; GEOMAlgo_KindOfClosed KindOfClosed() const;
Standard_EXPORT
void SetKindOfDef(const GEOMAlgo_KindOfDef aT) ;
Standard_EXPORT
GEOMAlgo_KindOfDef KindOfDef() const;
Standard_EXPORT Standard_EXPORT
void SetLocation(const gp_Pnt& aP) ; void SetLocation(const gp_Pnt& aP) ;
@ -189,6 +197,7 @@ class GEOMAlgo_ShapeInfo
GEOMAlgo_KindOfName myKindOfName; GEOMAlgo_KindOfName myKindOfName;
GEOMAlgo_KindOfBounds myKindOfBounds; GEOMAlgo_KindOfBounds myKindOfBounds;
GEOMAlgo_KindOfClosed myKindOfClosed; GEOMAlgo_KindOfClosed myKindOfClosed;
GEOMAlgo_KindOfDef myKindOfDef;
gp_Pnt myLocation; gp_Pnt myLocation;
gp_Dir myDirection; gp_Dir myDirection;
gp_Ax3 myPosition; gp_Ax3 myPosition;

View File

@ -59,7 +59,7 @@
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
GEOMAlgo_ShapeInfoFiller::GEOMAlgo_ShapeInfoFiller() GEOMAlgo_ShapeInfoFiller::GEOMAlgo_ShapeInfoFiller()
: :
GEOMAlgo_Algo() GEOMAlgo_Algo()
{ {
@ -69,14 +69,14 @@
//function : ~ //function : ~
//purpose : //purpose :
//======================================================================= //=======================================================================
GEOMAlgo_ShapeInfoFiller::~GEOMAlgo_ShapeInfoFiller() GEOMAlgo_ShapeInfoFiller::~GEOMAlgo_ShapeInfoFiller()
{ {
} }
//======================================================================= //=======================================================================
//function : SetTolerance //function : SetTolerance
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfoFiller::SetTolerance(const Standard_Real aT) void GEOMAlgo_ShapeInfoFiller::SetTolerance(const Standard_Real aT)
{ {
myTolerance=aT; myTolerance=aT;
} }
@ -84,7 +84,7 @@
//function : Tolerance //function : Tolerance
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Real GEOMAlgo_ShapeInfoFiller::Tolerance()const Standard_Real GEOMAlgo_ShapeInfoFiller::Tolerance()const
{ {
return myTolerance; return myTolerance;
} }
@ -92,7 +92,7 @@
//function : SetShape //function : SetShape
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfoFiller::SetShape(const TopoDS_Shape& aS) void GEOMAlgo_ShapeInfoFiller::SetShape(const TopoDS_Shape& aS)
{ {
myShape=aS; myShape=aS;
} }
@ -100,7 +100,7 @@
//function : Shape //function : Shape
//purpose : //purpose :
//======================================================================= //=======================================================================
const TopoDS_Shape& GEOMAlgo_ShapeInfoFiller::Shape() const const TopoDS_Shape& GEOMAlgo_ShapeInfoFiller::Shape() const
{ {
return myShape; return myShape;
} }
@ -108,7 +108,7 @@
//function : Info //function : Info
//purpose : //purpose :
//======================================================================= //=======================================================================
const GEOMAlgo_ShapeInfo& GEOMAlgo_ShapeInfoFiller::Info() const const GEOMAlgo_ShapeInfo& GEOMAlgo_ShapeInfoFiller::Info() const
{ {
return Info(myShape); return Info(myShape);
} }
@ -116,7 +116,8 @@
//function : Info //function : Info
//purpose : //purpose :
//======================================================================= //=======================================================================
const GEOMAlgo_ShapeInfo& GEOMAlgo_ShapeInfoFiller::Info(const TopoDS_Shape& aS) const const GEOMAlgo_ShapeInfo& GEOMAlgo_ShapeInfoFiller::Info
(const TopoDS_Shape& aS) const
{ {
if (!aS.IsNull()) { if (!aS.IsNull()) {
if (myMapInfo.Contains(aS)) { if (myMapInfo.Contains(aS)) {
@ -131,7 +132,7 @@
//function : CheckData //function : CheckData
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfoFiller::CheckData() void GEOMAlgo_ShapeInfoFiller::CheckData()
{ {
myErrorStatus=0; myErrorStatus=0;
// //
@ -144,7 +145,7 @@
//function : Perform //function : Perform
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfoFiller::Perform() void GEOMAlgo_ShapeInfoFiller::Perform()
{ {
myErrorStatus=0; myErrorStatus=0;
// //
@ -161,7 +162,7 @@
//function :FillShape //function :FillShape
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfoFiller::FillShape(const TopoDS_Shape& aS) void GEOMAlgo_ShapeInfoFiller::FillShape(const TopoDS_Shape& aS)
{ {
TopAbs_ShapeEnum aType; TopAbs_ShapeEnum aType;
// //
@ -199,7 +200,7 @@
//function :FillSubShapes //function :FillSubShapes
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfoFiller::FillSubShapes(const TopoDS_Shape& aS) void GEOMAlgo_ShapeInfoFiller::FillSubShapes(const TopoDS_Shape& aS)
{ {
TopoDS_Iterator aIt; TopoDS_Iterator aIt;
// //
@ -213,7 +214,7 @@
//function : FillContainer //function : FillContainer
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfoFiller::FillContainer(const TopoDS_Shape& aS) void GEOMAlgo_ShapeInfoFiller::FillContainer(const TopoDS_Shape& aS)
{ {
myErrorStatus=0; myErrorStatus=0;
// //
@ -258,9 +259,8 @@
//function : FillSolid //function : FillSolid
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfoFiller::FillSolid(const TopoDS_Shape& aS) void GEOMAlgo_ShapeInfoFiller::FillSolid(const TopoDS_Shape& aS)
{ {
Standard_Integer aNbShells;
TopoDS_Solid aSd; TopoDS_Solid aSd;
// //
myErrorStatus=0; myErrorStatus=0;
@ -280,40 +280,32 @@
// //
aSd=TopoDS::Solid(aS); aSd=TopoDS::Solid(aS);
// //
aNbShells=GEOMAlgo_ShapeInfoFiller::NbShells(aSd);
if (aNbShells>1) {
return;
}
//
FillDetails(aSd); FillDetails(aSd);
} }
//======================================================================= //=======================================================================
//function :FillFace //function :FillFace
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfoFiller::FillFace(const TopoDS_Shape& aS) void GEOMAlgo_ShapeInfoFiller::FillFace(const TopoDS_Shape& aS)
{ {
myErrorStatus=0; myErrorStatus=0;
if (myMapInfo.Contains(aS)) {
return;
}
// //
Standard_Boolean bIsAllowedType; Standard_Boolean bIsAllowedType;
Standard_Integer aNbWires;//, iRet
Standard_Boolean bInf, bInfU1, bInfU2, bInfV1, bInfV2; Standard_Boolean bInf, bInfU1, bInfU2, bInfV1, bInfV2;
Standard_Real aUMin, aUMax, aVMin, aVMax, aR1, aR2; Standard_Real aUMin, aUMax, aVMin, aVMax, aR1, aR2, dV;
gp_Pnt aP0; gp_Pnt aP0;
gp_Dir aDN; gp_Dir aDN;
gp_Ax3 aAx3; gp_Ax3 aAx3;
GeomAbs_SurfaceType aST; GeomAbs_SurfaceType aST;
Handle(Geom_Surface) aSurf; Handle(Geom_Surface) aSurf;
TopoDS_Face aF; TopoDS_Face aF;
//GEOMAlgo_KindOfName aKindOfName;
//---------------------------------------------------- //----------------------------------------------------
if (myMapInfo.Contains(aS)) { GEOMAlgo_ShapeInfo aInfoX;
return; myMapInfo.Add(aS, aInfoX);
} //
else {
GEOMAlgo_ShapeInfo aInfoX;
myMapInfo.Add(aS, aInfoX);
}
GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aS); GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aS);
//---------------------------------------------------- //----------------------------------------------------
aInfo.SetType(TopAbs_FACE); aInfo.SetType(TopAbs_FACE);
@ -324,8 +316,6 @@
// //
aF=TopoDS::Face(aS); aF=TopoDS::Face(aS);
// //
aNbWires=GEOMAlgo_ShapeInfoFiller::NbWires(aF);
//
aSurf=BRep_Tool::Surface(aF); aSurf=BRep_Tool::Surface(aF);
GeomAdaptor_Surface aGAS(aSurf); GeomAdaptor_Surface aGAS(aSurf);
aST=aGAS.GetType(); aST=aGAS.GetType();
@ -334,6 +324,7 @@
return; return;
} }
// //
//||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// 1. Plane // 1. Plane
if (aST==GeomAbs_Plane) { if (aST==GeomAbs_Plane) {
gp_Pln aPln; gp_Pln aPln;
@ -342,16 +333,12 @@
aP0=aPln.Location(); aP0=aPln.Location();
aAx3=aPln.Position(); aAx3=aPln.Position();
// //
aInfo.SetKindOfShape(GEOMAlgo_KS_PLANE); aInfo.SetKindOfShape(GEOMAlgo_KS_PLANE);
aInfo.SetKindOfName(GEOMAlgo_KN_PLANE);
aInfo.SetKindOfClosed(GEOMAlgo_KC_NOTCLOSED); aInfo.SetKindOfClosed(GEOMAlgo_KC_NOTCLOSED);
aInfo.SetLocation(aP0); aInfo.SetLocation(aP0);
aInfo.SetPosition(aAx3); aInfo.SetPosition(aAx3);
// //
if (aNbWires>1) {
return;
}
//
//aSurf->Bounds(aUMin, aUMax, aVMin, aVMax);
BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax); BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
bInfU1=Precision::IsNegativeInfinite(aUMin); bInfU1=Precision::IsNegativeInfinite(aUMin);
bInfU2=Precision::IsPositiveInfinite(aUMax); bInfU2=Precision::IsPositiveInfinite(aUMax);
@ -361,14 +348,15 @@
bInf=(bInfU1 || bInfU2 || bInfV1 || bInfV2); bInf=(bInfU1 || bInfU2 || bInfV1 || bInfV2);
if (bInf) { if (bInf) {
aInfo.SetKindOfBounds(GEOMAlgo_KB_INFINITE); aInfo.SetKindOfBounds(GEOMAlgo_KB_INFINITE);
return;
} }
else { //
aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED); aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
}
// //
FillDetails(aF, aPln); FillDetails(aF, aPln);
}// if (aCT==GeomAbs_Line) { }// if (aCT==GeomAbs_Line) {
// //
//||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// 2. Sphere // 2. Sphere
else if (aST==GeomAbs_Sphere) { else if (aST==GeomAbs_Sphere) {
gp_Sphere aSphere; gp_Sphere aSphere;
@ -379,20 +367,18 @@
aR1=aSphere.Radius(); aR1=aSphere.Radius();
// //
aInfo.SetKindOfShape(GEOMAlgo_KS_SPHERE); aInfo.SetKindOfShape(GEOMAlgo_KS_SPHERE);
aInfo.SetKindOfName(GEOMAlgo_KN_SPHERE);
aInfo.SetLocation(aP0); aInfo.SetLocation(aP0);
aInfo.SetPosition(aAx3); aInfo.SetPosition(aAx3);
aInfo.SetRadius1(aR1); aInfo.SetRadius1(aR1);
// //
if (aNbWires>1) {
return;
}
//
aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED); aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
aInfo.SetKindOfClosed(GEOMAlgo_KC_CLOSED); aInfo.SetKindOfClosed(GEOMAlgo_KC_CLOSED);
// //
FillDetails(aF, aSphere); FillDetails(aF, aSphere);
}// else if (aST==GeomAbs_Sphere) { }// else if (aST==GeomAbs_Sphere) {
// //
//||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// 3. Cylinder // 3. Cylinder
else if (aST==GeomAbs_Cylinder) { else if (aST==GeomAbs_Cylinder) {
gp_Cylinder aCyl; gp_Cylinder aCyl;
@ -403,14 +389,11 @@
aR1=aCyl.Radius(); aR1=aCyl.Radius();
// //
aInfo.SetKindOfShape(GEOMAlgo_KS_CYLINDER); aInfo.SetKindOfShape(GEOMAlgo_KS_CYLINDER);
aInfo.SetKindOfName(GEOMAlgo_KN_CYLINDER);
aInfo.SetLocation(aP0); aInfo.SetLocation(aP0);
aInfo.SetPosition(aAx3); aInfo.SetPosition(aAx3);
aInfo.SetRadius1(aR1); aInfo.SetRadius1(aR1);
// //
if (aNbWires>1) {
return;
}
//
BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax); BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
bInfU1=Precision::IsNegativeInfinite(aUMin); bInfU1=Precision::IsNegativeInfinite(aUMin);
bInfU2=Precision::IsPositiveInfinite(aUMax); bInfU2=Precision::IsPositiveInfinite(aUMax);
@ -420,30 +403,31 @@
bInf=(bInfU1 || bInfU2 || bInfV1 || bInfV2); bInf=(bInfU1 || bInfU2 || bInfV1 || bInfV2);
if (bInf) { if (bInf) {
aInfo.SetKindOfBounds(GEOMAlgo_KB_INFINITE); aInfo.SetKindOfBounds(GEOMAlgo_KB_INFINITE);
return;
} }
else { //
aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED); aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
} //
dV=aVMax-aVMin;
aInfo.SetHeight(dV);
//
FillDetails(aF, aCyl); FillDetails(aF, aCyl);
} }
// //
//||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// 4. Cone // 4. Cone
else if (aST==GeomAbs_Cone) { else if (aST==GeomAbs_Cone) {
Standard_Real aSemiAngle;
gp_Cone aCone; gp_Cone aCone;
// //
aCone=aGAS.Cone(); aCone=aGAS.Cone();
aP0=aCone.Location(); aP0=aCone.Location();
aAx3=aCone.Position(); aAx3=aCone.Position();
//aR1=aCyl.Radius();
// //
aInfo.SetKindOfShape(GEOMAlgo_KS_CONE); aInfo.SetKindOfShape(GEOMAlgo_KS_CONE);
aInfo.SetKindOfName(GEOMAlgo_KN_CONE);
aInfo.SetLocation(aP0); aInfo.SetLocation(aP0);
aInfo.SetPosition(aAx3); aInfo.SetPosition(aAx3);
//aInfo.SetRadius1(aR1);
//
if (aNbWires>1) {
return;
}
// //
BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax); BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
bInfU1=Precision::IsNegativeInfinite(aUMin); bInfU1=Precision::IsNegativeInfinite(aUMin);
@ -454,13 +438,20 @@
bInf=(bInfU1 || bInfU2 || bInfV1 || bInfV2); bInf=(bInfU1 || bInfU2 || bInfV1 || bInfV2);
if (bInf) { if (bInf) {
aInfo.SetKindOfBounds(GEOMAlgo_KB_INFINITE); aInfo.SetKindOfBounds(GEOMAlgo_KB_INFINITE);
return;
} }
else { //
aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED); aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
} //
aSemiAngle=fabs(aCone.SemiAngle());
dV=(aVMax-aVMin)*cos(aSemiAngle);
aInfo.SetHeight(dV);
//
FillDetails(aF, aCone); FillDetails(aF, aCone);
} }
// //
//||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// 5. Torus // 5. Torus
else if (aST==GeomAbs_Torus) { else if (aST==GeomAbs_Torus) {
gp_Torus aTorus; gp_Torus aTorus;
@ -472,15 +463,12 @@
aR2=aTorus.MinorRadius(); aR2=aTorus.MinorRadius();
// //
aInfo.SetKindOfShape(GEOMAlgo_KS_TORUS); aInfo.SetKindOfShape(GEOMAlgo_KS_TORUS);
aInfo.SetKindOfName(GEOMAlgo_KN_TORUS);
aInfo.SetLocation(aP0); aInfo.SetLocation(aP0);
aInfo.SetPosition(aAx3); aInfo.SetPosition(aAx3);
aInfo.SetRadius1(aR1); aInfo.SetRadius1(aR1);
aInfo.SetRadius2(aR2); aInfo.SetRadius2(aR2);
// //
if (aNbWires>1) {
return;
}
//
aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED); aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
// //
FillDetails(aF, aTorus); FillDetails(aF, aTorus);
@ -535,7 +523,6 @@ void GEOMAlgo_ShapeInfoFiller::FillEdge(const TopoDS_Shape& aS)
FillSubShapes(aS); FillSubShapes(aS);
return; return;
} }
//modified by NIZNHY-PKV Tue Jul 03 10:19:03 2012f
// BSplineCurve // BSplineCurve
if (aCT==GeomAbs_BSplineCurve) { if (aCT==GeomAbs_BSplineCurve) {
Standard_Integer aNbKnots, aNbPoles, aDegree; Standard_Integer aNbKnots, aNbPoles, aDegree;
@ -577,7 +564,6 @@ void GEOMAlgo_ShapeInfoFiller::FillEdge(const TopoDS_Shape& aS)
aInfo.SetDirection(aDir); aInfo.SetDirection(aDir);
} }
} }
//modified by NIZNHY-PKV Tue Jul 03 10:19:06 2012t
// Line // Line
else if (aCT==GeomAbs_Line) { else if (aCT==GeomAbs_Line) {
Standard_Boolean bInf1, bInf2; Standard_Boolean bInf1, bInf2;
@ -712,7 +698,7 @@ void GEOMAlgo_ShapeInfoFiller::FillEdge(const TopoDS_Shape& aS)
//function :FillVertex //function :FillVertex
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfoFiller::FillVertex(const TopoDS_Shape& aS) void GEOMAlgo_ShapeInfoFiller::FillVertex(const TopoDS_Shape& aS)
{ {
myErrorStatus=0; myErrorStatus=0;
// //
@ -739,8 +725,8 @@ void GEOMAlgo_ShapeInfoFiller::FillEdge(const TopoDS_Shape& aS)
//function : FillNbSubshapes //function : FillNbSubshapes
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfoFiller::FillNbSubShapes(const TopoDS_Shape& aS, void GEOMAlgo_ShapeInfoFiller::FillNbSubShapes(const TopoDS_Shape& aS,
GEOMAlgo_ShapeInfo& aInfo) GEOMAlgo_ShapeInfo& aInfo)
{ {
myErrorStatus=0; myErrorStatus=0;
// //
@ -776,7 +762,8 @@ void GEOMAlgo_ShapeInfoFiller::FillEdge(const TopoDS_Shape& aS)
//function :NbShells //function :NbShells
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Integer GEOMAlgo_ShapeInfoFiller::NbShells(const TopoDS_Solid& aSd) Standard_Integer GEOMAlgo_ShapeInfoFiller::NbShells
(const TopoDS_Solid& aSd)
{ {
Standard_Integer iCnt; Standard_Integer iCnt;
TopoDS_Iterator aIt; TopoDS_Iterator aIt;
@ -785,7 +772,6 @@ Standard_Integer GEOMAlgo_ShapeInfoFiller::NbShells(const TopoDS_Solid& aSd)
// //
aIt.Initialize(aSd); aIt.Initialize(aSd);
for (; aIt.More(); aIt.Next()) { for (; aIt.More(); aIt.Next()) {
//const TopoDS_Shape& aSh=aIt.Value();
++iCnt; ++iCnt;
} }
return iCnt; return iCnt;
@ -794,7 +780,8 @@ Standard_Integer GEOMAlgo_ShapeInfoFiller::NbShells(const TopoDS_Solid& aSd)
//function : NbWires //function : NbWires
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Integer GEOMAlgo_ShapeInfoFiller::NbWires(const TopoDS_Face& aF) Standard_Integer GEOMAlgo_ShapeInfoFiller::NbWires
(const TopoDS_Face& aF)
{ {
Standard_Integer iCnt; Standard_Integer iCnt;
TopoDS_Iterator aIt; TopoDS_Iterator aIt;
@ -803,7 +790,6 @@ Standard_Integer GEOMAlgo_ShapeInfoFiller::NbWires(const TopoDS_Face& aF)
// //
aIt.Initialize(aF); aIt.Initialize(aF);
for (; aIt.More(); aIt.Next()) { for (; aIt.More(); aIt.Next()) {
//const TopoDS_Shape& aW=aIt.Value();
++iCnt; ++iCnt;
} }
return iCnt; return iCnt;
@ -812,7 +798,8 @@ Standard_Integer GEOMAlgo_ShapeInfoFiller::NbWires(const TopoDS_Face& aF)
//function : IsAllowedType //function : IsAllowedType
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean GEOMAlgo_ShapeInfoFiller::IsAllowedType(const GeomAbs_CurveType aCT) Standard_Boolean GEOMAlgo_ShapeInfoFiller::IsAllowedType
(const GeomAbs_CurveType aCT)
{ {
Standard_Boolean bRet; Standard_Boolean bRet;
Standard_Integer i, aNb; Standard_Integer i, aNb;
@ -820,7 +807,7 @@ Standard_Boolean GEOMAlgo_ShapeInfoFiller::IsAllowedType(const GeomAbs_CurveType
GeomAbs_Line, GeomAbs_Line,
GeomAbs_Circle, GeomAbs_Circle,
GeomAbs_Ellipse, GeomAbs_Ellipse,
GeomAbs_BSplineCurve //modified by NIZNHY-PKV Tue Jul 03 10:18:01 2012ft GeomAbs_BSplineCurve
}; };
// //
bRet=Standard_False; bRet=Standard_False;
@ -834,7 +821,8 @@ Standard_Boolean GEOMAlgo_ShapeInfoFiller::IsAllowedType(const GeomAbs_CurveType
//function : IsAllowedType //function : IsAllowedType
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean GEOMAlgo_ShapeInfoFiller::IsAllowedType(const GeomAbs_SurfaceType aST) Standard_Boolean GEOMAlgo_ShapeInfoFiller::IsAllowedType
(const GeomAbs_SurfaceType aST)
{ {
Standard_Boolean bRet; Standard_Boolean bRet;
Standard_Integer i, aNb; Standard_Integer i, aNb;

View File

@ -68,10 +68,12 @@ static
void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Solid& aSd) void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Solid& aSd)
{ {
Standard_Boolean bIsStepSphere; Standard_Boolean bIsStepSphere;
Standard_Integer i, aNbF, aNbCyl, aNbCon, aNbPgn, aNbRct, aNbCrc, aNbX; Standard_Integer i, aNbF, aNbCyl, aNbCon, aNbPgn, aNbRct;
Standard_Integer aNbShells, aNbCrc, aNbX;
TopoDS_Shape aFCyl, aFCon; TopoDS_Shape aFCyl, aFCon;
TopTools_IndexedMapOfShape aMF; TopTools_IndexedMapOfShape aMF;
GEOMAlgo_KindOfName aKNF; GEOMAlgo_KindOfName aKNF;
GEOMAlgo_KindOfDef aKD;
// //
GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aSd); GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aSd);
aInfo.SetKindOfName(GEOMAlgo_KN_UNKNOWN); aInfo.SetKindOfName(GEOMAlgo_KN_UNKNOWN);
@ -83,7 +85,26 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Solid& aSd)
return; return;
} }
// //
aKD=GEOMAlgo_KD_SPECIFIED;
for (i=1; i<=aNbF && aKD==GEOMAlgo_KD_SPECIFIED; ++i) {
const TopoDS_Shape& aF=aMF(i);
GEOMAlgo_ShapeInfo& aInfoF=myMapInfo.ChangeFromKey(aF);
aKD=aInfoF.KindOfDef();
}
if (aKD!=GEOMAlgo_KD_SPECIFIED) {
aInfo.SetKindOfName(GEOMAlgo_KN_SOLID);
return;
}
//
aNbShells=GEOMAlgo_ShapeInfoFiller::NbShells(aSd);
if (aNbShells>1) {
aInfo.SetKindOfName(GEOMAlgo_KN_SOLID);
return;
}
//
//
if (aNbF==1) { if (aNbF==1) {
// mb: sphere, torus
const TopoDS_Shape& aF=aMF(1); const TopoDS_Shape& aF=aMF(1);
GEOMAlgo_ShapeInfo& aInfoF=myMapInfo.ChangeFromKey(aF); GEOMAlgo_ShapeInfo& aInfoF=myMapInfo.ChangeFromKey(aF);
aKNF=aInfoF.KindOfName(); // mb: sphere, torus aKNF=aInfoF.KindOfName(); // mb: sphere, torus
@ -99,7 +120,6 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Solid& aSd)
return; return;
} }
} }
//modified by NIZNHY-PKV Tue Jul 03 13:23:55 2012f
else if (aNbF==2) { else if (aNbF==2) {
// specific solid that should be treated as a sphere // specific solid that should be treated as a sphere
bIsStepSphere=TreatStepSphere(aSd); bIsStepSphere=TreatStepSphere(aSd);
@ -107,7 +127,6 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Solid& aSd)
return; return;
} }
} }
//modified by NIZNHY-PKV Tue Jul 03 13:23:57 2012t
// //
aNbCyl=0; aNbCyl=0;
aNbCon=0; aNbCon=0;
@ -229,11 +248,9 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Solid& aSd)
const gp_Dir& aDNj=aIFj.Position().Direction(); const gp_Dir& aDNj=aIFj.Position().Direction();
// //
aDot=aDNi*aDNj; aDot=aDNi*aDNj;
//modified by NIZNHY-PKV Tue Jul 03 10:01:56 2012f
if (aDot<0.) { if (aDot<0.) {
aDot=-aDot; aDot=-aDot;
} }
//modified by NIZNHY-PKV Tue Jul 03 10:01:52 2012t
if (fabs(1.-aDot)<0.0001) { if (fabs(1.-aDot)<0.0001) {
aMp.Add(i); aMp.Add(i);
aMp.Add(j); aMp.Add(j);
@ -248,6 +265,8 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Solid& aSd)
return; return;
} }
// //
iMin=-1;
iMax=-1;
aDistMin=1.e15; aDistMin=1.e15;
aDistMax=-aDistMin; aDistMax=-aDistMin;
for (i=0; i<aNbFi; ++i) { for (i=0; i<aNbFi; ++i) {
@ -308,21 +327,10 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
TopTools_IndexedMapOfShape aMV; TopTools_IndexedMapOfShape aMV;
BRepTools_WireExplorer aWExp; BRepTools_WireExplorer aWExp;
GEOMAlgo_KindOfName aKN, aKNE; GEOMAlgo_KindOfName aKN, aKNE;
GEOMAlgo_KindOfShape aKS;
// //
GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF); GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF);
aKN=GEOMAlgo_KN_UNKNOWN;
aInfo.SetKindOfName(GEOMAlgo_KN_UNKNOWN);
// //
aKS=aInfo.KindOfShape(); aInfo.SetKindOfDef(GEOMAlgo_KD_ARBITRARY);
if (aKS!=GEOMAlgo_KS_PLANE) {
return;
}
//
if (aInfo.KindOfBounds()==GEOMAlgo_KB_INFINITE) {
aInfo.SetKindOfName(GEOMAlgo_KN_PLANE);
return;
}
// //
aNbV=aInfo.NbSubShapes(TopAbs_VERTEX); aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
aNbE=aInfo.NbSubShapes(TopAbs_EDGE); aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
@ -330,9 +338,8 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
// 1. may be it is circle/ellipse // 1. may be it is circle/ellipse
if (aNbV==1 && aNbE==1) { if (aNbV==1 && aNbE==1) {
aExp.Init(aF, TopAbs_EDGE); aExp.Init(aF, TopAbs_EDGE);
for (; aExp.More(); aExp.Next()) { if (aExp.More()) {
aE=aExp.Current(); aE=aExp.Current();
break;
} }
// //
const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE); const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
@ -343,6 +350,7 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
aInfo.SetRadius1(aInfoE.Radius1()); aInfo.SetRadius1(aInfoE.Radius1());
aInfo.SetLocation(aInfoE.Location()); aInfo.SetLocation(aInfoE.Location());
aInfo.SetPosition(aInfoE.Position()); aInfo.SetPosition(aInfoE.Position());
aInfo.SetKindOfDef(GEOMAlgo_KD_SPECIFIED);
} }
if (aKNE==GEOMAlgo_KN_ELLIPSE) { if (aKNE==GEOMAlgo_KN_ELLIPSE) {
aKN=GEOMAlgo_KN_DISKELLIPSE; aKN=GEOMAlgo_KN_DISKELLIPSE;
@ -351,22 +359,29 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
aInfo.SetRadius2(aInfoE.Radius2()); aInfo.SetRadius2(aInfoE.Radius2());
aInfo.SetLocation(aInfoE.Location()); aInfo.SetLocation(aInfoE.Location());
aInfo.SetPosition(aInfoE.Position()); aInfo.SetPosition(aInfoE.Position());
aInfo.SetKindOfDef(GEOMAlgo_KD_SPECIFIED);
}
return;
}// if (aNbV==1 && aNbE==1) {
//
//
Standard_Boolean bSegment;
//
bSegment=Standard_True;
aExp.Init(aF, TopAbs_EDGE);
for (; aExp.More() && bSegment; aExp.Next()) {
aE=aExp.Current();
const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
aKNE=aInfoE.KindOfName();
if (aKNE!=GEOMAlgo_KN_SEGMENT) {
bSegment=!bSegment;
} }
} }
// //
// 2. may be it is rectangle if (bSegment) {
else { // 2. may be it is TRIANGLE, POLYGON, QUADRANGLE, RECTANGLE
aExp.Init(aF, TopAbs_EDGE); aInfo.SetKindOfDef(GEOMAlgo_KD_SPECIFIED);
for (; aExp.More(); aExp.Next()) { aInfo.SetKindOfName(GEOMAlgo_KN_POLYGON);
aE=aExp.Current();
const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
aKNE=aInfoE.KindOfName();
if (aKNE!=GEOMAlgo_KN_SEGMENT) {
return;
}
}
//
aInfo.SetKindOfName(GEOMAlgo_KN_POLYGON);
// //
if (aNbV==3 && aNbE==3) { if (aNbV==3 && aNbE==3) {
aInfo.SetKindOfName(GEOMAlgo_KN_TRIANGLE); aInfo.SetKindOfName(GEOMAlgo_KN_TRIANGLE);
@ -393,266 +408,126 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
// //
aInfo.SetLocation(aPc); aInfo.SetLocation(aPc);
aInfo.SetPosition(aAx3); aInfo.SetPosition(aAx3);
// } // if (aNbV==3 && aNbE==3) {
return;
}
// //
if (!(aNbV==4 && aNbE==4)) { if (aNbV==4 && aNbE==4) {
return; aIt.Initialize(aF);
} if (aIt.More()) {
// aW=*((TopoDS_Wire*)&aIt.Value());
// aNbV==4 && aNbE==4 and all edges are segments
aIt.Initialize(aF);
for (; aIt.More(); aIt.Next()){
aW=TopoDS::Wire(aIt.Value());
break;
}
//
aWExp.Init(aW, aF);
for (i=0; aWExp.More(); aWExp.Next(), ++i) {
aEx=aWExp.Current();
const GEOMAlgo_ShapeInfo& aInfoEx=myMapInfo.FindFromKey(aEx);
aDx[i]=aInfoEx.Direction();
aPx[i]=aInfoEx.Location();
}
//
for (i=0; i<4; ++i) {
j=(i==3) ? 0 : i+1;
aDot=aDx[i]*aDx[j];
if (fabs (aDot) > myTolerance) {
aInfo.SetKindOfName(GEOMAlgo_KN_QUADRANGLE);
return;
} }
} //
// aWExp.Init(aW, aF);
// rectangle for (i=0; aWExp.More(); aWExp.Next(), ++i) {
aInfo.SetKindOfName(GEOMAlgo_KN_RECTANGLE); aEx=aWExp.Current();
// const GEOMAlgo_ShapeInfo& aInfoEx=myMapInfo.FindFromKey(aEx);
// shift location to the center and calc. sizes aDx[i]=aInfoEx.Direction();
aXYZc.SetCoord(0.,0.,0.); aPx[i]=aInfoEx.Location();
TopExp::MapShapes(aF, TopAbs_VERTEX, aMV); }
for (i=1; i<=aNbV; ++i) { //
const TopoDS_Vertex& aV=TopoDS::Vertex(aMV(i)); for (i=0; i<4; ++i) {
aP=BRep_Tool::Pnt(aV); j=(i==3) ? 0 : i+1;
const gp_XYZ& aXYZ=aP.XYZ(); aDot=aDx[i]*aDx[j];
aXYZc=aXYZc+aXYZ; if (fabs (aDot) > myTolerance) {
} aInfo.SetKindOfName(GEOMAlgo_KN_QUADRANGLE);
// return;
// Location : aPc in center of rectangle }
// Position : 0z is plane normal }
// 0x is along length //
// // rectangle
aXYZc.Divide(4.); aInfo.SetKindOfName(GEOMAlgo_KN_RECTANGLE);
aPc.SetXYZ(aXYZc); //
// // shift location to the center and calc. sizes
gp_Lin aL0(aPx[0], aDx[0]); aXYZc.SetCoord(0.,0.,0.);
gp_Lin aL1(aPx[1], aDx[1]); TopExp::MapShapes(aF, TopAbs_VERTEX, aMV);
// for (i=1; i<=aNbV; ++i) {
aD0=aL0.Distance(aPc); const TopoDS_Vertex& aV=TopoDS::Vertex(aMV(i));
aD1=aL1.Distance(aPc); aP=BRep_Tool::Pnt(aV);
// const gp_XYZ& aXYZ=aP.XYZ();
aLength=aD0; aXYZc=aXYZc+aXYZ;
aWidth =aD1; }
aDX=aL1.Direction(); //
if (aD0<aD1) { // Location : aPc in center of rectangle
aLength=aD1; // Position : 0z is plane normal
aWidth =aD0; // 0x is along length
aDX=aL0.Direction(); //
} aXYZc.Divide(4.);
// aPc.SetXYZ(aXYZc);
aLength=2.*aLength; //
aWidth =2.*aWidth; gp_Lin aL0(aPx[0], aDx[0]);
// gp_Lin aL1(aPx[1], aDx[1]);
aInfo.SetLocation(aPc); //
aInfo.SetLength(aLength); aD0=aL0.Distance(aPc);
aInfo.SetWidth(aWidth); aD1=aL1.Distance(aPc);
// //
const gp_Dir& aDZ=aPln.Axis().Direction(); aLength=aD0;
gp_Ax2 aAx2(aPc, aDZ, aDX); aWidth =aD1;
gp_Ax3 aAx3(aAx2); aDX=aL1.Direction();
aInfo.SetPosition(aAx3); if (aD0<aD1) {
} aLength=aD1;
aWidth =aD0;
return; aDX=aL0.Direction();
}
//
aLength=2.*aLength;
aWidth =2.*aWidth;
//
aInfo.SetLocation(aPc);
aInfo.SetLength(aLength);
aInfo.SetWidth(aWidth);
//
const gp_Dir& aDZ=aPln.Axis().Direction();
gp_Ax2 aAx2(aPc, aDZ, aDX);
gp_Ax3 aAx3(aAx2);
aInfo.SetPosition(aAx3);
//
}// if (aNbV==4 && aNbE==4) {
return;
}// if (bSegment) {
//
//aInfo.SetKindOfName(GEOMAlgo_KN_PLANE);
} }
//======================================================================= //=======================================================================
//function : FillDetails //function : FillDetails
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF, void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
const gp_Sphere& ) const gp_Sphere& )//aSph)
{ {
Standard_Integer aNbV, aNbE, aNbSE, aNbDE; Standard_Integer aNbV, aNbE, aNbSE, aNbDE;
TopoDS_Edge aE; TopoDS_Edge aE;
TopExp_Explorer aExp; TopExp_Explorer aExp;
TopTools_MapOfShape aM; TopTools_MapOfShape aM;
GEOMAlgo_KindOfShape aKS, aKSE; GEOMAlgo_KindOfShape aKSE;//, aKSE;
// //
GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF); GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF);
aInfo.SetKindOfName(GEOMAlgo_KN_UNKNOWN); //
// aInfo.SetKindOfDef(GEOMAlgo_KD_ARBITRARY);
aKS=aInfo.KindOfShape();
if (aKS!=GEOMAlgo_KS_SPHERE) {
return;
}
//
aNbV=aInfo.NbSubShapes(TopAbs_VERTEX); aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
aNbE=aInfo.NbSubShapes(TopAbs_EDGE); aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
if (!(aNbV==2 && aNbE==3)) { if (aNbV==2 && aNbE==3) {
return; aNbSE=0;
} aNbDE=0;
// aExp.Init(aF, TopAbs_EDGE);
aNbSE=0; for (; aExp.More(); aExp.Next()) {
aNbDE=0; aE=TopoDS::Edge(aExp.Current());
aExp.Init(aF, TopAbs_EDGE); if(aM.Add(aE)) {
for (; aExp.More(); aExp.Next()) { const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
aE=TopoDS::Edge(aExp.Current()); aKSE=aInfoE.KindOfShape();
if(aM.Add(aE)) {
const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
aKSE=aInfoE.KindOfShape();
//
if (BRep_Tool::IsClosed(aE, aF)) {
++aNbSE;
}
else if (aKSE==GEOMAlgo_KS_DEGENERATED) {
++aNbDE;
}
}
}
//
if (!(aNbSE==1 && aNbDE==2)) {
return;
}
aInfo.SetKindOfName(GEOMAlgo_KN_SPHERE);
}
//=======================================================================
//function : FillDetails
//purpose :
//=======================================================================
void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
const gp_Cone& )//aCone)
{
Standard_Integer aNbV, aNbE, aNbCE, aNbSE, aNbDE, i;
Standard_Real aR[3], aHeight;
gp_Pnt aPC[3], aPD, aPc, aPX[3];
TopoDS_Vertex aVD;
TopoDS_Edge aE;
TopoDS_Iterator aIt;
TopExp_Explorer aExp;
TopTools_MapOfShape aM;
GEOMAlgo_KindOfShape aKS, aKSE;
GEOMAlgo_KindOfName aKN, aKNE;
GEOMAlgo_KindOfClosed aKCE;
//
GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF);
aKN=GEOMAlgo_KN_UNKNOWN;
aInfo.SetKindOfName(aKN);
//
aKS=aInfo.KindOfShape();
if (aKS!=GEOMAlgo_KS_CONE) {
return;
}
//
if (aInfo.KindOfBounds()==GEOMAlgo_KB_INFINITE) {
return;
}
//
aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
if (!(aNbV==2 && aNbE==3)) {
return;
}
//
i=0;
aNbCE=0;
aNbSE=0;
aNbDE=0;
aExp.Init(aF, TopAbs_EDGE);
for (; aExp.More(); aExp.Next()) {
aE=TopoDS::Edge(aExp.Current());
if(aM.Add(aE)) {
const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
aKNE=aInfoE.KindOfName();
aKCE=aInfoE.KindOfClosed();
aKSE=aInfoE.KindOfShape();
if (aKNE==GEOMAlgo_KN_CIRCLE && aKCE==GEOMAlgo_KC_CLOSED) {
aPC[i]=aInfoE.Location();
aR[i]=aInfoE.Radius1();
// //
aIt.Initialize(aE);
for (; aIt.More(); aIt.Next()) {
aVD=TopoDS::Vertex(aIt.Value());
break;
}
aPX[i]=BRep_Tool::Pnt(aVD);
//
++i;
++aNbCE;
}
else if (aKNE==GEOMAlgo_KN_SEGMENT) {
if (BRep_Tool::IsClosed(aE, aF)) { if (BRep_Tool::IsClosed(aE, aF)) {
++aNbSE; ++aNbSE;
} }
} else if (aKSE==GEOMAlgo_KS_DEGENERATED) {
else if (aKSE==GEOMAlgo_KS_DEGENERATED) { ++aNbDE;
aIt.Initialize(aE);
for (; aIt.More(); aIt.Next()) {
aVD=TopoDS::Vertex(aIt.Value());
break;
} }
//
aPD=BRep_Tool::Pnt(aVD);
//
++aNbDE;
} }
} }
//
if (aNbSE==1 && aNbDE==2) {
aInfo.SetKindOfDef(GEOMAlgo_KD_SPECIFIED);
}
} }
//
if (!((aNbCE==2 || (aNbCE==1 && aNbDE==1)) && aNbSE==1)) {
return;
}
//
if (aNbDE==1) {
aPC[1]=aPD;
aR[1]=0.;
}
//
aHeight=aPC[0].Distance(aPC[1]);
//
Standard_Real aRmin, aRmax;
gp_Ax2 aAx2new;
//
if (aR[0]>aR[1]) {
aRmin=aR[1];
aRmax=aR[0];
aPc=aPC[0];
gp_Vec aVz(aPC[0], aPC[1]);
gp_Vec aVx(aPC[0], aPX[0]);
gp_Dir aDz(aVz);
gp_Dir aDx(aVx);
gp_Ax2 aAx2(aPc, aDz, aDx);
aAx2new=aAx2;
}
else {
aRmin=aR[0];
aRmax=aR[1];
aPc=aPC[1];
gp_Vec aVz(aPC[1], aPC[0]);
gp_Vec aVx(aPC[1], aPX[1]);
gp_Dir aDz(aVz);
gp_Dir aDx(aVx);
gp_Ax2 aAx2(aPc, aDz, aDx);
aAx2new=aAx2;
}
//
gp_Ax3 aAx3(aAx2new);
aInfo.SetLocation(aPc);
aInfo.SetPosition(aAx3);
aInfo.SetRadius1(aRmax);
aInfo.SetRadius2(aRmin);
aInfo.SetHeight(aHeight);
//
aInfo.SetKindOfName(GEOMAlgo_KN_CONE);
} }
//======================================================================= //=======================================================================
//function : FillDetails //function : FillDetails
@ -660,6 +535,7 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
//======================================================================= //=======================================================================
void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF, void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
const gp_Cylinder& aCyl) const gp_Cylinder& aCyl)
{ {
Standard_Integer i, aNbV, aNbE, aNbCE, aNbSE; Standard_Integer i, aNbV, aNbE, aNbCE, aNbSE;
Standard_Real aT0, aT1, aHeight; Standard_Real aT0, aT1, aHeight;
@ -667,78 +543,185 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
TopoDS_Edge aE; TopoDS_Edge aE;
TopExp_Explorer aExp; TopExp_Explorer aExp;
TopTools_MapOfShape aM; TopTools_MapOfShape aM;
GEOMAlgo_KindOfShape aKS; GEOMAlgo_KindOfName aKNE;
GEOMAlgo_KindOfName aKN, aKNE;
GEOMAlgo_KindOfClosed aKCE; GEOMAlgo_KindOfClosed aKCE;
// //
GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF); GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF);
aKN=GEOMAlgo_KN_UNKNOWN;
aInfo.SetKindOfName(aKN);
//
aKS=aInfo.KindOfShape();
if (aKS!=GEOMAlgo_KS_CYLINDER) {
return;
}
//
if (aInfo.KindOfBounds()==GEOMAlgo_KB_INFINITE) {
return;
}
// //
aInfo.SetKindOfDef(GEOMAlgo_KD_ARBITRARY);
aNbV=aInfo.NbSubShapes(TopAbs_VERTEX); aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
aNbE=aInfo.NbSubShapes(TopAbs_EDGE); aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
if (!(aNbV==2 && aNbE==3)) { if (aNbV==2 && aNbE==3) {
return; const gp_Ax1& aAx1=aCyl.Axis();
} const gp_Dir& aDir=aAx1.Direction();
// const gp_Pnt& aPLoc=aAx1.Location();
i=0; //
aNbCE=0; i=0;
aNbSE=0; aNbCE=0;
aExp.Init(aF, TopAbs_EDGE); aNbSE=0;
for (; aExp.More(); aExp.Next()) { aExp.Init(aF, TopAbs_EDGE);
aE=TopoDS::Edge(aExp.Current()); for (; aExp.More(); aExp.Next()) {
if(aM.Add(aE)) { aE=TopoDS::Edge(aExp.Current());
const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE); if(aM.Add(aE)) {
aKNE=aInfoE.KindOfName(); const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
aKCE=aInfoE.KindOfClosed(); aKNE=aInfoE.KindOfName();
if (aKNE==GEOMAlgo_KN_CIRCLE && aKCE==GEOMAlgo_KC_CLOSED) { aKCE=aInfoE.KindOfClosed();
aPC[aNbCE]=aInfoE.Location(); if (aKNE==GEOMAlgo_KN_CIRCLE && aKCE==GEOMAlgo_KC_CLOSED) {
++aNbCE; aPC[aNbCE]=aInfoE.Location();
} ++aNbCE;
else if (aKNE==GEOMAlgo_KN_SEGMENT) { }
if (BRep_Tool::IsClosed(aE, aF)) { else if (aKNE==GEOMAlgo_KN_SEGMENT) {
++aNbSE; if (BRep_Tool::IsClosed(aE, aF)) {
++aNbSE;
}
} }
} }
} }
} //
// if (aNbCE==2 && aNbSE==1) {
if (!(aNbCE==2 && aNbSE==1)) { gp_Lin aLin(aPLoc, aDir);
return; //
} aT0=ElCLib::Parameter(aLin, aPC[0]);
// aT1=ElCLib::Parameter(aLin, aPC[1]);
const gp_Ax1& aAx1=aCyl.Axis(); //
const gp_Dir& aDir=aAx1.Direction(); aPc=aPC[0];
const gp_Pnt& aPLoc=aAx1.Location(); if (aT0>aT1) {
gp_Lin aLin(aPLoc, aDir); aPc=aPC[1];
// }
aT0=ElCLib::Parameter(aLin, aPC[0]); aHeight=aPC[0].Distance(aPC[1]);
aT1=ElCLib::Parameter(aLin, aPC[1]); //
// gp_Ax3 aAx3=aCyl.Position();
aPc=aPC[0];; aAx3.SetLocation(aPc);
if (aT0>aT1) { //
aPc=aPC[1]; aInfo.SetPosition(aAx3);
} aInfo.SetLocation(aPc);
aHeight=aPC[0].Distance(aPC[1]); aInfo.SetHeight(aHeight);
// //
gp_Ax3 aAx3=aCyl.Position(); aInfo.SetKindOfDef(GEOMAlgo_KD_SPECIFIED);
aAx3.SetLocation(aPc); return; // conventional cylinder
// }//if (aNbCE==2 && aNbSE==1) {
aInfo.SetKindOfName(GEOMAlgo_KN_CYLINDER); }//if (aNbV==2 && aNbE==3) {
aInfo.SetPosition(aAx3); }
aInfo.SetLocation(aPc); //=======================================================================
aInfo.SetHeight(aHeight); //function : FillDetails
//purpose :
//=======================================================================
void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
const gp_Cone& aCone)
{
Standard_Integer aNbV, aNbE, aNbCE, aNbSE, aNbDE, i;
Standard_Real aR[3], aHeight, aRmin, aRmax;
gp_Pnt aPC[3], aPD, aPc, aPX[3];
TopoDS_Vertex aVD;
TopoDS_Edge aE;
TopoDS_Iterator aIt;
TopExp_Explorer aExp;
TopTools_MapOfShape aM;
GEOMAlgo_KindOfShape aKSE;
GEOMAlgo_KindOfName aKNE;
GEOMAlgo_KindOfClosed aKCE;
//
GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF);
//
aInfo.SetKindOfDef(GEOMAlgo_KD_ARBITRARY);
//
aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
if (aNbV==2 && aNbE==3) {
i=0;
aNbCE=0;
aNbSE=0;
aNbDE=0;
aExp.Init(aF, TopAbs_EDGE);
for (; aExp.More(); aExp.Next()) {
aE=TopoDS::Edge(aExp.Current());
if(aM.Add(aE)) {
const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
aKNE=aInfoE.KindOfName();
aKCE=aInfoE.KindOfClosed();
aKSE=aInfoE.KindOfShape();
if (aKNE==GEOMAlgo_KN_CIRCLE && aKCE==GEOMAlgo_KC_CLOSED) {
aPC[i]=aInfoE.Location();
aR[i]=aInfoE.Radius1();
//
aIt.Initialize(aE);
if (aIt.More()) {
aVD=*((TopoDS_Vertex*)&aIt.Value());
}
aPX[i]=BRep_Tool::Pnt(aVD);
//
++i;
++aNbCE;
}
else if (aKNE==GEOMAlgo_KN_SEGMENT) {
if (BRep_Tool::IsClosed(aE, aF)) {
++aNbSE;
}
}
else if (aKSE==GEOMAlgo_KS_DEGENERATED) {
aIt.Initialize(aE);
if (aIt.More()) {
aVD=*((TopoDS_Vertex*)&aIt.Value());
}
//
aPD=BRep_Tool::Pnt(aVD);
//
++aNbDE;
}
}
}
//
if ((aNbCE==2 || (aNbCE==1 && aNbDE==1)) && aNbSE==1) {
if (aNbDE==1) {
aPC[1]=aPD;
aR[1]=0.;
}
//
aHeight=aPC[0].Distance(aPC[1]);
//
gp_Ax2 aAx2new;
//
if (aR[0]>aR[1]) {
aRmin=aR[1];
aRmax=aR[0];
aPc=aPC[0];
gp_Vec aVz(aPC[0], aPC[1]);
gp_Vec aVx(aPC[0], aPX[0]);
gp_Dir aDz(aVz);
gp_Dir aDx(aVx);
gp_Ax2 aAx2(aPc, aDz, aDx);
aAx2new=aAx2;
}
else {
aRmin=aR[0];
aRmax=aR[1];
aPc=aPC[1];
gp_Vec aVz(aPC[1], aPC[0]);
gp_Vec aVx(aPC[1], aPX[1]);
gp_Dir aDz(aVz);
gp_Dir aDx(aVx);
gp_Ax2 aAx2(aPc, aDz, aDx);
aAx2new=aAx2;
}
//
gp_Ax3 aAx3(aAx2new);
aInfo.SetLocation(aPc);
aInfo.SetPosition(aAx3);
aInfo.SetRadius1(aRmax);
aInfo.SetRadius2(aRmin);
aInfo.SetHeight(aHeight);
//
aInfo.SetKindOfDef(GEOMAlgo_KD_SPECIFIED);
return;
}//if ((aNbCE==2 || (aNbCE==1 && aNbDE==1)) && aNbSE==1) {
}//if (aNbV==2 && aNbE==3) {
//
aInfo.SetRadius1 (aCone.RefRadius());
//
aRmin=0.; // ZZ
aInfo.SetRadius2(aRmin);
} }
//======================================================================= //=======================================================================
//function : FillDetails //function : FillDetails
//purpose : //purpose :
@ -746,6 +729,7 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF, void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
const gp_Torus& ) const gp_Torus& )
{ {
Standard_Integer aNbV, aNbE, aNbSE; Standard_Integer aNbV, aNbE, aNbSE;
TopoDS_Edge aE; TopoDS_Edge aE;
TopExp_Explorer aExp; TopExp_Explorer aExp;
@ -753,42 +737,39 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
GEOMAlgo_KindOfShape aKS; GEOMAlgo_KindOfShape aKS;
// //
GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF); GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF);
aInfo.SetKindOfName(GEOMAlgo_KN_UNKNOWN); aInfo.SetKindOfDef(GEOMAlgo_KD_ARBITRARY);
// //
aKS=aInfo.KindOfShape(); aKS=aInfo.KindOfShape();
if (aKS!=GEOMAlgo_KS_TORUS) { if (aKS!=GEOMAlgo_KS_TORUS) {
return; return;
} }
//
aNbV=aInfo.NbSubShapes(TopAbs_VERTEX); aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
aNbE=aInfo.NbSubShapes(TopAbs_EDGE); aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
if (!(aNbV==1 && aNbE==2)) {
return; if (aNbV==1 && aNbE==2) {
} aNbSE=0;
// aExp.Init(aF, TopAbs_EDGE);
aNbSE=0; for (; aExp.More(); aExp.Next()) {
aExp.Init(aF, TopAbs_EDGE); aE=TopoDS::Edge(aExp.Current());
for (; aExp.More(); aExp.Next()) { if (aM.Add(aE)) {
aE=TopoDS::Edge(aExp.Current()); if (BRep_Tool::IsClosed(aE, aF)) {
if (aM.Add(aE)) { ++aNbSE;
if (BRep_Tool::IsClosed(aE, aF)) { }
++aNbSE;
} }
} }
//
if (aNbSE==2) {
aInfo.SetKindOfDef(GEOMAlgo_KD_SPECIFIED);
}
} }
//
if (aNbSE!=2) {
return;
}
aInfo.SetKindOfName(GEOMAlgo_KN_TORUS);
} }
//modified by NIZNHY-PKV Tue Jul 03 13:29:41 2012f
//======================================================================= //=======================================================================
//function : TreatStepSphere //function : TreatStepSphere
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean Standard_Boolean GEOMAlgo_ShapeInfoFiller::TreatStepSphere
GEOMAlgo_ShapeInfoFiller::TreatStepSphere(const TopoDS_Solid& aSd) (const TopoDS_Solid& aSd)
{ {
Standard_Boolean bRet, bIsAllowedType, bOnlyClosed, bIsEqual; Standard_Boolean bRet, bIsAllowedType, bOnlyClosed, bIsEqual;
Standard_Integer j; Standard_Integer j;
@ -899,4 +880,3 @@ Standard_Boolean IsEqual(const gp_Sphere& aSp1,
// //
return bRet; return bRet;
} }
//modified by NIZNHY-PKV Tue Jul 03 13:29:43 2012t

View File

@ -245,7 +245,7 @@ void GEOMAlgo_ShellSolid::Perform()
const BOPDS_IndexRange& aRange=pDS->Range(iRank); const BOPDS_IndexRange& aRange=pDS->Range(iRank);
aRange.Indices(iBeg, iEnd); aRange.Indices(iBeg, iEnd);
const TopoDS_Solid& aSolid=(!iRank) ? *((TopoDS_Solid*)&aTool) : *((TopoDS_Solid*)&aObj); const TopoDS_Solid& aSolid=(!iRank) ? *((TopoDS_Solid*)&aTool) : *((TopoDS_Solid*)&aObj);
BRepClass3d_SolidClassifier& aSC=aCtx->SolidClassifier(aSolid); //BRepClass3d_SolidClassifier& aSC=aCtx->SolidClassifier(aSolid);
// //
//------------------------------ShellSolidBuilder //------------------------------ShellSolidBuilder
GEOMAlgo_ShellSolidBuilder aSSB; GEOMAlgo_ShellSolidBuilder aSSB;
@ -264,50 +264,50 @@ void GEOMAlgo_ShellSolid::Perform()
const TopoDS_Shape& aS=pDS->Shape(i); const TopoDS_Shape& aS=pDS->Shape(i);
aType=aS.ShapeType(); aType=aS.ShapeType();
if (aType!=TopAbs_FACE) { if (aType!=TopAbs_FACE) {
continue; continue;
} }
// //
aState=TopAbs_UNKNOWN; aState=TopAbs_UNKNOWN;
aF=*((TopoDS_Face*)&aS); aF=*((TopoDS_Face*)&aS);
// //
if (!aImages.IsBound(aS)) { if (!aImages.IsBound(aS)) {
iErr=GEOMAlgo_AlgoTools::PntInFace(aF, aP, aP2D); iErr=GEOMAlgo_AlgoTools::PntInFace(aF, aP, aP2D);
if (iErr) { if (iErr) {
myErrorStatus=16; myErrorStatus=16;
return; return;
} }
// //
aState=BOPTools_AlgoTools::ComputeState(aP, aSolid, aTol, aCtx); aState=BOPTools_AlgoTools::ComputeState(aP, aSolid, aTol, aCtx);
} }
else { else {
const BOPCol_ListOfShape& aLSp=aImages.Find(aS); const BOPCol_ListOfShape& aLSp=aImages.Find(aS);
aNbSp=aLSp.Extent(); aNbSp=aLSp.Extent();
if (aNbSp>0) { if (aNbSp>0) {
continue; continue;
} }
// //
if (aNbSp==1) { if (aNbSp==1) {
aF=*((TopoDS_Face*)&aLSp.First()); aF=*((TopoDS_Face*)&aLSp.First());
} }
// //
iErr=GEOMAlgo_AlgoTools::PntInFace(aF, aP, aP2D); iErr=GEOMAlgo_AlgoTools::PntInFace(aF, aP, aP2D);
if (iErr) { if (iErr) {
myErrorStatus=16; myErrorStatus=16;
return; return;
} }
// //
aState=BOPTools_AlgoTools::ComputeState(aP, aSolid, aTol, aCtx); aState=BOPTools_AlgoTools::ComputeState(aP, aSolid, aTol, aCtx);
} }
//---------- //----------
if (aState==TopAbs_ON) { if (aState==TopAbs_ON) {
myLSON.Append(aF); myLSON.Append(aF);
} }
else if (aState==TopAbs_OUT) { else if (aState==TopAbs_OUT) {
myLSOUT.Append(aF); myLSOUT.Append(aF);
} }
else if (aState==TopAbs_IN) { else if (aState==TopAbs_IN) {
myLSIN.Append(aF); myLSIN.Append(aF);
} }
//---------- //----------
}//for (i=iBeg; i<=iEnd; ++i) { }//for (i=iBeg; i<=iEnd; ++i) {

2
src/GEOMAlgo/GEOMAlgo_Splitter.cxx Executable file → Normal file
View File

@ -301,7 +301,7 @@ void TreatCompound(const TopoDS_Shape& aC1,
TopoDS_Iterator aItC; TopoDS_Iterator aItC;
// //
aLC.Append (aC1); aLC.Append (aC1);
while(1) { for(;;) {
aLC1.Clear(); aLC1.Clear();
aIt.Initialize(aLC); aIt.Initialize(aLC);
for (; aIt.More(); aIt.Next()) { for (; aIt.More(); aIt.Next()) {

View File

@ -48,10 +48,11 @@
//function : GetState //function : GetState
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Integer GEOMAlgo_SurfaceTools::GetState(const gp_Pnt& aP, Standard_Integer GEOMAlgo_SurfaceTools::GetState
const GeomAdaptor_Surface& aGAS, (const gp_Pnt& aP,
const Standard_Real aTol, const GeomAdaptor_Surface& aGAS,
TopAbs_State& aState) const Standard_Real aTol,
TopAbs_State& aState)
{ {
Standard_Integer iErr = 0; Standard_Integer iErr = 0;
GeomAbs_SurfaceType aType = aGAS.GetType(); GeomAbs_SurfaceType aType = aGAS.GetType();
@ -95,10 +96,11 @@
//function : GetState //function : GetState
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Integer GEOMAlgo_SurfaceTools::GetState(const gp_Pnt& aP, Standard_Integer GEOMAlgo_SurfaceTools::GetState
const Handle(Geom_Surface)& aSurf, (const gp_Pnt& aP,
const Standard_Real aTol, const Handle(Geom_Surface)& aSurf,
TopAbs_State& aState) const Standard_Real aTol,
TopAbs_State& aState)
{ {
Standard_Integer iErr; Standard_Integer iErr;
GeomAdaptor_Surface aGAS; GeomAdaptor_Surface aGAS;
@ -114,7 +116,8 @@
//function : ReverseState //function : ReverseState
//purpose : //purpose :
//======================================================================= //=======================================================================
TopAbs_State GEOMAlgo_SurfaceTools::ReverseState(const TopAbs_State aState) TopAbs_State GEOMAlgo_SurfaceTools::ReverseState
(const TopAbs_State aState)
{ {
TopAbs_State aRSt=aState; TopAbs_State aRSt=aState;
// //
@ -135,10 +138,11 @@
//function : IsCoaxial //function : IsCoaxial
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean GEOMAlgo_SurfaceTools::IsCoaxial(const gp_Pnt& aP1, Standard_Boolean GEOMAlgo_SurfaceTools::IsCoaxial
const gp_Pnt& aP2, (const gp_Pnt& aP1,
const gp_Cylinder& aCyl, const gp_Pnt& aP2,
const Standard_Real aTol) const gp_Cylinder& aCyl,
const Standard_Real aTol)
{ {
const gp_XYZ &aLoc = aCyl.Location().XYZ(); const gp_XYZ &aLoc = aCyl.Location().XYZ();
const gp_Ax1 &aAxis = aCyl.Axis(); const gp_Ax1 &aAxis = aCyl.Axis();
@ -147,7 +151,7 @@ Standard_Boolean GEOMAlgo_SurfaceTools::IsCoaxial(const gp_Pnt& aP1,
gp_XYZ aDP2 = aP2.XYZ().Subtracted(aLoc); gp_XYZ aDP2 = aP2.XYZ().Subtracted(aLoc);
Standard_Real aDot1 = aDP1.Dot(aDAxis); Standard_Real aDot1 = aDP1.Dot(aDAxis);
Standard_Real aDot2 = aDP1.Dot(aDAxis); Standard_Real aDot2 = aDP1.Dot(aDAxis);
Standard_Real aTol2 = aTol*aTol; //Standard_Real aTol2 = aTol*aTol;
// Project P1 and P2 onto a plane with location aLoc and Norm aDAxis. // Project P1 and P2 onto a plane with location aLoc and Norm aDAxis.
aDP1.Subtract(aDAxis.Multiplied(aDot1)); aDP1.Subtract(aDAxis.Multiplied(aDot1));
@ -160,7 +164,7 @@ Standard_Boolean GEOMAlgo_SurfaceTools::IsCoaxial(const gp_Pnt& aP1,
if (fabs(aRadius1 - aRadius2) <= aTol) { if (fabs(aRadius1 - aRadius2) <= aTol) {
// Check the deflection of the middle point. // Check the deflection of the middle point.
gp_XYZ aMidP = 0.5*(aDP1 + aDP2); gp_XYZ aMidP = 0.5*(aDP1 + aDP2);
Standard_Real aMidRadius1 = aMidP.Modulus(); //Standard_Real aMidRadius1 = aMidP.Modulus();
if (fabs(aRadius1 - aRadius2) <= aTol) { if (fabs(aRadius1 - aRadius2) <= aTol) {
isOn = Standard_True; isOn = Standard_True;
@ -173,7 +177,8 @@ Standard_Boolean GEOMAlgo_SurfaceTools::IsCoaxial(const gp_Pnt& aP1,
//function : IsAnalytic //function : IsAnalytic
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean GEOMAlgo_SurfaceTools::IsAnalytic(const Handle(Geom_Surface)& aSurf) Standard_Boolean GEOMAlgo_SurfaceTools::IsAnalytic
(const Handle(Geom_Surface)& aSurf)
{ {
Standard_Boolean bRet; Standard_Boolean bRet;
GeomAbs_SurfaceType aType; GeomAbs_SurfaceType aType;
@ -190,8 +195,9 @@ Standard_Boolean GEOMAlgo_SurfaceTools::IsAnalytic(const Handle(Geom_Surface)& a
//function : IsConformState //function : IsConformState
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean GEOMAlgo_SurfaceTools::IsConformState(const TopAbs_State aST1, Standard_Boolean GEOMAlgo_SurfaceTools::IsConformState
const GEOMAlgo_State aST2) (const TopAbs_State aST1,
const GEOMAlgo_State aST2)
{ {
Standard_Boolean bRet=Standard_False; Standard_Boolean bRet=Standard_False;
// //