当前位置: 首页>>代码示例>>C++>>正文


C++ TopoDS_Iterator::Initialize方法代码示例

本文整理汇总了C++中TopoDS_Iterator::Initialize方法的典型用法代码示例。如果您正苦于以下问题:C++ TopoDS_Iterator::Initialize方法的具体用法?C++ TopoDS_Iterator::Initialize怎么用?C++ TopoDS_Iterator::Initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TopoDS_Iterator的用法示例。


在下文中一共展示了TopoDS_Iterator::Initialize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

//=======================================================================
//function : BuildResult
//purpose  :
//=======================================================================
void GEOMAlgo_Gluer2::BuildResult()
{
  Standard_Boolean bHasImage;
  TopoDS_Shape aCnew, aCXnew;
  TopoDS_Iterator aItC;
  BRep_Builder aBB;
  //
  myErrorStatus=0;
  myWarningStatus=0;
  //
  aItC.Initialize(myArgument);
  for (; aItC.More(); aItC.Next()) {
    const TopoDS_Shape& aCx=aItC.Value();
    bHasImage=HasImage(aCx);
    if (bHasImage) {
      break;
    }
  }
  //
  if (!bHasImage) {
    myShape=myArgument;
    return;
  }
  //
  GEOMAlgo_Tools3D::MakeContainer(TopAbs_COMPOUND, aCnew);
  //
  aItC.Initialize(myArgument);
  for (; aItC.More(); aItC.Next()) {
    const TopoDS_Shape& aCX=aItC.Value();
    if (myOrigins.IsBound(aCX)) {
      aCXnew=myOrigins.Find(aCX);
      aCXnew.Orientation(aCX.Orientation());
      aBB.Add(aCnew, aCXnew);
    }
    else {
      aBB.Add(aCnew, aCX);
    }
  }
  //
  if (!myKeepNonSolids) {
    Standard_Integer i, aNb;
    TopoDS_Shape aCnew1;
    TopTools_IndexedMapOfShape aM;
    //
    GEOMAlgo_Tools3D::MakeContainer(TopAbs_COMPOUND, aCnew1);
    //
    TopExp::MapShapes(aCnew, TopAbs_SOLID, aM);

    aNb=aM.Extent();
    for (i=1; i<=aNb; ++i) {
      const TopoDS_Shape& aS=aM(i);
      aBB.Add(aCnew1, aS);
    }
    aCnew=aCnew1;
  }
  //
  myShape=aCnew;
}
开发者ID:triggerfish1,项目名称:pythonocc,代码行数:62,代码来源:GEOMAlgo_Gluer2.cpp

示例2: FillImagesCompound

//=======================================================================
//function : FillImagesCompound
//purpose  :
//=======================================================================
void FillImagesCompound(const TopoDS_Shape& theS,
                        BRepAlgo_Image& theImages,
                        TopTools_MapOfShape& theMFP)
{
    Standard_Boolean bInterferred;
    TopAbs_ShapeEnum aTypeX;
    TopAbs_Orientation aOrX;
    TopoDS_Iterator aIt;
    BRep_Builder aBB;
    TopTools_ListIteratorOfListOfShape aItIm;
    //
    if (!theMFP.Add(theS)) {
        return;
    }
    //
    bInterferred=Standard_False;
    aIt.Initialize(theS);
    for (; aIt.More(); aIt.Next()) {
        const TopoDS_Shape& aSX=aIt.Value();
        aTypeX=aSX.ShapeType();
        if (aTypeX==TopAbs_COMPOUND) {
            FillImagesCompound(aSX, theImages, theMFP);
        }
        if (theImages.HasImage(aSX)) {
            bInterferred=Standard_True;
        }
    }
    if (!bInterferred) {
        return;
    }
    //
    TopoDS_Shape aCIm;
    GEOMAlgo_Tools3D::MakeContainer(TopAbs_COMPOUND, aCIm);
    //
    aIt.Initialize(theS);
    for (; aIt.More(); aIt.Next()) {
        const TopoDS_Shape& aSX=aIt.Value();
        aOrX=aSX.Orientation();
        if (theImages.HasImage(aSX)) {
            const TopTools_ListOfShape& aLFIm=theImages.Image(aSX);
            aItIm.Initialize(aLFIm);
            for (; aItIm.More(); aItIm.Next()) {
                TopoDS_Shape aSXIm=aItIm.Value();
                aSXIm.Orientation(aOrX);
                aBB.Add(aCIm, aSXIm);
            }
        }
        else {
            aBB.Add(aCIm, aSX);
        }
    }
    theImages.Bind(theS, aCIm);
}
开发者ID:triggerfish1,项目名称:pythonocc,代码行数:57,代码来源:GEOMAlgo_Builder_1.cpp

示例3: CorrectWires

//=======================================================================
//function : CorrectWires
//purpose  :
//=======================================================================
  Standard_Boolean GEOMAlgo_Tools::CorrectWires(const TopoDS_Shape& aShape)
{
  Standard_Boolean bRet;
  TopoDS_Iterator aItF;
  TopExp_Explorer aExp;
  TopTools_MapOfShape aMF;
  GeomAdaptor_Surface aGAS;
  GeomAbs_SurfaceType aTS;
  TopLoc_Location aLoc;
  //
  bRet=Standard_False;
  //
  aExp.Init(aShape, TopAbs_FACE);
  for (; aExp.More(); aExp.Next()) {
    const TopoDS_Face& aF=*((TopoDS_Face*)&aExp.Current());
    if (aMF.Add(aF)) {
      const Handle(Geom_Surface)& aS=BRep_Tool::Surface(aF, aLoc);
      aGAS.Load(aS);
      aTS=aGAS.GetType();
      if (aTS==GeomAbs_Cylinder || aTS==GeomAbs_Plane) {
	aItF.Initialize(aF);
	for (; aItF.More(); aItF.Next()) {
	  const TopoDS_Wire& aW=*((TopoDS_Wire*)&aItF.Value());
	  if (CorrectWire(aW, aF)) {
	   bRet=Standard_True;
	  }
	}
      }
    }
  }
  return bRet;
}
开发者ID:triggerfish1,项目名称:pythonocc,代码行数:36,代码来源:GEOMAlgo_Tools_1.cpp

示例4: EdgePassKey

//=======================================================================
//function : EdgePassKey
//purpose  : 
//=======================================================================
void GEOMAlgo_GlueDetector::EdgePassKey(const TopoDS_Edge& aE, 
					GEOMAlgo_PassKeyShape& aPK)
{
  TopAbs_Orientation aOr;
  TopoDS_Shape aVR;
  TopoDS_Iterator aIt;
  TopTools_ListOfShape aLV;
  //
  aIt.Initialize(aE);
  for (; aIt.More(); aIt.Next()) {
    const TopoDS_Shape& aV=aIt.Value();
    aOr=aV.Orientation();
    if (aOr==TopAbs_FORWARD || aOr==TopAbs_REVERSED) {
      if (myOrigins.IsBound(aV)) {
	aVR=myOrigins.Find(aV);
      }
      else {
	aVR=aV;
      }
      aLV.Append(aVR);
    }
  }
  //
  aPK.SetShapes(aLV);
}
开发者ID:dbarbier,项目名称:pythonocc,代码行数:29,代码来源:GEOMAlgo_GlueDetector.cpp

示例5: MapShapes

//=======================================================================
//function : MapShapes
//purpose  :
//=======================================================================
void MapShapes(const TopoDS_Shape& theS,
               TopTools_MapOfShape& theM)
{
    theM.Add(theS);
    TopoDS_Iterator anIt;
    anIt.Initialize(theS);
    for (; anIt.More(); anIt.Next()) {
        const TopoDS_Shape& aSx=anIt.Value();
        MapShapes(aSx, theM);
    }
}
开发者ID:triggerfish1,项目名称:pythonocc,代码行数:15,代码来源:GEOMAlgo_Builder_4.cpp

示例6: OwnInternalShapes

//=======================================================================
//function : OwnInternalShapes
//purpose  :
//=======================================================================
  void OwnInternalShapes(const TopoDS_Shape& theS,
                         TopTools_IndexedMapOfShape& theMx)
{
  TopoDS_Iterator aIt;
  //
  aIt.Initialize(theS);
  for (; aIt.More(); aIt.Next()) {
    const TopoDS_Shape& aSx=aIt.Value();
    if (aSx.ShapeType()!=TopAbs_SHELL) {
      theMx.Add(aSx);
    }
  }
}
开发者ID:triggerfish1,项目名称:pythonocc,代码行数:17,代码来源:GEOMAlgo_Builder_3.cpp

示例7: GetNextVertex

//=======================================================================
// function: GetNextVertex
// purpose: 
//=======================================================================
 void GetNextVertex(const TopoDS_Vertex& aV,
		    const TopoDS_Edge& aE,
		    TopoDS_Vertex& aV1)
{
  TopoDS_Iterator aIt;
  //
  aIt.Initialize(aE);
  for (; aIt.More(); aIt.Next()) {
    const TopoDS_Shape& aVx=aIt.Value();
    if (!aVx.IsEqual(aV)) {
      aV1=TopoDS::Vertex(aVx);
      return ;
    }
  }
  aV1=aV;
}
开发者ID:dbarbier,项目名称:pythonocc,代码行数:20,代码来源:GEOMAlgo_WireSplitter.cpp

示例8: Contains

// Modified  Thu Sep 14 14:35:18 2006
// Contribution of Samtech www.samcef.com BEGIN
//=======================================================================
//function : Contains
//purpose  :
//=======================================================================
Standard_Boolean Contains(const TopoDS_Edge& aE,
                          const TopoDS_Vertex& aV)
{
  Standard_Boolean bRet;
  TopoDS_Iterator aIt;
  //
  bRet=Standard_False;
  aIt.Initialize(aE);
  for (; aIt.More(); aIt.Next()) {
    const TopoDS_Shape& aVE=aIt.Value();
    if (aVE.IsSame(aV)) {
      bRet=!bRet;
      break;
    }
  }
  return bRet;
}
开发者ID:triggerfish1,项目名称:pythonocc,代码行数:23,代码来源:NMTTools_PaveFiller_2.cpp

示例9: FillCompound

//=======================================================================
//function : FillCompounds
//purpose  :
//=======================================================================
void GEOMAlgo_Gluer2::FillCompounds()
{
  TopAbs_ShapeEnum aType;
  TopoDS_Iterator aItC;
  //
  myErrorStatus=0;
  myWarningStatus=0;
  //
  aItC.Initialize(myArgument);
  for (; aItC.More(); aItC.Next()) {
    const TopoDS_Shape& aCx=aItC.Value();
    aType=aCx.ShapeType();
    if (aType==TopAbs_COMPOUND) {
      FillCompound(aCx);
    }
  }
}
开发者ID:triggerfish1,项目名称:pythonocc,代码行数:21,代码来源:GEOMAlgo_Gluer2.cpp

示例10: IsGrowthWire

//=======================================================================
//function : IsGrowthWire
//purpose  : 
//=======================================================================
Standard_Boolean IsGrowthWire(const TopoDS_Shape& theWire,
			      const TopTools_IndexedMapOfShape& theMHE)
{
  Standard_Boolean bRet;
  TopoDS_Iterator aIt;
  // 
  bRet=Standard_False;
  if (theMHE.Extent()) {
    aIt.Initialize(theWire);
    for(; aIt.More(); aIt.Next()) {
      const TopoDS_Shape& aE=aIt.Value();
      if (theMHE.Contains(aE)) {
	return !bRet;
      }
    }
  }
  return bRet;
}
开发者ID:dbarbier,项目名称:pythonocc,代码行数:22,代码来源:GEOMAlgo_BuilderFace.cpp

示例11:

//=======================================================================
// function:  Coord2dVf
// purpose:
//=======================================================================
 gp_Pnt2d Coord2dVf (const TopoDS_Edge& aE,
		     const TopoDS_Face& aF)
{
  Standard_Real aCoord=99.;
  gp_Pnt2d aP2D1(aCoord, aCoord);
  TopoDS_Iterator aIt;
  //
  aIt.Initialize(aE);
  for (; aIt.More(); aIt.Next()) {
    const TopoDS_Shape& aVx=aIt.Value();
    if (aVx.Orientation()==TopAbs_FORWARD) {
      const TopoDS_Vertex& aVxx=TopoDS::Vertex(aVx);
      aP2D1=Coord2d(aVxx, aE, aF);
      return aP2D1;
    }
  }
  return aP2D1;
}
开发者ID:dbarbier,项目名称:pythonocc,代码行数:22,代码来源:GEOMAlgo_WireSplitter.cpp

示例12: Handle

//=======================================================================
// function: CopyFace
// purpose: 
//=======================================================================
  void GEOMAlgo_Tools3D::CopyFace (const TopoDS_Face& theF1,
                                  TopoDS_Face& theF2)
{
  Standard_Real aTol;
  TopLoc_Location aLoc;
  TopAbs_Orientation aOr;
  TopoDS_Iterator aIt;
  BRep_Builder aBB;
  //
  Handle(Geom_Surface) aSurface=BRep_Tool::Surface(theF1, aLoc);
  aTol=BRep_Tool::Tolerance(theF1);
  aOr=theF1.Orientation();
  //
  aBB.MakeFace (theF2, aSurface, aLoc, aTol);
  theF2.Orientation(aOr);
  //
  aIt.Initialize(theF1);
  for (; aIt.More(); aIt.Next()) {
    const TopoDS_Shape& aW=aIt.Value();
    aBB.Add(theF2, aW);
  }
}
开发者ID:dbarbier,项目名称:pythonocc,代码行数:26,代码来源:GEOMAlgo_Tools3D.cpp

示例13: FillImagesContainers

//=======================================================================
// function: FillImagesContainers
// purpose:
//=======================================================================
void GEOMAlgo_Builder::FillImagesContainers(const TopAbs_ShapeEnum theType)
{
    myErrorStatus=0;
    //
    Standard_Boolean bInterferred, bToReverse;
    Standard_Integer i, aNbS;
    TopAbs_ShapeEnum aType;
    BRep_Builder aBB;
    TopoDS_Iterator aIt;
    TopTools_ListIteratorOfListOfShape aItIm;
    TopTools_MapOfShape aMS;
    TopTools_MapIteratorOfMapOfShape aItS;
    //
    const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
    NMTTools_PaveFiller* pPF=myPaveFiller;
    const Handle(IntTools_Context)& aCtx= pPF->Context();
    //
    aNbS=aDS.NumberOfShapesOfTheObject();
    for (i=1; i<=aNbS; ++i) {
        const TopoDS_Shape& aC=aDS.Shape(i);
        aType=aC.ShapeType();
        if (aType==theType) {
            aMS.Add(aC);
        }
    }
    //
    if (theType==TopAbs_COMPOUND) {
        FillImagesCompounds(aMS, myImages);
        return;
    }
    //
    aItS.Initialize(aMS);
    for (; aItS.More(); aItS.Next()) {
        const TopoDS_Shape& aC=aItS.Key();
        // whether the shape has image
        bInterferred=Standard_False;
        aIt.Initialize(aC);
        for (; aIt.More(); aIt.Next()) {
            const TopoDS_Shape& aF=aIt.Value();
            if (myImages.HasImage(aF)) {
                bInterferred=!bInterferred;
                break;
            }
        }
        if (!bInterferred) {
            continue;
        }
        //
        TopoDS_Shape aCIm;
        GEOMAlgo_Tools3D::MakeContainer(theType, aCIm);
        //
        aIt.Initialize(aC);
        for (; aIt.More(); aIt.Next()) {
            const TopoDS_Shape& aF=aIt.Value();
            if (myImages.HasImage(aF)) {
                const TopTools_ListOfShape& aLFIm=myImages.Image(aF);
                aItIm.Initialize(aLFIm);
                for (; aItIm.More(); aItIm.Next()) {
                    TopoDS_Shape aFIm=aItIm.Value();
                    //
                    bToReverse=GEOMAlgo_Tools3D::IsSplitToReverse(aFIm, aF, aCtx);
                    if (bToReverse) {
                        aFIm.Reverse();
                    }
                    aBB.Add(aCIm, aFIm);
                }
            }
            else {
                aBB.Add(aCIm, aF);
            }
        }
        myImages.Bind(aC, aCIm);
    }// for (; aItS.More(); aItS.Next()) {
}
开发者ID:triggerfish1,项目名称:pythonocc,代码行数:78,代码来源:GEOMAlgo_Builder_1.cpp

示例14: PerformInternalShapes

//=======================================================================
//function : PerformInternalShapes
//purpose  : 
//=======================================================================
  void GEOMAlgo_BuilderFace::PerformInternalShapes()
{
  myErrorStatus=0;
  //
  Standard_Integer aNbWI=myLoopsInternal.Extent();
  if (!aNbWI) {// nothing to do
    return;
  }
  // 
  //Standard_Real aTol;
  BRep_Builder aBB;
  TopTools_ListIteratorOfListOfShape aIt1, aIt2;
  TopoDS_Iterator aIt; 
  TopTools_MapOfShape aME, aMEP;
  TopTools_MapIteratorOfMapOfShape aItME;
  TopTools_IndexedDataMapOfShapeListOfShape aMVE;
  TopTools_ListOfShape aLSI;
  //
  // 1. All internal edges
  aIt1.Initialize(myLoopsInternal);
  for (; aIt1.More(); aIt1.Next()) {
    const TopoDS_Shape& aWire=aIt1.Value();
    aIt.Initialize(aWire);
    for (; aIt.More(); aIt.Next()) {
      const TopoDS_Shape& aE=aIt.Value();
      aME.Add(aE);
    }
  }
  aNbWI=aME.Extent();
  //
  // 2 Process faces
  aIt2.Initialize(myAreas);
  for ( ; aIt2.More(); aIt2.Next()) {
    TopoDS_Face& aF=TopoDS::Face(aIt2.Value());
    //
    aMVE.Clear();
    TopExp::MapShapesAndAncestors(aF, TopAbs_VERTEX, TopAbs_EDGE, aMVE);
    //
    // 2.1 Separate faces to process aMEP
    aMEP.Clear();
    aItME.Initialize(aME);
    for (; aItME.More(); aItME.Next()) {
      const TopoDS_Edge& aE=TopoDS::Edge(aItME.Key());
      if (IsInside(aE, aF, myContext)) {
	aMEP.Add(aE);
      }
    }
    //
    // 2.2 Make Internal Wires
    aLSI.Clear();
    MakeInternalWires(aMEP, aLSI);
    //
    // 2.3 Add them to aF
    aIt1.Initialize(aLSI);
    for (; aIt1.More(); aIt1.Next()) {
      const TopoDS_Shape& aSI=aIt1.Value();
      aBB.Add (aF, aSI);
    }
    //
    // 2.4 Remove faces aMFP from aMF
    aItME.Initialize(aMEP);
    for (; aItME.More(); aItME.Next()) {
      const TopoDS_Shape& aE=aItME.Key();
      aME.Remove(aE);
    }
    //
    aNbWI=aME.Extent();
    if (!aNbWI) {
      break;
    }
  } //for ( ; aIt2.More(); aIt2.Next()) {
}
开发者ID:dbarbier,项目名称:pythonocc,代码行数:76,代码来源:GEOMAlgo_BuilderFace.cpp

示例15: Init

//===========================================================================
//function : Init
//purpose  : 
//===========================================================================
void NMTDS_ShapesDataStructure::Init()
{
  Standard_Integer i, j, aNbSx, aNbS, aShift, aNbRanges;
  Standard_Integer iFirst, iLast;
  NMTDS_ListOfIndexedDataMapOfShapeAncestorsSuccessors aLx;
  NMTDS_ListIteratorOfListOfIndexedDataMapOfShapeAncestorsSuccessors aLit;
  TopoDS_Iterator anIt;
  BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors aMSA;
  //
  anIt.Initialize(myCompositeShape);
  for (; anIt.More(); anIt.Next()) {
    const TopoDS_Shape& aSx=anIt.Value(); 
    BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors aMS;
    //
    if (!aMSA.Contains(aSx)) {
      FillMap(aSx, aMSA, aMS);
      aLx.Append(aMS);
    }
  }
  aNbS=aMSA.Extent(); 
  //
  // Fill myRanges
  i=aLx.Extent();
  myRanges.Resize(i);
  aLit.Initialize(aLx);
  for (i=1; aLit.More(); aLit.Next(), ++i) {
    const BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors& aMSx=aLit.Value();
    aNbSx=aMSx.Extent();
    if (i==1) {
      iFirst=1;
      iLast=aNbSx;
      myRanges(i).SetFirst(iFirst);
      myRanges(i).SetLast(iLast);
      continue;
    }
    iFirst=myRanges(i-1).Last()+1;
    iLast=iFirst+aNbSx-1;
    myRanges(i).SetFirst(iFirst);
    myRanges(i).SetLast(iLast);
  }
  //
  myNumberOfShapesOfTheObject=aNbS;
  myNumberOfShapesOfTheTool=0;
  myLength=2*aNbS;
  //
  // Allocate the whole Table
  myListOfShapeAndInterferences = (BooleanOperations_PShapeAndInterferences)
    Standard::Allocate(myLength*sizeof(BooleanOperations_ShapeAndInterferences));
  //
  // Fill the table
  
  aShift=0;
  for (j=1; j<=aNbS; ++j) {
    const TopoDS_Shape& aSx=aMSA.FindKey(j);
    const BooleanOperations_AncestorsSeqAndSuccessorsSeq& aASx=aMSA.FindFromIndex(j);
    InsertShapeAndAncestorsSuccessors(aSx, aASx, aShift);
  }
  // myShapeIndexMap
  myShapeIndexMap.Clear();
  //
  //modified by NIZNHY-PKV Mon Dec 12 09:01:53 2011f
  aNbRanges=myRanges.Extent();
  for (i=1; i<=aNbRanges; ++i){
    const NMTDS_IndexRange& aR=myRanges(i);
    iFirst=aR.First();
    iLast =aR.Last();
    for (j=iFirst; j<=iLast; ++j) { 
      const TopoDS_Shape& aS=Shape(j);
      myShapeIndexMap.Bind(aS, j);
    }
  }
  //modified by NIZNHY-PKV Mon Dec 12 09:02:00 2011t
  //
  // myRefEdges
  iLast=myNumberOfShapesOfTheObject+myNumberOfShapesOfTheTool;
  myRefEdges.Resize(iLast);

  for (i=1; i<=iLast; ++i) {
    const TopoDS_Shape& aS=Shape(i);
    myRefEdges(i)=0;
    if (aS.ShapeType()==TopAbs_EDGE) {
      myNbEdges++;
      myRefEdges(i)=myNbEdges;
    }
  }
}
开发者ID:triggerfish1,项目名称:pythonocc,代码行数:90,代码来源:NMTDS_ShapesDataStructure.cpp


注:本文中的TopoDS_Iterator::Initialize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。