public void Remove(TopoDS_Shape aShape, TopoDS_Shape aComponent) { // check if aShape is not Frozen if (!aShape.Free) { throw new TopoDS_FrozenShape("TopoDS_Builder.Remove"); } // compute the relative Orientation and Location of aComponent var S = aComponent; if (aShape.Orientation == TopAbs_Orientation.TopAbs_REVERSED) { S.Reverse(); } S.Location = S.Location.Predivided(aShape.Location); var L = aShape.TShape().myShapes; var It = new TopoDS_ListIteratorOfListOfShape(L); foreach (var i in It) { if (i != S) { continue; } L.Remove(It); aShape.TShape().OnlyFriendsModified(true); break; } }
/// <summary> /// Initializes this iterator with shape S. /// Note: /// - If cumOri is true, the function composes all sub-shapes with the orientation of S. /// - If cumLoc is true, the function multiplies all sub-shapes by the location of S, i.e. it applies to /// each sub-shape the transformation that is associated with S. /// </summary> /// <param name="S"></param> /// <param name="cumOri"></param> /// <param name="cumLoc"></param> public void Initialize(TopoDS_Shape S, bool cumOri, bool cumLoc) { if (cumLoc) { myLocation = S.Location; } else { myLocation.Identity(); } if (cumOri) { myOrientation = S.Orientation; } else { myOrientation = TopAbs_Orientation.TopAbs_FORWARD; } if (S.IsNull()) { myShapes = new TopoDS_ListIteratorOfListOfShape(); } else { myShapes.Initialize(S.TShape().myShapes); } if (More()) { myShape = myShapes.Value(); myShape.Orientation = TopAbs.Compose(myOrientation, myShape.Orientation); if (!myLocation.IsIdentity()) { myShape.Move(myLocation); } } }
public void Remove(TopoDS_ListIteratorOfListOfShape theInt) { throw new NotImplementedException(); }