BuildingCoder.CmdCropToRoom.IsElementOutsideCropBox C# (CSharp) Method

IsElementOutsideCropBox() private method

Return true if element is outside of view crop box
private IsElementOutsideCropBox ( Element e, View v ) : bool
e Element
v View
return bool
        bool IsElementOutsideCropBox( Element e, View v )
        {
            bool rc = v.CropBoxActive;

              if( rc )
              {
            BoundingBoxXYZ vBox = v.CropBox;
            BoundingBoxXYZ eBox = e.get_BoundingBox( v );

            Transform tInv = v.CropBox.Transform.Inverse;
            eBox.Max = tInv.OfPoint( eBox.Max );
            eBox.Min = tInv.OfPoint( eBox.Min );

            rc = ( eBox.Min.X > vBox.Max.X )
              || ( eBox.Max.X < vBox.Min.X )
              || ( eBox.Min.Y > vBox.Max.Y )
              || ( eBox.Max.Y < vBox.Min.Y );
              }
              return rc;
        }