本文整理汇总了C++中TopoDS_Iterator::Next方法的典型用法代码示例。如果您正苦于以下问题:C++ TopoDS_Iterator::Next方法的具体用法?C++ TopoDS_Iterator::Next怎么用?C++ TopoDS_Iterator::Next使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TopoDS_Iterator
的用法示例。
在下文中一共展示了TopoDS_Iterator::Next方法的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;
}
示例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);
}
示例3: 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);
}
示例4: 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;
}
示例5: Perform
Standard_Boolean ShHealOper_ChangeOrientation::Perform()
{
BRep_Builder B;
if (myInitShape.ShapeType() == TopAbs_SHELL) {
myResultShape = myInitShape.EmptyCopied();
TopoDS_Iterator itr (myInitShape);
while (itr.More()) {
B.Add(myResultShape,itr.Value().Reversed());
itr.Next();
}
}
else if (myInitShape.ShapeType() == TopAbs_FACE) {
myResultShape = myInitShape.EmptyCopied();
TopoDS_Iterator itr (myInitShape);
while (itr.More()) {
B.Add(myResultShape,itr.Value());
itr.Next();
}
myResultShape.Reverse();
}
else if ( myInitShape.ShapeType() == TopAbs_WIRE || myInitShape.ShapeType() == TopAbs_EDGE) {
myResultShape = myInitShape.EmptyCopied();
TopoDS_Iterator itr (myInitShape);
while (itr.More()) {
B.Add(myResultShape,itr.Value());
itr.Next();
}
myResultShape.Reverse();
}
else {
BRepBuilderAPI_Copy Copy (myInitShape);
if (!Copy.IsDone()) return false;
myResultShape = Copy.Shape();
if (myResultShape.IsNull()) return false;
if (myResultShape.Orientation() == TopAbs_FORWARD)
myResultShape.Orientation(TopAbs_REVERSED);
else
myResultShape.Orientation(TopAbs_FORWARD);
}
return true;
}
示例6: 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);
}
}
示例7: 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);
}
}
}
示例8: SuppressFacesRec
//=======================================================================
//function : SupressFaces
//purpose :
//=======================================================================
void SuppressFacesRec (const TopTools_SequenceOfShape& theShapesFaces,
const TopoDS_Shape& theOriginalShape,
TopoDS_Shape& theOutShape)
{
if ((theOriginalShape.ShapeType() != TopAbs_COMPOUND &&
theOriginalShape.ShapeType() != TopAbs_COMPSOLID))
{
ShHealOper_RemoveFace aHealer (theOriginalShape);
Standard_Boolean aResult = aHealer.Perform(theShapesFaces);
if (aResult)
theOutShape = aHealer.GetResultShape();
else
raiseNotDoneExeption(aHealer.GetErrorStatus());
}
else
{
BRep_Builder BB;
TopoDS_Compound CC;
BB.MakeCompound(CC);
TopTools_MapOfShape mapShape;
TopoDS_Iterator It (theOriginalShape, Standard_True, Standard_True);
for (; It.More(); It.Next()) {
TopoDS_Shape aShape_i = It.Value();
if (mapShape.Add(aShape_i)) {
// check, if current shape contains at least one of faces to be removed
bool isFound = false;
TopTools_IndexedMapOfShape aShapes_i;
TopExp::MapShapes(aShape_i, aShapes_i);
for (int i = 1; i <= theShapesFaces.Length() && !isFound; i++) {
const TopoDS_Shape& aFace_i = theShapesFaces.Value(i);
if (aShapes_i.Contains(aFace_i)) isFound = true;
}
if (isFound) {
TopoDS_Shape anOutSh_i;
SuppressFacesRec(theShapesFaces, aShape_i, anOutSh_i);
if ( !anOutSh_i.IsNull() )
BB.Add(CC, anOutSh_i);
}
else {
// nothing to do
BB.Add(CC, aShape_i);
}
}
}
theOutShape = CC;
}
}
示例9: 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);
}
}
示例10: 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;
}
示例11: 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);
}
}
}
示例12: 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;
}
示例13:
//=======================================================================
// 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;
}
示例14: 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;
}
示例15: Count
bool StdMeshers_RadialPrism_3D::IsApplicable( const TopoDS_Shape & aShape, bool toCheckAll )
{
bool isCurShellApp;
int nbFoundSolids = 0;
for (TopExp_Explorer exp( aShape, TopAbs_SOLID ); exp.More(); exp.Next(), ++nbFoundSolids )
{
TopoDS_Shape shell[2];
int nbShells = 0;
for ( TopoDS_Iterator It (exp.Current()); It.More(); It.Next() )
{
nbShells++;
if ( nbShells > 2 ) {
if ( toCheckAll ) return false;
break;
}
shell[ nbShells-1 ] = It.Value();
}
if ( nbShells != 2 ) {
if ( toCheckAll ) return false;
continue;
}
int nbFaces1 = SMESH_MesherHelper:: Count( shell[0], TopAbs_FACE, 0 );
int nbFaces2 = SMESH_MesherHelper:: Count( shell[1], TopAbs_FACE, 0 );
if ( nbFaces1 != nbFaces2 ){
if( toCheckAll ) return false;
continue;
}
int nbEdges1 = SMESH_MesherHelper:: Count( shell[0], TopAbs_EDGE, 0 );
int nbEdges2 = SMESH_MesherHelper:: Count( shell[1], TopAbs_EDGE, 0 );
if ( nbEdges1 != nbEdges2 ){
if( toCheckAll ) return false;
continue;
}
int nbVertices1 = SMESH_MesherHelper:: Count( shell[0], TopAbs_VERTEX, 0 );
int nbVertices2 = SMESH_MesherHelper:: Count( shell[1], TopAbs_VERTEX, 0 );
if ( nbVertices1 != nbVertices2 ){
if( toCheckAll ) return false;
continue;
}
if ( !toCheckAll ) return true;
}
return ( toCheckAll && nbFoundSolids != 0);
};