mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-11-11 16:19:17 +05:00
22852: EDF 9937 GEOM: Kind of shape unrecognized when importing step files
This commit is contained in:
parent
59b5446863
commit
7760eb2714
@ -59,7 +59,10 @@ SET(GEOMAlgo_HEADERS
|
||||
GEOMAlgo_DataMapOfPassKeyInteger.hxx
|
||||
GEOMAlgo_DataMapOfShapeMapOfShape.hxx
|
||||
GEOMAlgo_DataMapOfShapePnt.hxx
|
||||
GEOMAlgo_FinderShapeOn.hxx
|
||||
GEOMAlgo_FinderShapeOn1.hxx
|
||||
GEOMAlgo_FinderShapeOn2.hxx
|
||||
GEOMAlgo_FinderShapeOnQuad.hxx
|
||||
GEOMAlgo_GetInPlace.hxx
|
||||
GEOMAlgo_GetInPlaceAPI.hxx
|
||||
GEOMAlgo_GlueAnalyser.hxx
|
||||
@ -77,6 +80,7 @@ SET(GEOMAlgo_HEADERS
|
||||
GEOMAlgo_IndexedDataMapOfShapeState.hxx
|
||||
GEOMAlgo_KindOfBounds.hxx
|
||||
GEOMAlgo_KindOfClosed.hxx
|
||||
GEOMAlgo_KindOfDef.hxx
|
||||
GEOMAlgo_KindOfName.hxx
|
||||
GEOMAlgo_KindOfShape.hxx
|
||||
GEOMAlgo_ListIteratorOfListOfCoupleOfShapes.hxx
|
||||
|
@ -11,25 +11,28 @@ GEOMAlgo_ShellSolid.cxx
|
||||
GEOMAlgo_AlgoTools.hxx
|
||||
GEOMAlgo_AlgoTools.cxx
|
||||
GEOMAlgo_AlgoTools_1.cxx
|
||||
GEOMAlgo_AlgoTools_2.cxx
|
||||
GEOMAlgo_SolidSolid.hxx
|
||||
GEOMAlgo_SolidSolid.cxx
|
||||
GEOMAlgo_ShapeAlgo.hxx
|
||||
GEOMAlgo_ShapeAlgo.cxx
|
||||
GEOMAlgo_FinderShapeOn.hxx
|
||||
GEOMAlgo_FinderShapeOn.cxx
|
||||
GEOMAlgo_FinderShapeOn1.hxx
|
||||
GEOMAlgo_FinderShapeOn1.cxx
|
||||
GEOMAlgo_HAlgo.hxx
|
||||
GEOMAlgo_HAlgo.cxx
|
||||
GEOMAlgo_Clsf.hxx
|
||||
GEOMAlgo_Clsf.cxx
|
||||
GEOMAlgo_ClsfBox.hxx
|
||||
GEOMAlgo_ClsfBox.cxx
|
||||
GEOMAlgo_ClsfQuad.hxx
|
||||
GEOMAlgo_ClsfQuad.cxx
|
||||
GEOMAlgo_ClsfSolid.hxx
|
||||
GEOMAlgo_ClsfSolid.cxx
|
||||
GEOMAlgo_ClsfSurf.hxx
|
||||
GEOMAlgo_ClsfSurf.cxx
|
||||
GEOMAlgo_FinderShapeOn2.hxx
|
||||
GEOMAlgo_FinderShapeOn2.cxx
|
||||
GEOMAlgo_FinderShapeOnQuad.hxx
|
||||
GEOMAlgo_FinderShapeOnQuad.cxx
|
||||
GEOMAlgo_Gluer.hxx
|
||||
GEOMAlgo_Gluer.cxx
|
||||
GEOMAlgo_GlueAnalyser.hxx
|
||||
@ -50,8 +53,6 @@ GEOMAlgo_GetInPlace.cxx
|
||||
GEOMAlgo_GetInPlace_1.cxx
|
||||
GEOMAlgo_GetInPlace_2.cxx
|
||||
GEOMAlgo_GetInPlace_3.cxx
|
||||
GEOMAlgo_GetInPlaceAPI.hxx
|
||||
GEOMAlgo_GetInPlaceAPI.cxx
|
||||
GEOMAlgo_Splitter.hxx
|
||||
GEOMAlgo_Splitter.cxx
|
||||
GEOMAlgo_ShapeInfoFiller.hxx
|
||||
@ -106,3 +107,5 @@ GEOMAlgo_ShapeInfo.cxx
|
||||
GEOMAlgo_IndexedDataMapOfShapeShapeInfo.hxx
|
||||
|
||||
Basics_OCCTVersion.hxx
|
||||
|
||||
GEOMAlgo_KindOfDef.hxx
|
||||
|
0
src/GEOMAlgo/GEOMAlgo.cdl
Executable file → Normal file
0
src/GEOMAlgo/GEOMAlgo.cdl
Executable file → Normal file
95
src/GEOMAlgo/GEOMAlgo_AlgoTools.cxx
Executable file → Normal file
95
src/GEOMAlgo/GEOMAlgo_AlgoTools.cxx
Executable file → Normal file
@ -93,15 +93,15 @@ static
|
||||
Standard_Integer& iCnt);
|
||||
static
|
||||
void CopySource(const TopoDS_Shape& aS,
|
||||
TopTools_IndexedDataMapOfShapeShape& aMapSS,
|
||||
TopoDS_Shape& aSC);
|
||||
TopTools_IndexedDataMapOfShapeShape& aMapSS,
|
||||
TopoDS_Shape& aSC);
|
||||
|
||||
//=======================================================================
|
||||
//function : CopyShape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_AlgoTools::CopyShape(const TopoDS_Shape& aS,
|
||||
TopoDS_Shape& aSC)
|
||||
TopoDS_Shape& aSC)
|
||||
{
|
||||
TopTools_IndexedDataMapOfShapeShape aMapSS;
|
||||
//
|
||||
@ -112,8 +112,8 @@ void GEOMAlgo_AlgoTools::CopyShape(const TopoDS_Shape& aS,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_AlgoTools::CopyShape(const TopoDS_Shape& aS,
|
||||
TopoDS_Shape& aSC,
|
||||
TopTools_IndexedDataMapOfShapeShape& aMapSS)
|
||||
TopoDS_Shape& aSC,
|
||||
TopTools_IndexedDataMapOfShapeShape& aMapSS)
|
||||
{
|
||||
CopySource(aS, aMapSS, aSC);
|
||||
}
|
||||
@ -172,9 +172,9 @@ void CopySource(const TopoDS_Shape& aS,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_AlgoTools::FaceNormal (const TopoDS_Face& aF,
|
||||
const Standard_Real U,
|
||||
const Standard_Real V,
|
||||
gp_Vec& aN)
|
||||
const Standard_Real U,
|
||||
const Standard_Real V,
|
||||
gp_Vec& aN)
|
||||
{
|
||||
gp_Pnt aPnt ;
|
||||
gp_Vec aD1U, aD1V;
|
||||
@ -330,7 +330,7 @@ Standard_Integer GEOMAlgo_AlgoTools::BuildPCurveForEdgeOnFace
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
void GEOMAlgo_AlgoTools::MakeContainer(const TopAbs_ShapeEnum theType,
|
||||
TopoDS_Shape& theC)
|
||||
TopoDS_Shape& theC)
|
||||
{
|
||||
BRep_Builder aBB;
|
||||
//
|
||||
@ -399,9 +399,9 @@ Standard_Boolean GEOMAlgo_AlgoTools::IsUPeriodic(const Handle(Geom_Surface) &aS
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_AlgoTools::RefinePCurveForEdgeOnFace(const TopoDS_Edge& aE,
|
||||
const TopoDS_Face& aF,
|
||||
const Standard_Real aUMin,
|
||||
const Standard_Real aUMax)
|
||||
const TopoDS_Face& aF,
|
||||
const Standard_Real aUMin,
|
||||
const Standard_Real aUMax)
|
||||
{
|
||||
Standard_Real aT1, aT2, aTx, aUx, aTol;
|
||||
gp_Pnt2d aP2D;
|
||||
@ -546,7 +546,7 @@ Standard_Boolean GEOMAlgo_AlgoTools::ProjectPointOnShape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_AlgoTools::PointOnEdge(const TopoDS_Edge& aE,
|
||||
gp_Pnt& aP3D)
|
||||
gp_Pnt& aP3D)
|
||||
{
|
||||
Standard_Real aTx, aT1, aT2;
|
||||
//
|
||||
@ -559,8 +559,8 @@ void GEOMAlgo_AlgoTools::PointOnEdge(const TopoDS_Edge& aE,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_AlgoTools::PointOnEdge(const TopoDS_Edge& aE,
|
||||
const Standard_Real aT,
|
||||
gp_Pnt& aP3D)
|
||||
const Standard_Real aT,
|
||||
gp_Pnt& aP3D)
|
||||
{
|
||||
Standard_Real aT1, aT2;
|
||||
Handle(Geom_Curve) aC3D;
|
||||
@ -573,9 +573,9 @@ void GEOMAlgo_AlgoTools::PointOnEdge(const TopoDS_Edge& aE,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_AlgoTools::PointOnFace(const TopoDS_Face& aF,
|
||||
const Standard_Real aU,
|
||||
const Standard_Real aV,
|
||||
gp_Pnt& aP3D)
|
||||
const Standard_Real aU,
|
||||
const Standard_Real aV,
|
||||
gp_Pnt& aP3D)
|
||||
{
|
||||
Handle(Geom_Surface) aS;
|
||||
//
|
||||
@ -587,7 +587,7 @@ void GEOMAlgo_AlgoTools::PointOnFace(const TopoDS_Face& aF,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_AlgoTools::PointOnFace(const TopoDS_Face& aF,
|
||||
gp_Pnt& aP3D)
|
||||
gp_Pnt& aP3D)
|
||||
{
|
||||
Standard_Real aU, aV, aUMin, aUMax, aVMin, aVMax;
|
||||
//
|
||||
@ -603,7 +603,7 @@ void GEOMAlgo_AlgoTools::PointOnFace(const TopoDS_Face& aF,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_AlgoTools::PointOnShape(const TopoDS_Shape& aS,
|
||||
gp_Pnt& aP3D)
|
||||
gp_Pnt& aP3D)
|
||||
{
|
||||
TopAbs_ShapeEnum aType;
|
||||
//
|
||||
@ -700,7 +700,7 @@ Standard_Integer GEOMAlgo_AlgoTools::FindSDShapes
|
||||
return 0; // Nothing to do
|
||||
}
|
||||
//
|
||||
while(1) {
|
||||
for(;;) {
|
||||
aNbEProcessed=aMProcessed.Extent();
|
||||
if (aNbEProcessed==aNbE) {
|
||||
break;
|
||||
@ -909,8 +909,8 @@ void GetCount(const TopoDS_Shape& aS,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer GEOMAlgo_AlgoTools::PntInFace(const TopoDS_Face& aF,
|
||||
gp_Pnt& theP,
|
||||
gp_Pnt2d& theP2D)
|
||||
gp_Pnt& theP,
|
||||
gp_Pnt2d& theP2D)
|
||||
{
|
||||
Standard_Boolean bIsDone, bHasFirstPoint, bHasSecondPoint;
|
||||
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_Hatcher aHatcher(aIntr,
|
||||
aTolHatch2D, aTolHatch3D,
|
||||
Standard_True, Standard_False);
|
||||
aTolHatch2D, aTolHatch3D,
|
||||
Standard_True, Standard_False);
|
||||
//
|
||||
iErr=0;
|
||||
aEpsT=1.e-12;
|
||||
@ -991,30 +991,33 @@ Standard_Integer GEOMAlgo_AlgoTools::PntInFace(const TopoDS_Face& aF,
|
||||
}
|
||||
//
|
||||
// 4.
|
||||
aVx=aVMin;
|
||||
aNbDomains=aHatcher.NbDomains(aIx);
|
||||
for (i=1; i<=aNbDomains; ++i) {
|
||||
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);
|
||||
//
|
||||
break;
|
||||
if (!aNbDomains) {
|
||||
iErr=5;
|
||||
return iErr;
|
||||
}
|
||||
//
|
||||
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);
|
||||
//
|
||||
theP2D.SetCoord(aUx, aVx);
|
||||
|
@ -62,7 +62,6 @@
|
||||
#include <BRepLib_MakeFace.hxx>
|
||||
#include <BRepLib_FaceError.hxx>
|
||||
|
||||
//#include <BOPTools_DSFiller.hxx>
|
||||
|
||||
#include <GEOMAlgo_WireSolid.hxx>
|
||||
#include <GEOMAlgo_ShellSolid.hxx>
|
||||
@ -300,7 +299,6 @@ void GEOMAlgo_FinderShapeOn::Find(const TopoDS_Shape& aS)
|
||||
{
|
||||
myErrorStatus=0;
|
||||
//
|
||||
Standard_Boolean bIsDone;
|
||||
Standard_Integer i, iErr;
|
||||
TopAbs_State aSts[]={TopAbs_IN, TopAbs_OUT, TopAbs_ON};
|
||||
TopTools_ListIteratorOfListOfShape aIt;
|
||||
|
@ -309,6 +309,9 @@ void GEOMAlgo_FinderShapeOn1::ProcessEdges()
|
||||
aType1=myGAS.GetType();
|
||||
//
|
||||
TopExp::MapShapes(myShape, TopAbs_EDGE, aM);
|
||||
//
|
||||
bIsConformState=Standard_False;
|
||||
//
|
||||
aNb=aM.Extent();
|
||||
for (i=1; i<=aNb; ++i) {
|
||||
GEOMAlgo_ListOfPnt aLP;
|
||||
@ -427,6 +430,8 @@ void GEOMAlgo_FinderShapeOn1::ProcessFaces()
|
||||
}
|
||||
}
|
||||
//
|
||||
bIsConformState=Standard_False;
|
||||
//
|
||||
aExp.Init(aF, TopAbs_EDGE);
|
||||
for (; aExp.More(); aExp.Next()) {
|
||||
const TopoDS_Shape& aE=aExp.Current();
|
||||
@ -500,6 +505,9 @@ void GEOMAlgo_FinderShapeOn1::ProcessSolids()
|
||||
const TopoDS_Shape& aSd=aM(i);
|
||||
aMF.Clear();
|
||||
TopExp::MapShapes(aSd, TopAbs_FACE, aMF);
|
||||
//
|
||||
bIsConformState=Standard_False;
|
||||
//
|
||||
aNbF=aMF.Extent();
|
||||
for (j=1; j<=aNbF; ++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 (!aNb && myNbPntsMin) {
|
||||
}
|
||||
//modified by NIZNHY-PKV Thu Jan 26 09:56:20 2012f
|
||||
//=======================================================================
|
||||
//function : InnerPoints
|
||||
//purpose :
|
||||
@ -676,7 +683,6 @@ void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Edge& aE,
|
||||
aLP.Clear();
|
||||
InnerPoints(aE, aNbPntsMin, aLP);
|
||||
}
|
||||
//modified by NIZNHY-PKV Thu Jan 26 09:56:32 2012t
|
||||
//=======================================================================
|
||||
//function : InnerPoints
|
||||
//purpose :
|
||||
@ -702,16 +708,6 @@ void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Edge& aE,
|
||||
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;
|
||||
dT=(aT2-aT1)/aNbT;
|
||||
for (j=1; j<aNbT; ++j) {
|
||||
@ -719,7 +715,6 @@ void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Edge& aE,
|
||||
aC3D->D0(aT, aP);
|
||||
aLP.Append(aP);
|
||||
}
|
||||
//modified by NIZNHY-PKV Thu Jan 26 09:51:24 2012t
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@ -362,6 +362,8 @@ void GEOMAlgo_FinderShapeOn2::ProcessEdges()
|
||||
//
|
||||
const TopoDS_Edge& aE=TopoDS::Edge(aM(i));
|
||||
//
|
||||
bIsConformState=Standard_False;
|
||||
//
|
||||
aExp.Init(aE, TopAbs_VERTEX);
|
||||
for (; aExp.More(); aExp.Next()) {
|
||||
const TopoDS_Shape& aV=aExp.Current();
|
||||
@ -475,6 +477,9 @@ void GEOMAlgo_FinderShapeOn2::ProcessFaces()
|
||||
}
|
||||
}
|
||||
//
|
||||
//
|
||||
bIsConformState=Standard_False;
|
||||
//
|
||||
aExp.Init(aF, TopAbs_EDGE);
|
||||
for (; aExp.More(); aExp.Next()) {
|
||||
const TopoDS_Shape& aE=aExp.Current();
|
||||
@ -558,6 +563,9 @@ void GEOMAlgo_FinderShapeOn2::ProcessSolids()
|
||||
const TopoDS_Shape& aSd=aM(i);
|
||||
aMF.Clear();
|
||||
TopExp::MapShapes(aSd, TopAbs_FACE, aMF);
|
||||
//
|
||||
bIsConformState=Standard_False;
|
||||
//
|
||||
aNbF=aMF.Extent();
|
||||
for (j=1; j<=aNbF; ++j) {
|
||||
const TopoDS_Shape& aF=aMF(j);
|
||||
|
@ -239,7 +239,6 @@ Standard_Integer PntInSolid(const TopoDS_Solid& aZ,
|
||||
gp_Pnt aPx;
|
||||
gp_Pnt2d aP2Dx;
|
||||
gp_Vec aDNx;
|
||||
|
||||
TopoDS_Face aF;
|
||||
TopExp_Explorer aExp;
|
||||
//
|
||||
@ -247,9 +246,8 @@ Standard_Integer PntInSolid(const TopoDS_Solid& aZ,
|
||||
aCoef=10.;
|
||||
//
|
||||
aExp.Init (aZ, TopAbs_FACE);
|
||||
for (; aExp.More() ; aExp.Next()) {
|
||||
if (aExp.More()) {
|
||||
aF=*((TopoDS_Face*)&aExp.Current());
|
||||
break;
|
||||
}
|
||||
//
|
||||
iErr=PntInFace(aF, aPx, aP2Dx);
|
||||
@ -368,29 +366,31 @@ Standard_Integer PntInFace(const TopoDS_Face& aF,
|
||||
//
|
||||
// 4.
|
||||
aNbDomains=aHatcher.NbDomains(aIx);
|
||||
for (i=1; i<=aNbDomains; ++i) {
|
||||
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);
|
||||
//
|
||||
break;
|
||||
if (!aNbDomains) {
|
||||
iErr=5;
|
||||
return iErr;
|
||||
}
|
||||
//
|
||||
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);
|
||||
//
|
||||
theP2D.SetCoord(aUx, aVx);
|
||||
|
@ -90,7 +90,6 @@ GEOMAlgo_GlueDetector::GEOMAlgo_GlueDetector()
|
||||
//=======================================================================
|
||||
GEOMAlgo_GlueDetector::~GEOMAlgo_GlueDetector()
|
||||
{}
|
||||
//modified by NIZNHY-PKV Tue Mar 13 12:26:50 2012f
|
||||
//=======================================================================
|
||||
//function : StickedShapes
|
||||
//purpose :
|
||||
@ -100,7 +99,6 @@ const TopTools_IndexedDataMapOfShapeListOfShape&
|
||||
{
|
||||
return myStickedShapes;
|
||||
}
|
||||
//modified by NIZNHY-PKV Tue Mar 13 12:26:54 2012t
|
||||
//=======================================================================
|
||||
//function : Perform
|
||||
//purpose :
|
||||
@ -124,12 +122,10 @@ void GEOMAlgo_GlueDetector::Perform()
|
||||
return;
|
||||
}
|
||||
//
|
||||
//modified by NIZNHY-PKV Wed Mar 14 08:00:09 2012f
|
||||
CheckDetected();
|
||||
if (myErrorStatus) {
|
||||
return;
|
||||
}
|
||||
//modified by NIZNHY-PKV Wed Mar 14 08:00:12 2012t
|
||||
//
|
||||
DetectEdges();
|
||||
if (myErrorStatus) {
|
||||
@ -206,7 +202,7 @@ void GEOMAlgo_GlueDetector::DetectVertices()
|
||||
TColStd_MapIteratorOfMapOfInteger aIt1;
|
||||
//
|
||||
aMIP.Add(i);
|
||||
while(1) {
|
||||
for(;;) {
|
||||
aNbIP=aMIP.Extent();
|
||||
aIt1.Initialize(aMIP);
|
||||
for(; aIt1.More(); aIt1.Next()) {
|
||||
@ -460,7 +456,6 @@ void GEOMAlgo_GlueDetector::EdgePassKey(const TopoDS_Edge& aE,
|
||||
//
|
||||
aPK.SetShapes(aLV);
|
||||
}
|
||||
//modified by NIZNHY-PKV Tue Mar 13 09:54:18 2012f
|
||||
//=======================================================================
|
||||
//function : CheckDetected
|
||||
//purpose :
|
||||
@ -607,4 +602,3 @@ Standard_Integer CheckAncesstors
|
||||
//
|
||||
return iRet;
|
||||
}
|
||||
//modified by NIZNHY-PKV Tue Mar 13 09:54:59 2012t
|
||||
|
189
src/GEOMAlgo/GEOMAlgo_Gluer.cxx
Executable file → Normal file
189
src/GEOMAlgo/GEOMAlgo_Gluer.cxx
Executable file → Normal file
@ -20,10 +20,10 @@
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
// File: GEOMAlgo_Gluer.cxx
|
||||
// Created: Sat Dec 04 12:45:53 2004
|
||||
// Author: Peter KURNEV
|
||||
// <peter@PREFEX>
|
||||
// File: GEOMAlgo_Gluer.cxx
|
||||
// Created: Sat Dec 04 12:45:53 2004
|
||||
// Author: Peter KURNEV
|
||||
// <peter@PREFEX>
|
||||
//
|
||||
#include <GEOMAlgo_Gluer.hxx>
|
||||
|
||||
@ -100,7 +100,7 @@
|
||||
//
|
||||
static
|
||||
void GetSubShapes(const TopoDS_Shape& aS,
|
||||
TopTools_IndexedMapOfShape& aMSS);
|
||||
TopTools_IndexedMapOfShape& aMSS);
|
||||
|
||||
//=======================================================================
|
||||
//function : GEOMAlgo_Gluer
|
||||
@ -228,10 +228,7 @@ void GEOMAlgo_Gluer::MakeVertices()
|
||||
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItIm;
|
||||
TopTools_DataMapOfShapeListOfShape aMVV;
|
||||
GEOMAlgo_IndexedDataMapOfIntegerShape aMIS;
|
||||
//modified by NIZNHY-PKV Thu Jan 21 10:03:07 2010f
|
||||
//GEOMAlgo_IndexedDataMapOfShapeBox aMSB;
|
||||
GEOMAlgo_IndexedDataMapOfShapeBndSphere aMSB;
|
||||
//modified by NIZNHY-PKV Thu Jan 21 10:03:10 2010t
|
||||
//
|
||||
GEOMAlgo_BndSphereTreeSelector aSelector;
|
||||
GEOMAlgo_BndSphereTree aBBTree;
|
||||
@ -278,57 +275,54 @@ void GEOMAlgo_Gluer::MakeVertices()
|
||||
TColStd_MapIteratorOfMapOfInteger aIt1;
|
||||
//
|
||||
aMIP.Add(i);
|
||||
while(1) {
|
||||
for(;;) {
|
||||
aNbIP=aMIP.Extent();
|
||||
aIt1.Initialize(aMIP);
|
||||
for(; aIt1.More(); aIt1.Next()) {
|
||||
aIP=aIt1.Key();
|
||||
if (aMIPC.Contains(aIP)) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
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 Bnd_Box& aBoxVP=aMSB.FindFromKey(aVP);
|
||||
//modified by NIZNHY-PKV Thu Jan 21 10:04:11 2010t
|
||||
//
|
||||
aSelector.Clear();
|
||||
aSelector.SetBox(aBoxVP);
|
||||
//
|
||||
aNbVSD=aBBTree.Select(aSelector);
|
||||
if (!aNbVSD) {
|
||||
continue; // it must not be
|
||||
}
|
||||
//
|
||||
const TColStd_ListOfInteger& aLI=aSelector.Indices();
|
||||
//
|
||||
aIt.Initialize(aLI);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
aIP1=aIt.Value();
|
||||
if (aMIP.Contains(aIP1)) {
|
||||
continue;
|
||||
}
|
||||
aMIP1.Add(aIP1);
|
||||
} //for (; aIt.More(); aIt.Next()) {
|
||||
aIP=aIt1.Key();
|
||||
if (aMIPC.Contains(aIP)) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
|
||||
const GEOMAlgo_BndSphere& aBoxVP=aMSB.FindFromKey(aVP);
|
||||
//
|
||||
aSelector.Clear();
|
||||
aSelector.SetBox(aBoxVP);
|
||||
//
|
||||
aNbVSD=aBBTree.Select(aSelector);
|
||||
if (!aNbVSD) {
|
||||
continue; // it must not be
|
||||
}
|
||||
//
|
||||
const TColStd_ListOfInteger& aLI=aSelector.Indices();
|
||||
//
|
||||
aIt.Initialize(aLI);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
aIP1=aIt.Value();
|
||||
if (aMIP.Contains(aIP1)) {
|
||||
continue;
|
||||
}
|
||||
aMIP1.Add(aIP1);
|
||||
} //for (; aIt.More(); aIt.Next()) {
|
||||
}//for(; aIt1.More(); aIt1.Next()) {
|
||||
//
|
||||
aNbIP1=aMIP1.Extent();
|
||||
if (!aNbIP1) {
|
||||
break;
|
||||
break;
|
||||
}
|
||||
//
|
||||
aIt1.Initialize(aMIP);
|
||||
for(; aIt1.More(); aIt1.Next()) {
|
||||
aIP=aIt1.Key();
|
||||
aMIPC.Add(aIP);
|
||||
aIP=aIt1.Key();
|
||||
aMIPC.Add(aIP);
|
||||
}
|
||||
//
|
||||
aMIP.Clear();
|
||||
aIt1.Initialize(aMIP1);
|
||||
for(; aIt1.More(); aIt1.Next()) {
|
||||
aIP=aIt1.Key();
|
||||
aMIP.Add(aIP);
|
||||
aIP=aIt1.Key();
|
||||
aMIP.Add(aIP);
|
||||
}
|
||||
aMIP1.Clear();
|
||||
}// while(1)
|
||||
@ -344,13 +338,13 @@ void GEOMAlgo_Gluer::MakeVertices()
|
||||
else { // SD vertices founded [ aMIPC ]
|
||||
aIt1.Initialize(aMIPC);
|
||||
for(j=0; aIt1.More(); aIt1.Next(), ++j) {
|
||||
aIP=aIt1.Key();
|
||||
const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
|
||||
if (!j) {
|
||||
aVF=aVP;
|
||||
}
|
||||
aLVSD.Append(aVP);
|
||||
aMVProcessed.Add(aVP);
|
||||
aIP=aIt1.Key();
|
||||
const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
|
||||
if (!j) {
|
||||
aVF=aVP;
|
||||
}
|
||||
aLVSD.Append(aVP);
|
||||
aMVProcessed.Add(aVP);
|
||||
}
|
||||
}
|
||||
myImages.Bind(aVF, aLVSD);
|
||||
@ -395,7 +389,7 @@ void GEOMAlgo_Gluer::MakeVertices()
|
||||
for (; aItS.More(); aItS.Next()) {
|
||||
const TopoDS_Shape& aVSD=aItS.Value();
|
||||
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);
|
||||
if (!BRep_Tool::Degenerated(aER)) {
|
||||
// orient image
|
||||
Standard_Boolean bIsToReverse=GEOMAlgo_AlgoTools::IsSplitToReverse(aER, aE, myContext);
|
||||
Standard_Boolean bIsToReverse=
|
||||
GEOMAlgo_AlgoTools::IsSplitToReverse(aER, aE, myContext);
|
||||
if (bIsToReverse) {
|
||||
aER.Reverse();
|
||||
}
|
||||
@ -490,8 +485,7 @@ void GEOMAlgo_Gluer::MakeSubShapes (const TopoDS_Shape& theShape,
|
||||
aBB.Add(theResult, aShapeR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (myKeepNonSolids) {
|
||||
// just add image
|
||||
const TopoDS_Shape& aShapeR = myOrigins.Find(theShape);
|
||||
@ -554,12 +548,12 @@ void GEOMAlgo_Gluer::MakeShells()
|
||||
const TopoDS_Face& aF=TopoDS::Face(aExp.Current());
|
||||
aFR=TopoDS::Face(myOrigins.Find(aF));
|
||||
if (aFR.IsSame(aF)) {
|
||||
aBB.Add(aNewShell, aF);
|
||||
continue;
|
||||
aBB.Add(aNewShell, aF);
|
||||
continue;
|
||||
}
|
||||
bIsToReverse=IsToReverse(aFR, aF);
|
||||
if (bIsToReverse) {
|
||||
aFR.Reverse();
|
||||
aFR.Reverse();
|
||||
}
|
||||
aBB.Add(aNewShell, aFR);
|
||||
}
|
||||
@ -660,25 +654,25 @@ void GEOMAlgo_Gluer::MakeShapes(const TopAbs_ShapeEnum aType)
|
||||
if (aNbSDF==1) {
|
||||
bHasNewSubShape=HasNewSubShape(aS1);
|
||||
if (!bHasNewSubShape) {
|
||||
aNewShape=aS1;
|
||||
aNewShape.Orientation(TopAbs_FORWARD);
|
||||
aNewShape=aS1;
|
||||
aNewShape.Orientation(TopAbs_FORWARD);
|
||||
}
|
||||
}
|
||||
//
|
||||
if (bHasNewSubShape) {
|
||||
if (aType==TopAbs_FACE) {
|
||||
TopoDS_Face aNewFace;
|
||||
//
|
||||
const TopoDS_Face& aF1=TopoDS::Face(aS1);
|
||||
MakeFace(aF1, aNewFace);
|
||||
aNewShape=aNewFace;
|
||||
TopoDS_Face aNewFace;
|
||||
//
|
||||
const TopoDS_Face& aF1=TopoDS::Face(aS1);
|
||||
MakeFace(aF1, aNewFace);
|
||||
aNewShape=aNewFace;
|
||||
}
|
||||
else if (aType==TopAbs_EDGE) {
|
||||
TopoDS_Edge aNewEdge;
|
||||
//
|
||||
const TopoDS_Edge& aE1=TopoDS::Edge(aS1);
|
||||
MakeEdge(aE1, aNewEdge);
|
||||
aNewShape=aNewEdge;
|
||||
TopoDS_Edge aNewEdge;
|
||||
//
|
||||
const TopoDS_Edge& aE1=TopoDS::Edge(aS1);
|
||||
MakeEdge(aE1, aNewEdge);
|
||||
aNewShape=aNewEdge;
|
||||
}
|
||||
}
|
||||
//
|
||||
@ -688,7 +682,7 @@ void GEOMAlgo_Gluer::MakeShapes(const TopAbs_ShapeEnum aType)
|
||||
for (; aItS.More(); aItS.Next()) {
|
||||
const TopoDS_Shape& aFSD=aItS.Value();
|
||||
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) {
|
||||
const TopoDS_Shape& aFS=aMFS(j);
|
||||
if (aMFR.Contains(aFS)) {
|
||||
const TopTools_ListOfShape& aLSx=aMFR.FindFromKey(aFS);
|
||||
aNbSx=aLSx.Extent();
|
||||
if (aNbSx==2) {
|
||||
bFound=!bFound;
|
||||
break;
|
||||
}
|
||||
const TopTools_ListOfShape& aLSx=aMFR.FindFromKey(aFS);
|
||||
aNbSx=aLSx.Extent();
|
||||
if (aNbSx==2) {
|
||||
bFound=!bFound;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
@ -795,7 +789,7 @@ void GEOMAlgo_Gluer::InnerTolerance()
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Gluer::FacePassKey(const TopoDS_Face& aF,
|
||||
GEOMAlgo_PassKeyShape& aPK)
|
||||
GEOMAlgo_PassKeyShape& aPK)
|
||||
{
|
||||
Standard_Integer i, aNbE;
|
||||
TopTools_ListOfShape aLE;
|
||||
@ -820,7 +814,7 @@ void GEOMAlgo_Gluer::FacePassKey(const TopoDS_Face& aF,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Gluer::EdgePassKey(const TopoDS_Edge& aE,
|
||||
GEOMAlgo_PassKeyShape& aPK)
|
||||
GEOMAlgo_PassKeyShape& aPK)
|
||||
{
|
||||
TopoDS_Vertex aV1, aV2;
|
||||
//
|
||||
@ -839,7 +833,7 @@ void GEOMAlgo_Gluer::EdgePassKey(const TopoDS_Edge& aE,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Gluer::MakeVertex(const TopTools_ListOfShape& aLV,
|
||||
TopoDS_Vertex& aNewVertex)
|
||||
TopoDS_Vertex& aNewVertex)
|
||||
{
|
||||
Standard_Integer aNbV;
|
||||
Standard_Real aTolV, aD, aDmax;
|
||||
@ -885,7 +879,7 @@ void GEOMAlgo_Gluer::MakeVertex(const TopTools_ListOfShape& aLV,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Gluer::MakeEdge(const TopoDS_Edge& aE,
|
||||
TopoDS_Edge& aNewEdge)
|
||||
TopoDS_Edge& aNewEdge)
|
||||
{
|
||||
myErrorStatus=0;
|
||||
//
|
||||
@ -939,7 +933,7 @@ void GEOMAlgo_Gluer::MakeEdge(const TopoDS_Edge& aE,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Gluer::MakeFace(const TopoDS_Face& aF,
|
||||
TopoDS_Face& aNewFace)
|
||||
TopoDS_Face& aNewFace)
|
||||
{
|
||||
myErrorStatus=0;
|
||||
//
|
||||
@ -975,20 +969,20 @@ void GEOMAlgo_Gluer::MakeFace(const TopoDS_Face& aF,
|
||||
//
|
||||
aER.Orientation(TopAbs_FORWARD);
|
||||
if (!BRep_Tool::Degenerated(aER)) {
|
||||
// build p-curve
|
||||
if (bIsUPeriodic) {
|
||||
GEOMAlgo_AlgoTools::RefinePCurveForEdgeOnFace(aER, aFFWD, aUMin, aUMax);
|
||||
}
|
||||
BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace(aER, aFFWD);
|
||||
|
||||
// orient image
|
||||
bIsToReverse=GEOMAlgo_AlgoTools::IsSplitToReverse(aER, aE, myContext);
|
||||
if (bIsToReverse) {
|
||||
aER.Reverse();
|
||||
}
|
||||
// build p-curve
|
||||
if (bIsUPeriodic) {
|
||||
GEOMAlgo_AlgoTools::RefinePCurveForEdgeOnFace(aER, aFFWD, aUMin, aUMax);
|
||||
}
|
||||
BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace(aER, aFFWD);
|
||||
|
||||
// orient image
|
||||
bIsToReverse=GEOMAlgo_AlgoTools::IsSplitToReverse(aER, aE, myContext);
|
||||
if (bIsToReverse) {
|
||||
aER.Reverse();
|
||||
}
|
||||
}
|
||||
else {
|
||||
aER.Orientation(aE.Orientation());
|
||||
aER.Orientation(aE.Orientation());
|
||||
}
|
||||
//
|
||||
aBB.Add(newWire, aER);
|
||||
@ -1009,7 +1003,7 @@ void GEOMAlgo_Gluer::MakeFace(const TopoDS_Face& aF,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean GEOMAlgo_Gluer::IsToReverse(const TopoDS_Face& aFR,
|
||||
const TopoDS_Face& aF)
|
||||
const TopoDS_Face& aF)
|
||||
{
|
||||
Standard_Boolean bRet;
|
||||
Standard_Real aT, aT1, aT2, aTR, aScPr;
|
||||
@ -1088,7 +1082,7 @@ Standard_Boolean GEOMAlgo_Gluer::HasNewSubShape(const TopoDS_Shape& aS)const
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GetSubShapes(const TopoDS_Shape& aS,
|
||||
TopTools_IndexedMapOfShape& aMSS)
|
||||
TopTools_IndexedMapOfShape& aMSS)
|
||||
{
|
||||
Standard_Integer aR;
|
||||
TopAbs_ShapeEnum aType;
|
||||
@ -1111,7 +1105,8 @@ void GetSubShapes(const TopoDS_Shape& aS,
|
||||
//function : Modified
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const TopTools_ListOfShape& GEOMAlgo_Gluer::Modified (const TopoDS_Shape& aS)
|
||||
const TopTools_ListOfShape& GEOMAlgo_Gluer::Modified
|
||||
(const TopoDS_Shape& aS)
|
||||
{
|
||||
TopAbs_ShapeEnum aType;
|
||||
//
|
||||
@ -1127,7 +1122,7 @@ const TopTools_ListOfShape& GEOMAlgo_Gluer::Modified (const TopoDS_Shape& aS)
|
||||
if(myOrigins.IsBound(aS)) {
|
||||
const TopoDS_Shape& aSnew=myOrigins.Find(aS);
|
||||
if (!aSnew.IsSame(aS)) {
|
||||
myGenerated.Append(aSnew);
|
||||
myGenerated.Append(aSnew);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -84,11 +84,8 @@ void GEOMAlgo_Gluer2::Clear()
|
||||
myImagesToWork.Clear();
|
||||
myOriginsToWork.Clear();
|
||||
myKeepNonSolids=Standard_False;
|
||||
//modified by NIZNHY-PKV Tue Mar 13 13:38:28 2012f
|
||||
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
|
||||
//purpose :
|
||||
@ -98,12 +95,12 @@ const TopTools_IndexedDataMapOfShapeListOfShape&
|
||||
{
|
||||
return myDetector.StickedShapes();
|
||||
}
|
||||
//modified by NIZNHY-PKV Tue Mar 13 12:26:54 2012t
|
||||
//=======================================================================
|
||||
//function : SetShapesToGlue
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Gluer2::SetShapesToGlue(const TopTools_DataMapOfShapeListOfShape& aM)
|
||||
void GEOMAlgo_Gluer2::SetShapesToGlue
|
||||
(const TopTools_DataMapOfShapeListOfShape& aM)
|
||||
{
|
||||
myShapesToGlue=aM;
|
||||
}
|
||||
@ -241,6 +238,7 @@ void GEOMAlgo_Gluer2::CheckData()
|
||||
myWarningStatus=0;
|
||||
//
|
||||
aNbSG=myShapesToGlue.Extent();
|
||||
aType=TopAbs_SHAPE;
|
||||
if (aNbSG) {
|
||||
// Check myShapesToGlue
|
||||
aItDMSLS.Initialize(myShapesToGlue);
|
||||
@ -587,6 +585,7 @@ void GEOMAlgo_Gluer2::BuildResult()
|
||||
myErrorStatus=0;
|
||||
myWarningStatus=0;
|
||||
//
|
||||
bHasImage=Standard_False;
|
||||
aItC.Initialize(myArgument);
|
||||
for (; aItC.More(); aItC.Next()) {
|
||||
const TopoDS_Shape& aCx=aItC.Value();
|
||||
|
37
src/GEOMAlgo/GEOMAlgo_KindOfDef.hxx
Normal file
37
src/GEOMAlgo/GEOMAlgo_KindOfDef.hxx
Normal 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
|
@ -44,7 +44,8 @@ GEOMAlgo_KN_DISKELLIPSE,
|
||||
GEOMAlgo_KN_RECTANGLE,
|
||||
GEOMAlgo_KN_TRIANGLE,
|
||||
GEOMAlgo_KN_QUADRANGLE,
|
||||
GEOMAlgo_KN_ARCELLIPSE
|
||||
GEOMAlgo_KN_ARCELLIPSE,
|
||||
GEOMAlgo_KN_SOLID
|
||||
};
|
||||
|
||||
#ifndef _Standard_PrimitiveTypes_HeaderFile
|
||||
|
@ -35,9 +35,7 @@ GEOMAlgo_KS_PLANE,
|
||||
GEOMAlgo_KS_CIRCLE,
|
||||
GEOMAlgo_KS_LINE,
|
||||
GEOMAlgo_KS_DEGENERATED,
|
||||
//modified by NIZNHY-PKV Tue Jul 03 10:28:09 2012f
|
||||
GEOMAlgo_KS_BSPLINE
|
||||
//modified by NIZNHY-PKV Tue Jul 03 10:28:11 2012t
|
||||
};
|
||||
|
||||
#ifndef _Standard_PrimitiveTypes_HeaderFile
|
||||
|
@ -29,6 +29,8 @@ static
|
||||
void DumpKindOfBounds(const GEOMAlgo_KindOfBounds aKB);
|
||||
static
|
||||
void DumpKindOfName(const GEOMAlgo_KindOfName aKS);
|
||||
static
|
||||
void DumpKindOfDef(const GEOMAlgo_KindOfDef aKD);
|
||||
static
|
||||
void DumpPosition(const gp_Ax3& aAx3);
|
||||
static
|
||||
@ -39,7 +41,7 @@ static
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
GEOMAlgo_ShapeInfo::GEOMAlgo_ShapeInfo()
|
||||
GEOMAlgo_ShapeInfo::GEOMAlgo_ShapeInfo()
|
||||
{
|
||||
Reset();
|
||||
}
|
||||
@ -47,14 +49,14 @@ static
|
||||
//function : ~
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
GEOMAlgo_ShapeInfo::~GEOMAlgo_ShapeInfo()
|
||||
GEOMAlgo_ShapeInfo::~GEOMAlgo_ShapeInfo()
|
||||
{
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Reset
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfo::Reset()
|
||||
void GEOMAlgo_ShapeInfo::Reset()
|
||||
{
|
||||
Standard_Integer i;
|
||||
//
|
||||
@ -69,6 +71,7 @@ static
|
||||
myKindOfBounds=GEOMAlgo_KB_UNKNOWN;
|
||||
myKindOfClosed=GEOMAlgo_KC_UNKNOWN;
|
||||
myKindOfName=GEOMAlgo_KN_UNKNOWN;
|
||||
myKindOfDef=GEOMAlgo_KD_UNKNOWN;
|
||||
//
|
||||
myLocation.SetCoord(99., 99., 99.);
|
||||
myDirection.SetCoord(1.,0.,0.);
|
||||
@ -83,7 +86,7 @@ static
|
||||
//function : SetType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfo::SetType(const TopAbs_ShapeEnum aType)
|
||||
void GEOMAlgo_ShapeInfo::SetType(const TopAbs_ShapeEnum aType)
|
||||
{
|
||||
myType=aType;
|
||||
}
|
||||
@ -91,7 +94,7 @@ static
|
||||
//function : Type
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
TopAbs_ShapeEnum GEOMAlgo_ShapeInfo::Type() const
|
||||
TopAbs_ShapeEnum GEOMAlgo_ShapeInfo::Type() const
|
||||
{
|
||||
return myType;
|
||||
}
|
||||
@ -99,8 +102,8 @@ static
|
||||
//function : SetNbSubShapes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfo::SetNbSubShapes(const TopAbs_ShapeEnum aType,
|
||||
const Standard_Integer aNb)
|
||||
void GEOMAlgo_ShapeInfo::SetNbSubShapes(const TopAbs_ShapeEnum aType,
|
||||
const Standard_Integer aNb)
|
||||
{
|
||||
Standard_Integer iN;
|
||||
|
||||
@ -113,7 +116,8 @@ static
|
||||
//function : NbSubShapes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer GEOMAlgo_ShapeInfo::NbSubShapes(const TopAbs_ShapeEnum aType) const
|
||||
Standard_Integer GEOMAlgo_ShapeInfo::NbSubShapes
|
||||
(const TopAbs_ShapeEnum aType) const
|
||||
{
|
||||
Standard_Integer iN;
|
||||
|
||||
@ -127,7 +131,7 @@ static
|
||||
//function : SetKindOfShape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfo::SetKindOfShape(const GEOMAlgo_KindOfShape aT)
|
||||
void GEOMAlgo_ShapeInfo::SetKindOfShape(const GEOMAlgo_KindOfShape aT)
|
||||
{
|
||||
myKindOfShape=aT;
|
||||
}
|
||||
@ -135,7 +139,7 @@ static
|
||||
//function : KindOfShape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
GEOMAlgo_KindOfShape GEOMAlgo_ShapeInfo::KindOfShape() const
|
||||
GEOMAlgo_KindOfShape GEOMAlgo_ShapeInfo::KindOfShape() const
|
||||
{
|
||||
return myKindOfShape;
|
||||
}
|
||||
@ -143,7 +147,7 @@ static
|
||||
//function : SetKindOfName
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfo::SetKindOfName(const GEOMAlgo_KindOfName aT)
|
||||
void GEOMAlgo_ShapeInfo::SetKindOfName(const GEOMAlgo_KindOfName aT)
|
||||
{
|
||||
myKindOfName=aT;
|
||||
}
|
||||
@ -151,7 +155,7 @@ static
|
||||
//function : KindOfName
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
GEOMAlgo_KindOfName GEOMAlgo_ShapeInfo::KindOfName() const
|
||||
GEOMAlgo_KindOfName GEOMAlgo_ShapeInfo::KindOfName() const
|
||||
{
|
||||
return myKindOfName;
|
||||
}
|
||||
@ -159,7 +163,7 @@ static
|
||||
//function : SetKindOfBounds
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfo::SetKindOfBounds(const GEOMAlgo_KindOfBounds aT)
|
||||
void GEOMAlgo_ShapeInfo::SetKindOfBounds(const GEOMAlgo_KindOfBounds aT)
|
||||
{
|
||||
myKindOfBounds=aT;
|
||||
}
|
||||
@ -167,7 +171,7 @@ static
|
||||
//function : KindOfBounds
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
GEOMAlgo_KindOfBounds GEOMAlgo_ShapeInfo::KindOfBounds() const
|
||||
GEOMAlgo_KindOfBounds GEOMAlgo_ShapeInfo::KindOfBounds() const
|
||||
{
|
||||
return myKindOfBounds;
|
||||
}
|
||||
@ -175,7 +179,7 @@ static
|
||||
//function : SetKindOfClosed
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfo::SetKindOfClosed(const GEOMAlgo_KindOfClosed aT)
|
||||
void GEOMAlgo_ShapeInfo::SetKindOfClosed(const GEOMAlgo_KindOfClosed aT)
|
||||
{
|
||||
myKindOfClosed=aT;
|
||||
}
|
||||
@ -183,15 +187,31 @@ static
|
||||
//function : KindOfClosed
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
GEOMAlgo_KindOfClosed GEOMAlgo_ShapeInfo::KindOfClosed() const
|
||||
GEOMAlgo_KindOfClosed GEOMAlgo_ShapeInfo::KindOfClosed() const
|
||||
{
|
||||
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
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfo::SetLocation(const gp_Pnt& aP)
|
||||
void GEOMAlgo_ShapeInfo::SetLocation(const gp_Pnt& aP)
|
||||
{
|
||||
myLocation=aP;
|
||||
}
|
||||
@ -199,7 +219,7 @@ static
|
||||
//function : Location
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const gp_Pnt& GEOMAlgo_ShapeInfo::Location() const
|
||||
const gp_Pnt& GEOMAlgo_ShapeInfo::Location() const
|
||||
{
|
||||
return myLocation;
|
||||
}
|
||||
@ -207,7 +227,7 @@ static
|
||||
//function : SetDirection
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfo::SetDirection(const gp_Dir& aD)
|
||||
void GEOMAlgo_ShapeInfo::SetDirection(const gp_Dir& aD)
|
||||
{
|
||||
myDirection=aD;
|
||||
}
|
||||
@ -215,7 +235,7 @@ static
|
||||
//function : Direction
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const gp_Dir& GEOMAlgo_ShapeInfo::Direction() const
|
||||
const gp_Dir& GEOMAlgo_ShapeInfo::Direction() const
|
||||
{
|
||||
return myDirection;
|
||||
}
|
||||
@ -223,7 +243,7 @@ static
|
||||
//function : SetPosition
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfo::SetPosition(const gp_Ax2& aAx2)
|
||||
void GEOMAlgo_ShapeInfo::SetPosition(const gp_Ax2& aAx2)
|
||||
{
|
||||
gp_Ax3 aAx3(aAx2);
|
||||
SetPosition(aAx3);
|
||||
@ -232,7 +252,7 @@ static
|
||||
//function : SetPosition
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfo::SetPosition(const gp_Ax3& aAx3)
|
||||
void GEOMAlgo_ShapeInfo::SetPosition(const gp_Ax3& aAx3)
|
||||
{
|
||||
myPosition=aAx3;
|
||||
}
|
||||
@ -240,7 +260,7 @@ static
|
||||
//function : Position
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const gp_Ax3& GEOMAlgo_ShapeInfo::Position() const
|
||||
const gp_Ax3& GEOMAlgo_ShapeInfo::Position() const
|
||||
{
|
||||
return myPosition;
|
||||
}
|
||||
@ -249,7 +269,7 @@ static
|
||||
//function : SetPnt1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfo::SetPnt1(const gp_Pnt& aP)
|
||||
void GEOMAlgo_ShapeInfo::SetPnt1(const gp_Pnt& aP)
|
||||
{
|
||||
myPnt1=aP;
|
||||
}
|
||||
@ -257,7 +277,7 @@ static
|
||||
//function : Pnt1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const gp_Pnt& GEOMAlgo_ShapeInfo::Pnt1() const
|
||||
const gp_Pnt& GEOMAlgo_ShapeInfo::Pnt1() const
|
||||
{
|
||||
return myPnt1;
|
||||
}
|
||||
@ -265,7 +285,7 @@ static
|
||||
//function : SetPnt2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfo::SetPnt2(const gp_Pnt& aP)
|
||||
void GEOMAlgo_ShapeInfo::SetPnt2(const gp_Pnt& aP)
|
||||
{
|
||||
myPnt2=aP;
|
||||
}
|
||||
@ -273,7 +293,7 @@ static
|
||||
//function : Pnt2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const gp_Pnt& GEOMAlgo_ShapeInfo::Pnt2() const
|
||||
const gp_Pnt& GEOMAlgo_ShapeInfo::Pnt2() const
|
||||
{
|
||||
return myPnt2;
|
||||
}
|
||||
@ -281,7 +301,7 @@ static
|
||||
//function : SetRadius1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfo::SetRadius1(const Standard_Real aR)
|
||||
void GEOMAlgo_ShapeInfo::SetRadius1(const Standard_Real aR)
|
||||
{
|
||||
myRadius1=aR;
|
||||
}
|
||||
@ -289,7 +309,7 @@ static
|
||||
//function : Radius1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Real GEOMAlgo_ShapeInfo::Radius1() const
|
||||
Standard_Real GEOMAlgo_ShapeInfo::Radius1() const
|
||||
{
|
||||
return myRadius1;
|
||||
}
|
||||
@ -297,7 +317,7 @@ static
|
||||
//function : SetRadius2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfo::SetRadius2(const Standard_Real aR)
|
||||
void GEOMAlgo_ShapeInfo::SetRadius2(const Standard_Real aR)
|
||||
{
|
||||
myRadius2=aR;
|
||||
}
|
||||
@ -305,7 +325,7 @@ static
|
||||
//function : Radius2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Real GEOMAlgo_ShapeInfo::Radius2() const
|
||||
Standard_Real GEOMAlgo_ShapeInfo::Radius2() const
|
||||
{
|
||||
return myRadius2;
|
||||
}
|
||||
@ -313,7 +333,7 @@ static
|
||||
//function : SetLength
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfo::SetLength(const Standard_Real aL)
|
||||
void GEOMAlgo_ShapeInfo::SetLength(const Standard_Real aL)
|
||||
{
|
||||
myLength=aL;
|
||||
}
|
||||
@ -321,7 +341,7 @@ static
|
||||
//function : Length
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Real GEOMAlgo_ShapeInfo::Length() const
|
||||
Standard_Real GEOMAlgo_ShapeInfo::Length() const
|
||||
{
|
||||
return myLength;
|
||||
}
|
||||
@ -329,7 +349,7 @@ static
|
||||
//function : SetWidth
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfo::SetWidth(const Standard_Real aW)
|
||||
void GEOMAlgo_ShapeInfo::SetWidth(const Standard_Real aW)
|
||||
{
|
||||
myWidth=aW;
|
||||
}
|
||||
@ -337,7 +357,7 @@ static
|
||||
//function : Width
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Real GEOMAlgo_ShapeInfo::Width() const
|
||||
Standard_Real GEOMAlgo_ShapeInfo::Width() const
|
||||
{
|
||||
return myWidth;
|
||||
}
|
||||
@ -345,7 +365,7 @@ static
|
||||
//function : SetHeight
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfo::SetHeight(const Standard_Real aH)
|
||||
void GEOMAlgo_ShapeInfo::SetHeight(const Standard_Real aH)
|
||||
{
|
||||
myHeight=aH;
|
||||
}
|
||||
@ -353,7 +373,7 @@ static
|
||||
//function : Height
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Real GEOMAlgo_ShapeInfo::Height() const
|
||||
Standard_Real GEOMAlgo_ShapeInfo::Height() const
|
||||
{
|
||||
return myHeight;
|
||||
}
|
||||
@ -372,7 +392,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
|
||||
//function : Dump
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfo::Dump()const
|
||||
void GEOMAlgo_ShapeInfo::Dump()const
|
||||
{
|
||||
switch (myType) {
|
||||
//
|
||||
@ -417,7 +437,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
|
||||
//function : DumpCompound
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfo::DumpCompound()const
|
||||
void GEOMAlgo_ShapeInfo::DumpCompound()const
|
||||
{
|
||||
Standard_Integer aNbV, aNbE, aNbF, aNbS, aNbC, aNbP;
|
||||
GEOMAlgo_KindOfShape aKS;
|
||||
@ -452,7 +472,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
|
||||
//function : DumpCompSolid
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfo::DumpCompSolid()const
|
||||
void GEOMAlgo_ShapeInfo::DumpCompSolid()const
|
||||
{
|
||||
Standard_Integer aNbV, aNbE, aNbF, aNbS;
|
||||
GEOMAlgo_KindOfShape aKS;
|
||||
@ -479,12 +499,11 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
|
||||
DumpKindOfBounds(aKB);
|
||||
DumpKindOfClosed(aKC);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DumpSolid
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfo::DumpSolid()const
|
||||
void GEOMAlgo_ShapeInfo::DumpSolid()const
|
||||
{
|
||||
Standard_Integer aNbV, aNbE, aNbF;
|
||||
GEOMAlgo_KindOfShape aKS;
|
||||
@ -545,18 +564,18 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
|
||||
printf(" Height : %.3lf\n", myHeight);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DumpFace
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfo::DumpFace()const
|
||||
void GEOMAlgo_ShapeInfo::DumpFace()const
|
||||
{
|
||||
Standard_Integer aNbV, aNbE;
|
||||
GEOMAlgo_KindOfShape aKS;
|
||||
GEOMAlgo_KindOfName aKN;
|
||||
GEOMAlgo_KindOfBounds aKB;
|
||||
GEOMAlgo_KindOfClosed aKC;
|
||||
GEOMAlgo_KindOfDef aKD;
|
||||
//
|
||||
aNbV=NbSubShapes(TopAbs_VERTEX);
|
||||
aNbE=NbSubShapes(TopAbs_EDGE);
|
||||
@ -564,6 +583,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
|
||||
aKN=KindOfName();
|
||||
aKB=KindOfBounds();
|
||||
aKC=KindOfClosed();
|
||||
aKD=KindOfDef();
|
||||
//
|
||||
printf(" *FACE\n");
|
||||
printf(" number of vertices: %d\n", aNbV);
|
||||
@ -572,6 +592,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
|
||||
DumpKindOfName (aKN);
|
||||
DumpKindOfBounds(aKB);
|
||||
DumpKindOfClosed(aKC);
|
||||
DumpKindOfDef(aKD);
|
||||
//
|
||||
// PLANE
|
||||
if (aKN==GEOMAlgo_KN_PLANE) {
|
||||
@ -641,7 +662,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
|
||||
//function : DumpShell
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfo::DumpShell()const
|
||||
void GEOMAlgo_ShapeInfo::DumpShell()const
|
||||
{
|
||||
Standard_Integer aNbV, aNbE, aNbF;
|
||||
GEOMAlgo_KindOfClosed aKC;
|
||||
@ -662,7 +683,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
|
||||
//function : DumpWire
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfo::DumpWire()const
|
||||
void GEOMAlgo_ShapeInfo::DumpWire()const
|
||||
{
|
||||
Standard_Integer aNbV, aNbE;
|
||||
GEOMAlgo_KindOfClosed aKC;
|
||||
@ -682,7 +703,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
|
||||
//function : DumpEdge
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfo::DumpEdge()const
|
||||
void GEOMAlgo_ShapeInfo::DumpEdge()const
|
||||
{
|
||||
Standard_Integer aNbV;
|
||||
Standard_Real aX, aY, aZ;
|
||||
@ -755,7 +776,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
|
||||
//function : DumpVertex
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfo::DumpVertex()const
|
||||
void GEOMAlgo_ShapeInfo::DumpVertex()const
|
||||
{
|
||||
printf(" *VERTEX\n");
|
||||
DumpLocation(myLocation);
|
||||
@ -764,7 +785,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
|
||||
//function : DumpLocation
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void DumpLocation(const gp_Pnt& aP)
|
||||
void DumpLocation(const gp_Pnt& aP)
|
||||
{
|
||||
Standard_Real aX, aY, aZ;
|
||||
//
|
||||
@ -775,7 +796,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
|
||||
//function : DumpDirection
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void DumpDirection(const gp_Dir& aD)
|
||||
void DumpDirection(const gp_Dir& aD)
|
||||
{
|
||||
Standard_Real aX, aY, aZ;
|
||||
//
|
||||
@ -881,10 +902,27 @@ void DumpKindOfName(const GEOMAlgo_KindOfName aKS)
|
||||
"KN_RECTANGLE",
|
||||
"KN_TRIANGLE",
|
||||
"KN_QUADRANGLE",
|
||||
"KN_ARCELLIPSE"
|
||||
"KN_ARCELLIPSE",
|
||||
"KN_SOLID"
|
||||
};
|
||||
int i;
|
||||
//
|
||||
i=(Standard_Integer)aKS;
|
||||
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]);
|
||||
}
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include <GEOMAlgo_KindOfName.hxx>
|
||||
#include <GEOMAlgo_KindOfBounds.hxx>
|
||||
#include <GEOMAlgo_KindOfClosed.hxx>
|
||||
#include <GEOMAlgo_KindOfDef.hxx>
|
||||
|
||||
|
||||
//=======================================================================
|
||||
@ -62,7 +63,8 @@ class GEOMAlgo_ShapeInfo
|
||||
TopAbs_ShapeEnum Type() const;
|
||||
|
||||
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_Integer NbSubShapes(const TopAbs_ShapeEnum aType) const;
|
||||
@ -91,6 +93,12 @@ class GEOMAlgo_ShapeInfo
|
||||
Standard_EXPORT
|
||||
GEOMAlgo_KindOfClosed KindOfClosed() const;
|
||||
|
||||
Standard_EXPORT
|
||||
void SetKindOfDef(const GEOMAlgo_KindOfDef aT) ;
|
||||
|
||||
Standard_EXPORT
|
||||
GEOMAlgo_KindOfDef KindOfDef() const;
|
||||
|
||||
Standard_EXPORT
|
||||
void SetLocation(const gp_Pnt& aP) ;
|
||||
|
||||
@ -189,6 +197,7 @@ class GEOMAlgo_ShapeInfo
|
||||
GEOMAlgo_KindOfName myKindOfName;
|
||||
GEOMAlgo_KindOfBounds myKindOfBounds;
|
||||
GEOMAlgo_KindOfClosed myKindOfClosed;
|
||||
GEOMAlgo_KindOfDef myKindOfDef;
|
||||
gp_Pnt myLocation;
|
||||
gp_Dir myDirection;
|
||||
gp_Ax3 myPosition;
|
||||
|
@ -59,7 +59,7 @@
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
GEOMAlgo_ShapeInfoFiller::GEOMAlgo_ShapeInfoFiller()
|
||||
GEOMAlgo_ShapeInfoFiller::GEOMAlgo_ShapeInfoFiller()
|
||||
:
|
||||
GEOMAlgo_Algo()
|
||||
{
|
||||
@ -69,14 +69,14 @@
|
||||
//function : ~
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
GEOMAlgo_ShapeInfoFiller::~GEOMAlgo_ShapeInfoFiller()
|
||||
GEOMAlgo_ShapeInfoFiller::~GEOMAlgo_ShapeInfoFiller()
|
||||
{
|
||||
}
|
||||
//=======================================================================
|
||||
//function : SetTolerance
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfoFiller::SetTolerance(const Standard_Real aT)
|
||||
void GEOMAlgo_ShapeInfoFiller::SetTolerance(const Standard_Real aT)
|
||||
{
|
||||
myTolerance=aT;
|
||||
}
|
||||
@ -84,7 +84,7 @@
|
||||
//function : Tolerance
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Real GEOMAlgo_ShapeInfoFiller::Tolerance()const
|
||||
Standard_Real GEOMAlgo_ShapeInfoFiller::Tolerance()const
|
||||
{
|
||||
return myTolerance;
|
||||
}
|
||||
@ -92,7 +92,7 @@
|
||||
//function : SetShape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfoFiller::SetShape(const TopoDS_Shape& aS)
|
||||
void GEOMAlgo_ShapeInfoFiller::SetShape(const TopoDS_Shape& aS)
|
||||
{
|
||||
myShape=aS;
|
||||
}
|
||||
@ -100,7 +100,7 @@
|
||||
//function : Shape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const TopoDS_Shape& GEOMAlgo_ShapeInfoFiller::Shape() const
|
||||
const TopoDS_Shape& GEOMAlgo_ShapeInfoFiller::Shape() const
|
||||
{
|
||||
return myShape;
|
||||
}
|
||||
@ -108,7 +108,7 @@
|
||||
//function : Info
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const GEOMAlgo_ShapeInfo& GEOMAlgo_ShapeInfoFiller::Info() const
|
||||
const GEOMAlgo_ShapeInfo& GEOMAlgo_ShapeInfoFiller::Info() const
|
||||
{
|
||||
return Info(myShape);
|
||||
}
|
||||
@ -116,7 +116,8 @@
|
||||
//function : Info
|
||||
//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 (myMapInfo.Contains(aS)) {
|
||||
@ -131,7 +132,7 @@
|
||||
//function : CheckData
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfoFiller::CheckData()
|
||||
void GEOMAlgo_ShapeInfoFiller::CheckData()
|
||||
{
|
||||
myErrorStatus=0;
|
||||
//
|
||||
@ -144,7 +145,7 @@
|
||||
//function : Perform
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfoFiller::Perform()
|
||||
void GEOMAlgo_ShapeInfoFiller::Perform()
|
||||
{
|
||||
myErrorStatus=0;
|
||||
//
|
||||
@ -161,7 +162,7 @@
|
||||
//function :FillShape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfoFiller::FillShape(const TopoDS_Shape& aS)
|
||||
void GEOMAlgo_ShapeInfoFiller::FillShape(const TopoDS_Shape& aS)
|
||||
{
|
||||
TopAbs_ShapeEnum aType;
|
||||
//
|
||||
@ -199,7 +200,7 @@
|
||||
//function :FillSubShapes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfoFiller::FillSubShapes(const TopoDS_Shape& aS)
|
||||
void GEOMAlgo_ShapeInfoFiller::FillSubShapes(const TopoDS_Shape& aS)
|
||||
{
|
||||
TopoDS_Iterator aIt;
|
||||
//
|
||||
@ -213,7 +214,7 @@
|
||||
//function : FillContainer
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfoFiller::FillContainer(const TopoDS_Shape& aS)
|
||||
void GEOMAlgo_ShapeInfoFiller::FillContainer(const TopoDS_Shape& aS)
|
||||
{
|
||||
myErrorStatus=0;
|
||||
//
|
||||
@ -258,9 +259,8 @@
|
||||
//function : FillSolid
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfoFiller::FillSolid(const TopoDS_Shape& aS)
|
||||
void GEOMAlgo_ShapeInfoFiller::FillSolid(const TopoDS_Shape& aS)
|
||||
{
|
||||
Standard_Integer aNbShells;
|
||||
TopoDS_Solid aSd;
|
||||
//
|
||||
myErrorStatus=0;
|
||||
@ -280,40 +280,32 @@
|
||||
//
|
||||
aSd=TopoDS::Solid(aS);
|
||||
//
|
||||
aNbShells=GEOMAlgo_ShapeInfoFiller::NbShells(aSd);
|
||||
if (aNbShells>1) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
FillDetails(aSd);
|
||||
}
|
||||
//=======================================================================
|
||||
//function :FillFace
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfoFiller::FillFace(const TopoDS_Shape& aS)
|
||||
void GEOMAlgo_ShapeInfoFiller::FillFace(const TopoDS_Shape& aS)
|
||||
{
|
||||
myErrorStatus=0;
|
||||
if (myMapInfo.Contains(aS)) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
Standard_Boolean bIsAllowedType;
|
||||
Standard_Integer aNbWires;//, iRet
|
||||
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_Dir aDN;
|
||||
gp_Ax3 aAx3;
|
||||
GeomAbs_SurfaceType aST;
|
||||
Handle(Geom_Surface) aSurf;
|
||||
TopoDS_Face aF;
|
||||
//GEOMAlgo_KindOfName aKindOfName;
|
||||
//----------------------------------------------------
|
||||
if (myMapInfo.Contains(aS)) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
GEOMAlgo_ShapeInfo aInfoX;
|
||||
myMapInfo.Add(aS, aInfoX);
|
||||
}
|
||||
GEOMAlgo_ShapeInfo aInfoX;
|
||||
myMapInfo.Add(aS, aInfoX);
|
||||
//
|
||||
GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aS);
|
||||
//----------------------------------------------------
|
||||
aInfo.SetType(TopAbs_FACE);
|
||||
@ -324,8 +316,6 @@
|
||||
//
|
||||
aF=TopoDS::Face(aS);
|
||||
//
|
||||
aNbWires=GEOMAlgo_ShapeInfoFiller::NbWires(aF);
|
||||
//
|
||||
aSurf=BRep_Tool::Surface(aF);
|
||||
GeomAdaptor_Surface aGAS(aSurf);
|
||||
aST=aGAS.GetType();
|
||||
@ -334,6 +324,7 @@
|
||||
return;
|
||||
}
|
||||
//
|
||||
//||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
// 1. Plane
|
||||
if (aST==GeomAbs_Plane) {
|
||||
gp_Pln aPln;
|
||||
@ -342,16 +333,12 @@
|
||||
aP0=aPln.Location();
|
||||
aAx3=aPln.Position();
|
||||
//
|
||||
aInfo.SetKindOfShape(GEOMAlgo_KS_PLANE);
|
||||
aInfo.SetKindOfShape(GEOMAlgo_KS_PLANE);
|
||||
aInfo.SetKindOfName(GEOMAlgo_KN_PLANE);
|
||||
aInfo.SetKindOfClosed(GEOMAlgo_KC_NOTCLOSED);
|
||||
aInfo.SetLocation(aP0);
|
||||
aInfo.SetPosition(aAx3);
|
||||
//
|
||||
if (aNbWires>1) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
//aSurf->Bounds(aUMin, aUMax, aVMin, aVMax);
|
||||
BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
|
||||
bInfU1=Precision::IsNegativeInfinite(aUMin);
|
||||
bInfU2=Precision::IsPositiveInfinite(aUMax);
|
||||
@ -361,14 +348,15 @@
|
||||
bInf=(bInfU1 || bInfU2 || bInfV1 || bInfV2);
|
||||
if (bInf) {
|
||||
aInfo.SetKindOfBounds(GEOMAlgo_KB_INFINITE);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
|
||||
}
|
||||
//
|
||||
aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
|
||||
//
|
||||
FillDetails(aF, aPln);
|
||||
}// if (aCT==GeomAbs_Line) {
|
||||
//
|
||||
//||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
// 2. Sphere
|
||||
else if (aST==GeomAbs_Sphere) {
|
||||
gp_Sphere aSphere;
|
||||
@ -379,20 +367,18 @@
|
||||
aR1=aSphere.Radius();
|
||||
//
|
||||
aInfo.SetKindOfShape(GEOMAlgo_KS_SPHERE);
|
||||
aInfo.SetKindOfName(GEOMAlgo_KN_SPHERE);
|
||||
aInfo.SetLocation(aP0);
|
||||
aInfo.SetPosition(aAx3);
|
||||
aInfo.SetRadius1(aR1);
|
||||
//
|
||||
if (aNbWires>1) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
|
||||
aInfo.SetKindOfClosed(GEOMAlgo_KC_CLOSED);
|
||||
//
|
||||
FillDetails(aF, aSphere);
|
||||
}// else if (aST==GeomAbs_Sphere) {
|
||||
//
|
||||
//||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
// 3. Cylinder
|
||||
else if (aST==GeomAbs_Cylinder) {
|
||||
gp_Cylinder aCyl;
|
||||
@ -403,14 +389,11 @@
|
||||
aR1=aCyl.Radius();
|
||||
//
|
||||
aInfo.SetKindOfShape(GEOMAlgo_KS_CYLINDER);
|
||||
aInfo.SetKindOfName(GEOMAlgo_KN_CYLINDER);
|
||||
aInfo.SetLocation(aP0);
|
||||
aInfo.SetPosition(aAx3);
|
||||
aInfo.SetRadius1(aR1);
|
||||
//
|
||||
if (aNbWires>1) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
|
||||
bInfU1=Precision::IsNegativeInfinite(aUMin);
|
||||
bInfU2=Precision::IsPositiveInfinite(aUMax);
|
||||
@ -420,30 +403,31 @@
|
||||
bInf=(bInfU1 || bInfU2 || bInfV1 || bInfV2);
|
||||
if (bInf) {
|
||||
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);
|
||||
}
|
||||
//
|
||||
//||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
// 4. Cone
|
||||
else if (aST==GeomAbs_Cone) {
|
||||
Standard_Real aSemiAngle;
|
||||
gp_Cone aCone;
|
||||
//
|
||||
aCone=aGAS.Cone();
|
||||
aP0=aCone.Location();
|
||||
aAx3=aCone.Position();
|
||||
//aR1=aCyl.Radius();
|
||||
//
|
||||
aInfo.SetKindOfShape(GEOMAlgo_KS_CONE);
|
||||
aInfo.SetKindOfName(GEOMAlgo_KN_CONE);
|
||||
aInfo.SetLocation(aP0);
|
||||
aInfo.SetPosition(aAx3);
|
||||
//aInfo.SetRadius1(aR1);
|
||||
//
|
||||
if (aNbWires>1) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
|
||||
bInfU1=Precision::IsNegativeInfinite(aUMin);
|
||||
@ -454,13 +438,20 @@
|
||||
bInf=(bInfU1 || bInfU2 || bInfV1 || bInfV2);
|
||||
if (bInf) {
|
||||
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);
|
||||
}
|
||||
//
|
||||
//||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
// 5. Torus
|
||||
else if (aST==GeomAbs_Torus) {
|
||||
gp_Torus aTorus;
|
||||
@ -472,15 +463,12 @@
|
||||
aR2=aTorus.MinorRadius();
|
||||
//
|
||||
aInfo.SetKindOfShape(GEOMAlgo_KS_TORUS);
|
||||
aInfo.SetKindOfName(GEOMAlgo_KN_TORUS);
|
||||
aInfo.SetLocation(aP0);
|
||||
aInfo.SetPosition(aAx3);
|
||||
aInfo.SetRadius1(aR1);
|
||||
aInfo.SetRadius2(aR2);
|
||||
//
|
||||
if (aNbWires>1) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
|
||||
//
|
||||
FillDetails(aF, aTorus);
|
||||
@ -535,7 +523,6 @@ void GEOMAlgo_ShapeInfoFiller::FillEdge(const TopoDS_Shape& aS)
|
||||
FillSubShapes(aS);
|
||||
return;
|
||||
}
|
||||
//modified by NIZNHY-PKV Tue Jul 03 10:19:03 2012f
|
||||
// BSplineCurve
|
||||
if (aCT==GeomAbs_BSplineCurve) {
|
||||
Standard_Integer aNbKnots, aNbPoles, aDegree;
|
||||
@ -577,7 +564,6 @@ void GEOMAlgo_ShapeInfoFiller::FillEdge(const TopoDS_Shape& aS)
|
||||
aInfo.SetDirection(aDir);
|
||||
}
|
||||
}
|
||||
//modified by NIZNHY-PKV Tue Jul 03 10:19:06 2012t
|
||||
// Line
|
||||
else if (aCT==GeomAbs_Line) {
|
||||
Standard_Boolean bInf1, bInf2;
|
||||
@ -712,7 +698,7 @@ void GEOMAlgo_ShapeInfoFiller::FillEdge(const TopoDS_Shape& aS)
|
||||
//function :FillVertex
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfoFiller::FillVertex(const TopoDS_Shape& aS)
|
||||
void GEOMAlgo_ShapeInfoFiller::FillVertex(const TopoDS_Shape& aS)
|
||||
{
|
||||
myErrorStatus=0;
|
||||
//
|
||||
@ -739,8 +725,8 @@ void GEOMAlgo_ShapeInfoFiller::FillEdge(const TopoDS_Shape& aS)
|
||||
//function : FillNbSubshapes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfoFiller::FillNbSubShapes(const TopoDS_Shape& aS,
|
||||
GEOMAlgo_ShapeInfo& aInfo)
|
||||
void GEOMAlgo_ShapeInfoFiller::FillNbSubShapes(const TopoDS_Shape& aS,
|
||||
GEOMAlgo_ShapeInfo& aInfo)
|
||||
{
|
||||
myErrorStatus=0;
|
||||
//
|
||||
@ -776,7 +762,8 @@ void GEOMAlgo_ShapeInfoFiller::FillEdge(const TopoDS_Shape& aS)
|
||||
//function :NbShells
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer GEOMAlgo_ShapeInfoFiller::NbShells(const TopoDS_Solid& aSd)
|
||||
Standard_Integer GEOMAlgo_ShapeInfoFiller::NbShells
|
||||
(const TopoDS_Solid& aSd)
|
||||
{
|
||||
Standard_Integer iCnt;
|
||||
TopoDS_Iterator aIt;
|
||||
@ -785,7 +772,6 @@ Standard_Integer GEOMAlgo_ShapeInfoFiller::NbShells(const TopoDS_Solid& aSd)
|
||||
//
|
||||
aIt.Initialize(aSd);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
//const TopoDS_Shape& aSh=aIt.Value();
|
||||
++iCnt;
|
||||
}
|
||||
return iCnt;
|
||||
@ -794,7 +780,8 @@ Standard_Integer GEOMAlgo_ShapeInfoFiller::NbShells(const TopoDS_Solid& aSd)
|
||||
//function : NbWires
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer GEOMAlgo_ShapeInfoFiller::NbWires(const TopoDS_Face& aF)
|
||||
Standard_Integer GEOMAlgo_ShapeInfoFiller::NbWires
|
||||
(const TopoDS_Face& aF)
|
||||
{
|
||||
Standard_Integer iCnt;
|
||||
TopoDS_Iterator aIt;
|
||||
@ -803,7 +790,6 @@ Standard_Integer GEOMAlgo_ShapeInfoFiller::NbWires(const TopoDS_Face& aF)
|
||||
//
|
||||
aIt.Initialize(aF);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
//const TopoDS_Shape& aW=aIt.Value();
|
||||
++iCnt;
|
||||
}
|
||||
return iCnt;
|
||||
@ -812,7 +798,8 @@ Standard_Integer GEOMAlgo_ShapeInfoFiller::NbWires(const TopoDS_Face& aF)
|
||||
//function : IsAllowedType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean GEOMAlgo_ShapeInfoFiller::IsAllowedType(const GeomAbs_CurveType aCT)
|
||||
Standard_Boolean GEOMAlgo_ShapeInfoFiller::IsAllowedType
|
||||
(const GeomAbs_CurveType aCT)
|
||||
{
|
||||
Standard_Boolean bRet;
|
||||
Standard_Integer i, aNb;
|
||||
@ -820,7 +807,7 @@ Standard_Boolean GEOMAlgo_ShapeInfoFiller::IsAllowedType(const GeomAbs_CurveType
|
||||
GeomAbs_Line,
|
||||
GeomAbs_Circle,
|
||||
GeomAbs_Ellipse,
|
||||
GeomAbs_BSplineCurve //modified by NIZNHY-PKV Tue Jul 03 10:18:01 2012ft
|
||||
GeomAbs_BSplineCurve
|
||||
};
|
||||
//
|
||||
bRet=Standard_False;
|
||||
@ -834,7 +821,8 @@ Standard_Boolean GEOMAlgo_ShapeInfoFiller::IsAllowedType(const GeomAbs_CurveType
|
||||
//function : IsAllowedType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean GEOMAlgo_ShapeInfoFiller::IsAllowedType(const GeomAbs_SurfaceType aST)
|
||||
Standard_Boolean GEOMAlgo_ShapeInfoFiller::IsAllowedType
|
||||
(const GeomAbs_SurfaceType aST)
|
||||
{
|
||||
Standard_Boolean bRet;
|
||||
Standard_Integer i, aNb;
|
||||
|
@ -68,10 +68,12 @@ static
|
||||
void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Solid& aSd)
|
||||
{
|
||||
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;
|
||||
TopTools_IndexedMapOfShape aMF;
|
||||
GEOMAlgo_KindOfName aKNF;
|
||||
GEOMAlgo_KindOfDef aKD;
|
||||
//
|
||||
GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aSd);
|
||||
aInfo.SetKindOfName(GEOMAlgo_KN_UNKNOWN);
|
||||
@ -83,7 +85,26 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Solid& aSd)
|
||||
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) {
|
||||
// mb: sphere, torus
|
||||
const TopoDS_Shape& aF=aMF(1);
|
||||
GEOMAlgo_ShapeInfo& aInfoF=myMapInfo.ChangeFromKey(aF);
|
||||
aKNF=aInfoF.KindOfName(); // mb: sphere, torus
|
||||
@ -99,7 +120,6 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Solid& aSd)
|
||||
return;
|
||||
}
|
||||
}
|
||||
//modified by NIZNHY-PKV Tue Jul 03 13:23:55 2012f
|
||||
else if (aNbF==2) {
|
||||
// specific solid that should be treated as a sphere
|
||||
bIsStepSphere=TreatStepSphere(aSd);
|
||||
@ -107,7 +127,6 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Solid& aSd)
|
||||
return;
|
||||
}
|
||||
}
|
||||
//modified by NIZNHY-PKV Tue Jul 03 13:23:57 2012t
|
||||
//
|
||||
aNbCyl=0;
|
||||
aNbCon=0;
|
||||
@ -229,11 +248,9 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Solid& aSd)
|
||||
const gp_Dir& aDNj=aIFj.Position().Direction();
|
||||
//
|
||||
aDot=aDNi*aDNj;
|
||||
//modified by NIZNHY-PKV Tue Jul 03 10:01:56 2012f
|
||||
if (aDot<0.) {
|
||||
aDot=-aDot;
|
||||
}
|
||||
//modified by NIZNHY-PKV Tue Jul 03 10:01:52 2012t
|
||||
if (fabs(1.-aDot)<0.0001) {
|
||||
aMp.Add(i);
|
||||
aMp.Add(j);
|
||||
@ -248,6 +265,8 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Solid& aSd)
|
||||
return;
|
||||
}
|
||||
//
|
||||
iMin=-1;
|
||||
iMax=-1;
|
||||
aDistMin=1.e15;
|
||||
aDistMax=-aDistMin;
|
||||
for (i=0; i<aNbFi; ++i) {
|
||||
@ -308,21 +327,10 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
|
||||
TopTools_IndexedMapOfShape aMV;
|
||||
BRepTools_WireExplorer aWExp;
|
||||
GEOMAlgo_KindOfName aKN, aKNE;
|
||||
GEOMAlgo_KindOfShape aKS;
|
||||
//
|
||||
GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF);
|
||||
aKN=GEOMAlgo_KN_UNKNOWN;
|
||||
aInfo.SetKindOfName(GEOMAlgo_KN_UNKNOWN);
|
||||
//
|
||||
aKS=aInfo.KindOfShape();
|
||||
if (aKS!=GEOMAlgo_KS_PLANE) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
if (aInfo.KindOfBounds()==GEOMAlgo_KB_INFINITE) {
|
||||
aInfo.SetKindOfName(GEOMAlgo_KN_PLANE);
|
||||
return;
|
||||
}
|
||||
aInfo.SetKindOfDef(GEOMAlgo_KD_ARBITRARY);
|
||||
//
|
||||
aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
|
||||
aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
|
||||
@ -330,9 +338,8 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
|
||||
// 1. may be it is circle/ellipse
|
||||
if (aNbV==1 && aNbE==1) {
|
||||
aExp.Init(aF, TopAbs_EDGE);
|
||||
for (; aExp.More(); aExp.Next()) {
|
||||
if (aExp.More()) {
|
||||
aE=aExp.Current();
|
||||
break;
|
||||
}
|
||||
//
|
||||
const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
|
||||
@ -343,6 +350,7 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
|
||||
aInfo.SetRadius1(aInfoE.Radius1());
|
||||
aInfo.SetLocation(aInfoE.Location());
|
||||
aInfo.SetPosition(aInfoE.Position());
|
||||
aInfo.SetKindOfDef(GEOMAlgo_KD_SPECIFIED);
|
||||
}
|
||||
if (aKNE==GEOMAlgo_KN_ELLIPSE) {
|
||||
aKN=GEOMAlgo_KN_DISKELLIPSE;
|
||||
@ -351,22 +359,29 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
|
||||
aInfo.SetRadius2(aInfoE.Radius2());
|
||||
aInfo.SetLocation(aInfoE.Location());
|
||||
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
|
||||
else {
|
||||
aExp.Init(aF, TopAbs_EDGE);
|
||||
for (; aExp.More(); aExp.Next()) {
|
||||
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 (bSegment) {
|
||||
// 2. may be it is TRIANGLE, POLYGON, QUADRANGLE, RECTANGLE
|
||||
aInfo.SetKindOfDef(GEOMAlgo_KD_SPECIFIED);
|
||||
aInfo.SetKindOfName(GEOMAlgo_KN_POLYGON);
|
||||
//
|
||||
if (aNbV==3 && aNbE==3) {
|
||||
aInfo.SetKindOfName(GEOMAlgo_KN_TRIANGLE);
|
||||
@ -393,266 +408,126 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
|
||||
//
|
||||
aInfo.SetLocation(aPc);
|
||||
aInfo.SetPosition(aAx3);
|
||||
//
|
||||
return;
|
||||
}
|
||||
} // if (aNbV==3 && aNbE==3) {
|
||||
//
|
||||
if (!(aNbV==4 && aNbE==4)) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
// 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;
|
||||
if (aNbV==4 && aNbE==4) {
|
||||
aIt.Initialize(aF);
|
||||
if (aIt.More()) {
|
||||
aW=*((TopoDS_Wire*)&aIt.Value());
|
||||
}
|
||||
}
|
||||
//
|
||||
// rectangle
|
||||
aInfo.SetKindOfName(GEOMAlgo_KN_RECTANGLE);
|
||||
//
|
||||
// shift location to the center and calc. sizes
|
||||
aXYZc.SetCoord(0.,0.,0.);
|
||||
TopExp::MapShapes(aF, TopAbs_VERTEX, aMV);
|
||||
for (i=1; i<=aNbV; ++i) {
|
||||
const TopoDS_Vertex& aV=TopoDS::Vertex(aMV(i));
|
||||
aP=BRep_Tool::Pnt(aV);
|
||||
const gp_XYZ& aXYZ=aP.XYZ();
|
||||
aXYZc=aXYZc+aXYZ;
|
||||
}
|
||||
//
|
||||
// Location : aPc in center of rectangle
|
||||
// Position : 0z is plane normal
|
||||
// 0x is along length
|
||||
//
|
||||
aXYZc.Divide(4.);
|
||||
aPc.SetXYZ(aXYZc);
|
||||
//
|
||||
gp_Lin aL0(aPx[0], aDx[0]);
|
||||
gp_Lin aL1(aPx[1], aDx[1]);
|
||||
//
|
||||
aD0=aL0.Distance(aPc);
|
||||
aD1=aL1.Distance(aPc);
|
||||
//
|
||||
aLength=aD0;
|
||||
aWidth =aD1;
|
||||
aDX=aL1.Direction();
|
||||
if (aD0<aD1) {
|
||||
aLength=aD1;
|
||||
aWidth =aD0;
|
||||
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);
|
||||
}
|
||||
|
||||
return;
|
||||
//
|
||||
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;
|
||||
}
|
||||
}
|
||||
//
|
||||
// rectangle
|
||||
aInfo.SetKindOfName(GEOMAlgo_KN_RECTANGLE);
|
||||
//
|
||||
// shift location to the center and calc. sizes
|
||||
aXYZc.SetCoord(0.,0.,0.);
|
||||
TopExp::MapShapes(aF, TopAbs_VERTEX, aMV);
|
||||
for (i=1; i<=aNbV; ++i) {
|
||||
const TopoDS_Vertex& aV=TopoDS::Vertex(aMV(i));
|
||||
aP=BRep_Tool::Pnt(aV);
|
||||
const gp_XYZ& aXYZ=aP.XYZ();
|
||||
aXYZc=aXYZc+aXYZ;
|
||||
}
|
||||
//
|
||||
// Location : aPc in center of rectangle
|
||||
// Position : 0z is plane normal
|
||||
// 0x is along length
|
||||
//
|
||||
aXYZc.Divide(4.);
|
||||
aPc.SetXYZ(aXYZc);
|
||||
//
|
||||
gp_Lin aL0(aPx[0], aDx[0]);
|
||||
gp_Lin aL1(aPx[1], aDx[1]);
|
||||
//
|
||||
aD0=aL0.Distance(aPc);
|
||||
aD1=aL1.Distance(aPc);
|
||||
//
|
||||
aLength=aD0;
|
||||
aWidth =aD1;
|
||||
aDX=aL1.Direction();
|
||||
if (aD0<aD1) {
|
||||
aLength=aD1;
|
||||
aWidth =aD0;
|
||||
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
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
|
||||
const gp_Sphere& )
|
||||
const gp_Sphere& )//aSph)
|
||||
{
|
||||
|
||||
Standard_Integer aNbV, aNbE, aNbSE, aNbDE;
|
||||
TopoDS_Edge aE;
|
||||
TopExp_Explorer aExp;
|
||||
TopTools_MapOfShape aM;
|
||||
GEOMAlgo_KindOfShape aKS, aKSE;
|
||||
GEOMAlgo_KindOfShape aKSE;//, aKSE;
|
||||
//
|
||||
GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF);
|
||||
aInfo.SetKindOfName(GEOMAlgo_KN_UNKNOWN);
|
||||
//
|
||||
aKS=aInfo.KindOfShape();
|
||||
if (aKS!=GEOMAlgo_KS_SPHERE) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
//
|
||||
aInfo.SetKindOfDef(GEOMAlgo_KD_ARBITRARY);
|
||||
aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
|
||||
aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
|
||||
if (!(aNbV==2 && aNbE==3)) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
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);
|
||||
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();
|
||||
if (aNbV==2 && aNbE==3) {
|
||||
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);
|
||||
aKSE=aInfoE.KindOfShape();
|
||||
//
|
||||
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)) {
|
||||
++aNbSE;
|
||||
}
|
||||
}
|
||||
else if (aKSE==GEOMAlgo_KS_DEGENERATED) {
|
||||
aIt.Initialize(aE);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
aVD=TopoDS::Vertex(aIt.Value());
|
||||
break;
|
||||
else if (aKSE==GEOMAlgo_KS_DEGENERATED) {
|
||||
++aNbDE;
|
||||
}
|
||||
//
|
||||
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
|
||||
@ -660,6 +535,7 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
|
||||
//=======================================================================
|
||||
void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
|
||||
const gp_Cylinder& aCyl)
|
||||
|
||||
{
|
||||
Standard_Integer i, aNbV, aNbE, aNbCE, aNbSE;
|
||||
Standard_Real aT0, aT1, aHeight;
|
||||
@ -667,78 +543,185 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
|
||||
TopoDS_Edge aE;
|
||||
TopExp_Explorer aExp;
|
||||
TopTools_MapOfShape aM;
|
||||
GEOMAlgo_KindOfShape aKS;
|
||||
GEOMAlgo_KindOfName aKN, aKNE;
|
||||
GEOMAlgo_KindOfName aKNE;
|
||||
GEOMAlgo_KindOfClosed aKCE;
|
||||
//
|
||||
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);
|
||||
aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
|
||||
if (!(aNbV==2 && aNbE==3)) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
i=0;
|
||||
aNbCE=0;
|
||||
aNbSE=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();
|
||||
if (aKNE==GEOMAlgo_KN_CIRCLE && aKCE==GEOMAlgo_KC_CLOSED) {
|
||||
aPC[aNbCE]=aInfoE.Location();
|
||||
++aNbCE;
|
||||
}
|
||||
else if (aKNE==GEOMAlgo_KN_SEGMENT) {
|
||||
if (BRep_Tool::IsClosed(aE, aF)) {
|
||||
++aNbSE;
|
||||
if (aNbV==2 && aNbE==3) {
|
||||
const gp_Ax1& aAx1=aCyl.Axis();
|
||||
const gp_Dir& aDir=aAx1.Direction();
|
||||
const gp_Pnt& aPLoc=aAx1.Location();
|
||||
//
|
||||
i=0;
|
||||
aNbCE=0;
|
||||
aNbSE=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();
|
||||
if (aKNE==GEOMAlgo_KN_CIRCLE && aKCE==GEOMAlgo_KC_CLOSED) {
|
||||
aPC[aNbCE]=aInfoE.Location();
|
||||
++aNbCE;
|
||||
}
|
||||
else if (aKNE==GEOMAlgo_KN_SEGMENT) {
|
||||
if (BRep_Tool::IsClosed(aE, aF)) {
|
||||
++aNbSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
if (!(aNbCE==2 && aNbSE==1)) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
const gp_Ax1& aAx1=aCyl.Axis();
|
||||
const gp_Dir& aDir=aAx1.Direction();
|
||||
const gp_Pnt& aPLoc=aAx1.Location();
|
||||
gp_Lin aLin(aPLoc, aDir);
|
||||
//
|
||||
aT0=ElCLib::Parameter(aLin, aPC[0]);
|
||||
aT1=ElCLib::Parameter(aLin, aPC[1]);
|
||||
//
|
||||
aPc=aPC[0];;
|
||||
if (aT0>aT1) {
|
||||
aPc=aPC[1];
|
||||
}
|
||||
aHeight=aPC[0].Distance(aPC[1]);
|
||||
//
|
||||
gp_Ax3 aAx3=aCyl.Position();
|
||||
aAx3.SetLocation(aPc);
|
||||
//
|
||||
aInfo.SetKindOfName(GEOMAlgo_KN_CYLINDER);
|
||||
aInfo.SetPosition(aAx3);
|
||||
aInfo.SetLocation(aPc);
|
||||
aInfo.SetHeight(aHeight);
|
||||
//
|
||||
if (aNbCE==2 && aNbSE==1) {
|
||||
gp_Lin aLin(aPLoc, aDir);
|
||||
//
|
||||
aT0=ElCLib::Parameter(aLin, aPC[0]);
|
||||
aT1=ElCLib::Parameter(aLin, aPC[1]);
|
||||
//
|
||||
aPc=aPC[0];
|
||||
if (aT0>aT1) {
|
||||
aPc=aPC[1];
|
||||
}
|
||||
aHeight=aPC[0].Distance(aPC[1]);
|
||||
//
|
||||
gp_Ax3 aAx3=aCyl.Position();
|
||||
aAx3.SetLocation(aPc);
|
||||
//
|
||||
aInfo.SetPosition(aAx3);
|
||||
aInfo.SetLocation(aPc);
|
||||
aInfo.SetHeight(aHeight);
|
||||
//
|
||||
aInfo.SetKindOfDef(GEOMAlgo_KD_SPECIFIED);
|
||||
return; // conventional cylinder
|
||||
}//if (aNbCE==2 && aNbSE==1) {
|
||||
}//if (aNbV==2 && aNbE==3) {
|
||||
}
|
||||
//=======================================================================
|
||||
//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
|
||||
//purpose :
|
||||
@ -746,6 +729,7 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
|
||||
void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
|
||||
const gp_Torus& )
|
||||
{
|
||||
|
||||
Standard_Integer aNbV, aNbE, aNbSE;
|
||||
TopoDS_Edge aE;
|
||||
TopExp_Explorer aExp;
|
||||
@ -753,42 +737,39 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
|
||||
GEOMAlgo_KindOfShape aKS;
|
||||
//
|
||||
GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF);
|
||||
aInfo.SetKindOfName(GEOMAlgo_KN_UNKNOWN);
|
||||
aInfo.SetKindOfDef(GEOMAlgo_KD_ARBITRARY);
|
||||
//
|
||||
aKS=aInfo.KindOfShape();
|
||||
if (aKS!=GEOMAlgo_KS_TORUS) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
|
||||
aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
|
||||
aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
|
||||
if (!(aNbV==1 && aNbE==2)) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
aNbSE=0;
|
||||
aExp.Init(aF, TopAbs_EDGE);
|
||||
for (; aExp.More(); aExp.Next()) {
|
||||
aE=TopoDS::Edge(aExp.Current());
|
||||
if (aM.Add(aE)) {
|
||||
if (BRep_Tool::IsClosed(aE, aF)) {
|
||||
++aNbSE;
|
||||
aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
|
||||
|
||||
if (aNbV==1 && aNbE==2) {
|
||||
aNbSE=0;
|
||||
aExp.Init(aF, TopAbs_EDGE);
|
||||
for (; aExp.More(); aExp.Next()) {
|
||||
aE=TopoDS::Edge(aExp.Current());
|
||||
if (aM.Add(aE)) {
|
||||
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
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean
|
||||
GEOMAlgo_ShapeInfoFiller::TreatStepSphere(const TopoDS_Solid& aSd)
|
||||
Standard_Boolean GEOMAlgo_ShapeInfoFiller::TreatStepSphere
|
||||
(const TopoDS_Solid& aSd)
|
||||
{
|
||||
Standard_Boolean bRet, bIsAllowedType, bOnlyClosed, bIsEqual;
|
||||
Standard_Integer j;
|
||||
@ -899,4 +880,3 @@ Standard_Boolean IsEqual(const gp_Sphere& aSp1,
|
||||
//
|
||||
return bRet;
|
||||
}
|
||||
//modified by NIZNHY-PKV Tue Jul 03 13:29:43 2012t
|
||||
|
@ -245,7 +245,7 @@ void GEOMAlgo_ShellSolid::Perform()
|
||||
const BOPDS_IndexRange& aRange=pDS->Range(iRank);
|
||||
aRange.Indices(iBeg, iEnd);
|
||||
const TopoDS_Solid& aSolid=(!iRank) ? *((TopoDS_Solid*)&aTool) : *((TopoDS_Solid*)&aObj);
|
||||
BRepClass3d_SolidClassifier& aSC=aCtx->SolidClassifier(aSolid);
|
||||
//BRepClass3d_SolidClassifier& aSC=aCtx->SolidClassifier(aSolid);
|
||||
//
|
||||
//------------------------------ShellSolidBuilder
|
||||
GEOMAlgo_ShellSolidBuilder aSSB;
|
||||
@ -264,50 +264,50 @@ void GEOMAlgo_ShellSolid::Perform()
|
||||
const TopoDS_Shape& aS=pDS->Shape(i);
|
||||
aType=aS.ShapeType();
|
||||
if (aType!=TopAbs_FACE) {
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
//
|
||||
aState=TopAbs_UNKNOWN;
|
||||
aF=*((TopoDS_Face*)&aS);
|
||||
//
|
||||
if (!aImages.IsBound(aS)) {
|
||||
iErr=GEOMAlgo_AlgoTools::PntInFace(aF, aP, aP2D);
|
||||
if (iErr) {
|
||||
myErrorStatus=16;
|
||||
return;
|
||||
}
|
||||
//
|
||||
aState=BOPTools_AlgoTools::ComputeState(aP, aSolid, aTol, aCtx);
|
||||
iErr=GEOMAlgo_AlgoTools::PntInFace(aF, aP, aP2D);
|
||||
if (iErr) {
|
||||
myErrorStatus=16;
|
||||
return;
|
||||
}
|
||||
//
|
||||
aState=BOPTools_AlgoTools::ComputeState(aP, aSolid, aTol, aCtx);
|
||||
}
|
||||
else {
|
||||
const BOPCol_ListOfShape& aLSp=aImages.Find(aS);
|
||||
aNbSp=aLSp.Extent();
|
||||
if (aNbSp>0) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
if (aNbSp==1) {
|
||||
aF=*((TopoDS_Face*)&aLSp.First());
|
||||
}
|
||||
//
|
||||
iErr=GEOMAlgo_AlgoTools::PntInFace(aF, aP, aP2D);
|
||||
if (iErr) {
|
||||
myErrorStatus=16;
|
||||
return;
|
||||
}
|
||||
//
|
||||
aState=BOPTools_AlgoTools::ComputeState(aP, aSolid, aTol, aCtx);
|
||||
const BOPCol_ListOfShape& aLSp=aImages.Find(aS);
|
||||
aNbSp=aLSp.Extent();
|
||||
if (aNbSp>0) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
if (aNbSp==1) {
|
||||
aF=*((TopoDS_Face*)&aLSp.First());
|
||||
}
|
||||
//
|
||||
iErr=GEOMAlgo_AlgoTools::PntInFace(aF, aP, aP2D);
|
||||
if (iErr) {
|
||||
myErrorStatus=16;
|
||||
return;
|
||||
}
|
||||
//
|
||||
aState=BOPTools_AlgoTools::ComputeState(aP, aSolid, aTol, aCtx);
|
||||
}
|
||||
//----------
|
||||
if (aState==TopAbs_ON) {
|
||||
myLSON.Append(aF);
|
||||
myLSON.Append(aF);
|
||||
}
|
||||
else if (aState==TopAbs_OUT) {
|
||||
myLSOUT.Append(aF);
|
||||
myLSOUT.Append(aF);
|
||||
}
|
||||
else if (aState==TopAbs_IN) {
|
||||
myLSIN.Append(aF);
|
||||
}
|
||||
myLSIN.Append(aF);
|
||||
}
|
||||
//----------
|
||||
}//for (i=iBeg; i<=iEnd; ++i) {
|
||||
|
||||
|
2
src/GEOMAlgo/GEOMAlgo_Splitter.cxx
Executable file → Normal file
2
src/GEOMAlgo/GEOMAlgo_Splitter.cxx
Executable file → Normal file
@ -301,7 +301,7 @@ void TreatCompound(const TopoDS_Shape& aC1,
|
||||
TopoDS_Iterator aItC;
|
||||
//
|
||||
aLC.Append (aC1);
|
||||
while(1) {
|
||||
for(;;) {
|
||||
aLC1.Clear();
|
||||
aIt.Initialize(aLC);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
|
@ -48,10 +48,11 @@
|
||||
//function : GetState
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer GEOMAlgo_SurfaceTools::GetState(const gp_Pnt& aP,
|
||||
const GeomAdaptor_Surface& aGAS,
|
||||
const Standard_Real aTol,
|
||||
TopAbs_State& aState)
|
||||
Standard_Integer GEOMAlgo_SurfaceTools::GetState
|
||||
(const gp_Pnt& aP,
|
||||
const GeomAdaptor_Surface& aGAS,
|
||||
const Standard_Real aTol,
|
||||
TopAbs_State& aState)
|
||||
{
|
||||
Standard_Integer iErr = 0;
|
||||
GeomAbs_SurfaceType aType = aGAS.GetType();
|
||||
@ -95,10 +96,11 @@
|
||||
//function : GetState
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer GEOMAlgo_SurfaceTools::GetState(const gp_Pnt& aP,
|
||||
const Handle(Geom_Surface)& aSurf,
|
||||
const Standard_Real aTol,
|
||||
TopAbs_State& aState)
|
||||
Standard_Integer GEOMAlgo_SurfaceTools::GetState
|
||||
(const gp_Pnt& aP,
|
||||
const Handle(Geom_Surface)& aSurf,
|
||||
const Standard_Real aTol,
|
||||
TopAbs_State& aState)
|
||||
{
|
||||
Standard_Integer iErr;
|
||||
GeomAdaptor_Surface aGAS;
|
||||
@ -114,7 +116,8 @@
|
||||
//function : ReverseState
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
TopAbs_State GEOMAlgo_SurfaceTools::ReverseState(const TopAbs_State aState)
|
||||
TopAbs_State GEOMAlgo_SurfaceTools::ReverseState
|
||||
(const TopAbs_State aState)
|
||||
{
|
||||
TopAbs_State aRSt=aState;
|
||||
//
|
||||
@ -135,10 +138,11 @@
|
||||
//function : IsCoaxial
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean GEOMAlgo_SurfaceTools::IsCoaxial(const gp_Pnt& aP1,
|
||||
const gp_Pnt& aP2,
|
||||
const gp_Cylinder& aCyl,
|
||||
const Standard_Real aTol)
|
||||
Standard_Boolean GEOMAlgo_SurfaceTools::IsCoaxial
|
||||
(const gp_Pnt& aP1,
|
||||
const gp_Pnt& aP2,
|
||||
const gp_Cylinder& aCyl,
|
||||
const Standard_Real aTol)
|
||||
{
|
||||
const gp_XYZ &aLoc = aCyl.Location().XYZ();
|
||||
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);
|
||||
Standard_Real aDot1 = 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.
|
||||
aDP1.Subtract(aDAxis.Multiplied(aDot1));
|
||||
@ -160,7 +164,7 @@ Standard_Boolean GEOMAlgo_SurfaceTools::IsCoaxial(const gp_Pnt& aP1,
|
||||
if (fabs(aRadius1 - aRadius2) <= aTol) {
|
||||
// Check the deflection of the middle point.
|
||||
gp_XYZ aMidP = 0.5*(aDP1 + aDP2);
|
||||
Standard_Real aMidRadius1 = aMidP.Modulus();
|
||||
//Standard_Real aMidRadius1 = aMidP.Modulus();
|
||||
|
||||
if (fabs(aRadius1 - aRadius2) <= aTol) {
|
||||
isOn = Standard_True;
|
||||
@ -173,7 +177,8 @@ Standard_Boolean GEOMAlgo_SurfaceTools::IsCoaxial(const gp_Pnt& aP1,
|
||||
//function : IsAnalytic
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean GEOMAlgo_SurfaceTools::IsAnalytic(const Handle(Geom_Surface)& aSurf)
|
||||
Standard_Boolean GEOMAlgo_SurfaceTools::IsAnalytic
|
||||
(const Handle(Geom_Surface)& aSurf)
|
||||
{
|
||||
Standard_Boolean bRet;
|
||||
GeomAbs_SurfaceType aType;
|
||||
@ -190,8 +195,9 @@ Standard_Boolean GEOMAlgo_SurfaceTools::IsAnalytic(const Handle(Geom_Surface)& a
|
||||
//function : IsConformState
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean GEOMAlgo_SurfaceTools::IsConformState(const TopAbs_State aST1,
|
||||
const GEOMAlgo_State aST2)
|
||||
Standard_Boolean GEOMAlgo_SurfaceTools::IsConformState
|
||||
(const TopAbs_State aST1,
|
||||
const GEOMAlgo_State aST2)
|
||||
{
|
||||
Standard_Boolean bRet=Standard_False;
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user