Пример #1
0
 public void Next()
 {
     myShapes.Next();
     if (More())
     {
         myShape             = myShapes.Value();
         myShape.Orientation = TopAbs.Compose(myOrientation, myShape.Orientation);
         if (!myLocation.IsIdentity())
         {
             myShape.Move(myLocation);
         }
     }
 }
Пример #2
0
        /// <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);
                }
            }
        }