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


C++ TopTools_ListIteratorOfListOfShape类代码示例

本文整理汇总了C++中TopTools_ListIteratorOfListOfShape的典型用法代码示例。如果您正苦于以下问题:C++ TopTools_ListIteratorOfListOfShape类的具体用法?C++ TopTools_ListIteratorOfListOfShape怎么用?C++ TopTools_ListIteratorOfListOfShape使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1:

//=======================================================================
//function : FillVertices
//purpose  :
//=======================================================================
void GEOMAlgo_Gluer2::FillVertices()
{
  TopAbs_ShapeEnum aType;
  TopoDS_Vertex aVnew;
  TopTools_ListIteratorOfListOfShape aItLS;
  TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItDMSLS;
  //
  myErrorStatus=0;
  myWarningStatus=0;
  //
  aItDMSLS.Initialize(myImagesToWork);
  for (; aItDMSLS.More(); aItDMSLS.Next()) {
    const TopoDS_Shape& aSkey=aItDMSLS.Key();
    aType=aSkey.ShapeType();
    if (aType!=TopAbs_VERTEX) {
      continue;
    }
    //
    const TopTools_ListOfShape& aLSD=aItDMSLS.Value();
    //
    GEOMAlgo_Gluer2::MakeVertex(aLSD, aVnew);
    //
    myImages.Bind(aVnew, aLSD);
    //
    aItLS.Initialize(aLSD);
    for (; aItLS.More(); aItLS.Next()) {
      const TopoDS_Shape& aV=aItLS.Value();
      myOrigins.Bind(aV, aVnew);
    }
  }
}
开发者ID:triggerfish1,项目名称:pythonocc,代码行数:35,代码来源:GEOMAlgo_Gluer2.cpp

示例2: IsExistingPaveBlock

//=======================================================================
// function: IsExistingPaveBlock
// purpose:
//=======================================================================
Standard_Boolean NMTTools_PaveFiller::IsExistingPaveBlock(const BOPTools_PaveBlock& aPBNew,
                                                          const TopTools_ListOfShape& aLSE,
                                                          const Standard_Real aTolR3D)
{
  Standard_Boolean bFlag;
  Standard_Integer aNbSE, iC;
  Standard_Real aTolE, aTol;
  TopTools_ListIteratorOfListOfShape anIt;
  //
  bFlag=Standard_False;
  //
  aNbSE=aLSE.Extent();
  if (!aNbSE) {
    return bFlag;
  }
  //
  anIt.Initialize(aLSE);
  for (; anIt.More(); anIt.Next()) {
    const TopoDS_Edge& aE=TopoDS::Edge(anIt.Value());
    aTolE=BRep_Tool::Tolerance(aE);
    aTol=aTolR3D;
    if (aTolE>aTol) {
      aTol=aTolE;
    }
    iC=CheckIntermediatePoint(aPBNew, aE, aTol);
    if (!iC) {
      return !bFlag;
    }
  }
  return bFlag;
}
开发者ID:triggerfish1,项目名称:pythonocc,代码行数:35,代码来源:NMTTools_PaveFiller_6.cpp

示例3: TestMkFillet

void TestMkFillet(){
    TopoDS_Shape Box = BRepPrimAPI_MakeBox(10., 10., 10.);
    BRepFilletAPI_MakeFillet mkFillet(Box);

    TopTools_IndexedMapOfShape edges;
    TopExp::MapShapes(Box, TopAbs_EDGE, edges);
    TopoDS_Edge edge = TopoDS::Edge(edges.FindKey(3));

    mkFillet.Add(1., 1., edge);
    mkFillet.Build();

    TopoDS_Shape result = mkFillet.Shape();


    TopTools_IndexedMapOfShape faces;
    TopExp::MapShapes(Box, TopAbs_FACE, faces);
    TopoDS_Face face = TopoDS::Face(faces.FindKey(3));

    TopTools_ListOfShape modified = mkFillet.Modified(face);
    TopTools_ListIteratorOfListOfShape modIt;
    for (int i=1; modIt.More(); modIt.Next(), i++){
        TopoDS_Face curFace = TopoDS::Face(modIt.Value());
        TopoNamingHelper::WriteShape(curFace, "00_02_ModifiedFace", i);
    }

    TopoNamingHelper::WriteShape(result, "00_00_FilletResult");
    TopoNamingHelper::WriteShape(face, "00_01_BaseFace_3");
}
开发者ID:ezzieyguywuf,项目名称:freecadTopoTesting,代码行数:28,代码来源:FakeTopoShapeRunCases.cpp

示例4: Add

//=======================================================================
//function : Add
//purpose  : 
//=======================================================================
  void GEOMAlgo_ShapeSet::Add(const TopTools_ListOfShape& theLS)
{
  TopTools_ListIteratorOfListOfShape aIt;
  //
  aIt.Initialize(theLS);
  for (; aIt.More(); aIt.Next()) {
    const TopoDS_Shape& aS=aIt.Value();
    if (myMap.Add(aS)) {
      myList.Append(aS);
    }
  }
}
开发者ID:dbarbier,项目名称:pythonocc,代码行数:16,代码来源:GEOMAlgo_ShapeSet.cpp

示例5: assert

//----------------------------------------------------------------
// Function: to update the core Surface
//           for any movement  or Boolean operation of the body.
// Author: Jane Hu
//----------------------------------------------------------------
CubitStatus OCCSurface::update_OCC_entity( BRepBuilderAPI_Transform *aBRepTrsf,
                                         BRepAlgoAPI_BooleanOperation *op)
{
  assert(aBRepTrsf != NULL || op != NULL);

  TopoDS_Shape shape;
  if (aBRepTrsf)
    shape = aBRepTrsf->ModifiedShape(*get_TopoDS_Face());
  else
  {
    TopTools_ListOfShape shapes;
    shapes.Assign(op->Modified(*get_TopoDS_Face()));
    if(shapes.Extent() == 0)
         shapes.Assign(op->Generated(*get_TopoDS_Face()));
    if (shapes.Extent() == 1)
      shape = shapes.First();
    else if(shapes.Extent() > 1)
    {
      //update all attributes first.
      TopTools_ListIteratorOfListOfShape it;
      it.Initialize(shapes);
      for(; it.More(); it.Next())
      {
        shape = it.Value();
        OCCQueryEngine::instance()->copy_attributes(*get_TopoDS_Face(), shape);
      }
      shape = shapes.First();
    }
    else if(op->IsDeleted(*get_TopoDS_Face()))
      ;
    else
      return CUBIT_SUCCESS;
  }
 
  TopoDS_Face surface; 
  if(!shape.IsNull())
    surface = TopoDS::Face(shape);

  if (aBRepTrsf) 
  {
    //set the loops
    DLIList<OCCLoop *> loops;
    this->get_loops(loops);
    for (int i = 1; i <= loops.size(); i++)
    {
       OCCLoop *loop = loops.get_and_step();
       loop->update_OCC_entity(aBRepTrsf, op);
    }
    OCCQueryEngine::instance()->update_OCC_map(*myTopoDSFace, surface);
  }

  else if(op)
    update_OCC_entity(*myTopoDSFace, surface, op);

  return CUBIT_SUCCESS;
}
开发者ID:tenpercent,项目名称:cp-sandbox,代码行数:61,代码来源:OCCSurface.cpp

示例6: MakeBRepShapes

//=======================================================================
//function : FillBRepShapes
//purpose  :
//=======================================================================
void GEOMAlgo_Gluer2::FillBRepShapes(const TopAbs_ShapeEnum theType)
{
  Standard_Boolean bHasImage, bIsToWork;
  Standard_Integer i, aNbE;
  TopoDS_Iterator aItS;
  TopoDS_Shape aEnew;
  TopTools_IndexedMapOfShape aME;
  TopTools_MapOfShape aMFence;
  TopTools_ListIteratorOfListOfShape aItLS;
  //
  myErrorStatus=0;
  myWarningStatus=0;
  //
  TopExp::MapShapes(myArgument, theType, aME);
  //
  aNbE=aME.Extent();
  for (i=1; i<=aNbE; ++i) {
    const TopoDS_Shape& aE=aME(i);
    //
    if (!aMFence.Add(aE)) {
      continue;
    }
    //
    bIsToWork=myOriginsToWork.IsBound(aE);
    bHasImage=HasImage(aE);
    if (!bHasImage && !bIsToWork) {
      continue;
    }
    //
    MakeBRepShapes(aE, aEnew);
    //
    //myImages / myOrigins
    if (bIsToWork) {
      const TopoDS_Shape& aSkey=myOriginsToWork.Find(aE);
      const TopTools_ListOfShape& aLSD=myImagesToWork.Find(aSkey);
      //
      myImages.Bind(aEnew, aLSD);
      //
      aItLS.Initialize(aLSD);
      for (; aItLS.More(); aItLS.Next()) {
        const TopoDS_Shape& aEx=aItLS.Value();
        myOrigins.Bind(aEx, aEnew);
        //
        aMFence.Add(aEx);
      }
    }
    else {
      TopTools_ListOfShape aLSD;
      //
      aLSD.Append(aE);
      myImages.Bind(aEnew, aLSD);
      myOrigins.Bind(aE, aEnew);
    }
  }//for (i=1; i<=aNbF; ++i) {
}
开发者ID:triggerfish1,项目名称:pythonocc,代码行数:59,代码来源:GEOMAlgo_Gluer2.cpp

示例7:

Standard_Boolean Part::BRepBuilderAPI_RefineModel::IsDeleted(const TopoDS_Shape& S)
{
    TopTools_ListIteratorOfListOfShape it;
    for (it.Initialize(myDeleted); it.More(); it.Next())
    {
        if (it.Value().IsSame(S))
            return Standard_True;
    }

    return Standard_False;
}
开发者ID:JonasThomas,项目名称:free-cad,代码行数:11,代码来源:modelRefine.cpp

示例8: 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

示例9:

//=======================================================================
// function: FillImagesFaces1
// purpose:
//=======================================================================
void GEOMAlgo_Builder::FillImagesFaces1()
{
  Standard_Integer i, aNb, iSense, aNbLFx;
  TopoDS_Face aF, aFSp, aFSD;
  TopTools_ListOfShape aLFx;
  TopTools_ListIteratorOfListOfShape aIt;
  //
  const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
  //
  aNb=aDS.NumberOfShapesOfTheObject();
  for (i=1; i<=aNb; ++i) {
    const TopoDS_Shape& aS=aDS.Shape(i);
    if (aS.ShapeType()!=TopAbs_FACE) {
      continue;
    }
    //
    if (!mySplitFaces.HasImage(aS)) {
      continue;
    }
    //
    aF=*((TopoDS_Face*)&aS);
    //
    aLFx.Clear();
    const TopTools_ListOfShape& aLF=mySplitFaces.Image(aF);
    aIt.Initialize(aLF);
    for (; aIt.More(); aIt.Next()) {
      aFSp=*((TopoDS_Face*)(&aIt.Value()));
      if (!mySameDomainShapes.Contains(aFSp)) {
        aLFx.Append(aFSp);
      }
      else {
        const TopoDS_Shape& aSx=mySameDomainShapes.FindFromKey(aFSp);
        aFSD=*((TopoDS_Face*)(&aSx));
        iSense=GEOMAlgo_Tools3D::Sense(aFSp, aFSD);
        if (iSense<0) {
          aFSD.Reverse();
        }
        aLFx.Append(aFSD);
      }
    }
    //
    if (!myImages.HasImage(aF)) {
      aNbLFx=aLFx.Extent();
      if (aNbLFx==1) {
        const TopoDS_Shape& aFx=aLFx.First();
        if (aF.IsSame(aFx)) {
          continue;
        }
      }
      myImages.Bind(aF, aLFx);
    }
  }
}
开发者ID:triggerfish1,项目名称:pythonocc,代码行数:57,代码来源:GEOMAlgo_Builder_2.cpp

示例10: buildHistory

ShapeHistory Feature::buildHistory(BRepBuilderAPI_MakeShape& mkShape, TopAbs_ShapeEnum type,
                                   const TopoDS_Shape& newS, const TopoDS_Shape& oldS)
{
    ShapeHistory history;
    history.type = type;

    TopTools_IndexedMapOfShape newM, oldM;
    TopExp::MapShapes(newS, type, newM); // map containing all old objects of type "type"
    TopExp::MapShapes(oldS, type, oldM); // map containing all new objects of type "type"

    // Look at all objects in the old shape and try to find the modified object in the new shape
    for (int i=1; i<=oldM.Extent(); i++) {
        bool found = false;
        TopTools_ListIteratorOfListOfShape it;
        // Find all new objects that are a modification of the old object (e.g. a face was resized)
        for (it.Initialize(mkShape.Modified(oldM(i))); it.More(); it.Next()) {
            found = true;
            for (int j=1; j<=newM.Extent(); j++) { // one old object might create several new ones!
                if (newM(j).IsPartner(it.Value())) {
                    history.shapeMap[i-1].push_back(j-1); // adjust indices to start at zero
                    break;
                }
            }
        }

        // Find all new objects that were generated from an old object (e.g. a face generated from an edge)
        for (it.Initialize(mkShape.Generated(oldM(i))); it.More(); it.Next()) {
            found = true;
            for (int j=1; j<=newM.Extent(); j++) {
                if (newM(j).IsPartner(it.Value())) {
                    history.shapeMap[i-1].push_back(j-1);
                    break;
                }
            }
        }

        if (!found) {
            // Find all old objects that don't exist any more (e.g. a face was completely cut away)
            if (mkShape.IsDeleted(oldM(i))) {
                history.shapeMap[i-1] = std::vector<int>();
            }
            else {
                // Mop up the rest (will this ever be reached?)
                for (int j=1; j<=newM.Extent(); j++) {
                    if (newM(j).IsPartner(oldM(i))) {
                        history.shapeMap[i-1].push_back(j-1);
                        break;
                    }
                }
            }
        }
    }

    return history;
}
开发者ID:rmamba,项目名称:FreeCAD_sf_master,代码行数:55,代码来源:PartFeature.cpp

示例11: Handle

//=======================================================================
//function : Generated
//purpose  :
//=======================================================================
const TopTools_ListOfShape& GEOMAlgo_Builder::Generated(const TopoDS_Shape& theS)
{
    NMTTools_PaveFiller* pPF=myPaveFiller;
    const Handle(IntTools_Context)& aCtx=pPF->Context();
    //
    Standard_Boolean bHasImage, bToReverse;
    TopAbs_ShapeEnum aType;
    TopTools_ListIteratorOfListOfShape aIt;
    //
    myHistShapes.Clear();
    //
    if (theS.IsNull()) {
        return myHistShapes;
    }
    //
    bHasImage=myImages.HasImage(theS);
    if (!bHasImage) {
        return myHistShapes;
    }
    //
    aType=theS.ShapeType();
    //
    if (aType==TopAbs_EDGE   || aType==TopAbs_FACE ||
            aType==TopAbs_VERTEX || aType==TopAbs_SOLID) {
        const TopTools_ListOfShape& aLSp=myImages.Image(theS);
        aIt.Initialize(aLSp);
        for (; aIt.More(); aIt.Next()) {
            const TopoDS_Shape& aSp=aIt.Value();
            if (mySameDomainShapes.Contains(aSp)) {
                if (myMapShape.Contains(aSp)) {
                    TopoDS_Shape aSpR=mySameDomainShapes.FindFromKey(aSp);
                    //
                    if (aType==TopAbs_VERTEX || aType==TopAbs_SOLID) {
                        aSpR.Orientation(theS.Orientation());
                    }
                    else {
                        bToReverse=GEOMAlgo_Tools3D::IsSplitToReverse(aSpR, theS, aCtx);
                        if (bToReverse) {
                            aSpR.Reverse();
                        }
                    }
                    //
                    myHistShapes.Append(aSpR);
                }
            }
        }
    }
    //
    return myHistShapes;
}
开发者ID:triggerfish1,项目名称:pythonocc,代码行数:54,代码来源:GEOMAlgo_Builder_4.cpp

示例12: MakeInternalWires

//=======================================================================
//function : MakeInternalWires
//purpose  : 
//=======================================================================
void MakeInternalWires(const TopTools_MapOfShape& theME,
		       TopTools_ListOfShape& theWires)
{
  TopTools_MapIteratorOfMapOfShape aItM;
  TopTools_MapOfShape aAddedMap;
  TopTools_ListIteratorOfListOfShape aItE;
  TopTools_IndexedDataMapOfShapeListOfShape aMVE;
  BRep_Builder aBB;
  //
  aItM.Initialize(theME);
  for (; aItM.More(); aItM.Next()) {
    const TopoDS_Shape& aE=aItM.Key();
    TopExp::MapShapesAndAncestors(aE, TopAbs_VERTEX, TopAbs_EDGE, aMVE);
  }
  //
  aItM.Initialize(theME);
  for (; aItM.More(); aItM.Next()) {
    TopoDS_Shape aEE=aItM.Key();
    if (!aAddedMap.Add(aEE)) {
      continue;
    }
    //
    // make a new shell
    TopoDS_Wire aW;
    aBB.MakeWire(aW);    
    aEE.Orientation(TopAbs_INTERNAL);
    aBB.Add(aW, aEE);
    //
    TopoDS_Iterator aItAdded (aW);
    for (; aItAdded.More(); aItAdded.Next()) {
      const TopoDS_Shape& aE =aItAdded.Value();
      //
      TopExp_Explorer aExp(aE, TopAbs_VERTEX);
      for (; aExp.More(); aExp.Next()) {
        const TopoDS_Shape& aV =aExp.Current();
	const TopTools_ListOfShape& aLE=aMVE.FindFromKey(aV);
	aItE.Initialize(aLE);
	for (; aItE.More(); aItE.Next()) { 
	  TopoDS_Shape aEL=aItE.Value();
	  if (aAddedMap.Add(aEL)){
	    aEL.Orientation(TopAbs_INTERNAL);
	    aBB.Add(aW, aEL);
	  }
	}
      }
    }
    theWires.Append(aW);
  }
}
开发者ID:dbarbier,项目名称:pythonocc,代码行数:53,代码来源:GEOMAlgo_BuilderFace.cpp

示例13: generated

PyObject* BRepOffsetAPI_MakePipeShellPy::generated(PyObject *args)
{
    PyObject *shape;
    if (!PyArg_ParseTuple(args, "O!",&Part::TopoShapePy::Type,&shape))
        return 0;
    const TopoDS_Shape& s = static_cast<Part::TopoShapePy*>(shape)->getTopoShapePtr()->_Shape;
    const TopTools_ListOfShape& list = this->getBRepOffsetAPI_MakePipeShellPtr()->Generated(s);

    Py::List shapes;
    TopTools_ListIteratorOfListOfShape it;
    for (it.Initialize(list); it.More(); it.Next()) {
        const TopoDS_Shape& s = it.Value();
        shapes.append(Py::asObject(new TopoShapePy(new TopoShape(s))));
    }
    return Py::new_reference_to(shapes);
}
开发者ID:3DPrinterGuy,项目名称:FreeCAD,代码行数:16,代码来源:BRepOffsetAPI_MakePipeShellPyImp.cpp

示例14: SetEdges

//=======================================================================
// function: SetEdges
// purpose: 
//=======================================================================
  void GEOMAlgo_WireSplitter::SetEdges(const TopTools_ListOfShape& aLE)
{
  TopTools_ListIteratorOfListOfShape anIt;
  //
  myEdges.Clear();
  anIt.Initialize(aLE);
  for (; anIt.More(); anIt.Next()) {
    const TopoDS_Shape& aE =anIt.Value();
    //
    if (aE.Orientation()==TopAbs_INTERNAL){
      continue;
    }
    //
    myEdges.Append(aE);
  }
}
开发者ID:dbarbier,项目名称:pythonocc,代码行数:20,代码来源:GEOMAlgo_WireSplitter.cpp

示例15: IsDeleted

//=======================================================================
//function : IsDeleted
//purpose  :
//=======================================================================
Standard_Boolean GEOMAlgo_Builder::IsDeleted(const TopoDS_Shape& theS)
{
    Standard_Boolean bRet, bHasImage, bContains;
    TopAbs_ShapeEnum aType;
    TopTools_ListIteratorOfListOfShape aIt;
    //
    bRet=Standard_False;
    //
    if (theS.IsNull()) {
        return !bRet; //true
    }
    //
    bContains=myMapShape.Contains(theS);
    if (bContains) {
        return bRet; //false
    }
    //
    bHasImage=myImages.HasImage(theS);
    if (!bHasImage) {
        return !bRet; //true
    }
    //
    aType=theS.ShapeType();
    if (aType==TopAbs_EDGE   || aType==TopAbs_FACE ||
            aType==TopAbs_VERTEX || aType==TopAbs_SOLID) {
        const TopTools_ListOfShape& aLSp=myImages.Image(theS);
        aIt.Initialize(aLSp);
        for (; aIt.More(); aIt.Next()) {
            TopoDS_Shape aSp=aIt.Value();
            //
            if (!mySameDomainShapes.Contains(aSp)) {
                if (myMapShape.Contains(aSp)) {
                    return bRet; //false
                }
            }
            else {
                TopoDS_Shape aSpR=mySameDomainShapes.FindFromKey(aSp);
                if (myMapShape.Contains(aSpR)) {
                    return bRet; //false
                }
            }
        }
    }
    return !bRet; // true
}
开发者ID:triggerfish1,项目名称:pythonocc,代码行数:49,代码来源:GEOMAlgo_Builder_4.cpp


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