예제 #1
0
 public static IFCAnyHandle GetDefaultCartesianTransformationOperator3D(IFCFile file)
 {
     if (m_DefaultCartesianTransformationOperator3D == null)
     {
         XYZ          orig    = new XYZ();
         IFCAnyHandle origHnd = ExporterUtil.CreateCartesianPoint(file, orig);
         m_DefaultCartesianTransformationOperator3D = IFCInstanceExporter.CreateCartesianTransformationOperator3D(file, null, null, origHnd, 1.0, null);
     }
     return(m_DefaultCartesianTransformationOperator3D);
 }
예제 #2
0
        /// <summary>
        /// Creates IfcMappedItem object from a transform
        /// </summary>
        /// <param name="file">
        /// The IFC file.
        /// </param>
        /// <param name="repMap">
        /// The handle to be mapped.
        /// </param>
        /// <param name="transform">
        /// The transform.
        /// </param>
        /// <returns>
        /// The handle.
        /// </returns>
        public static IFCAnyHandle CreateMappedItemFromTransform(IFCFile file, IFCAnyHandle repMap, Transform transform)
        {
            IFCAnyHandle axis1         = CreateDirection(file, transform.BasisX);
            IFCAnyHandle axis2         = CreateDirection(file, transform.BasisY);
            IFCAnyHandle axis3         = CreateDirection(file, transform.BasisZ);
            IFCAnyHandle origin        = CreateCartesianPoint(file, transform.Origin);
            double       scale         = 1.0;
            IFCAnyHandle mappingTarget =
                IFCInstanceExporter.CreateCartesianTransformationOperator3D(file, axis1, axis2, origin, scale, axis3);

            return(IFCInstanceExporter.CreateMappedItem(file, repMap, mappingTarget));
        }
예제 #3
0
        /// <summary>
        /// Creates IfcMappedItem object from an origin.
        /// </summary>
        /// <param name="file">
        /// The IFC file.
        /// </param>
        /// <param name="repMap">
        /// The handle to be mapped.
        /// </param>
        /// <param name="orig">
        /// The orig for mapping transformation.
        /// </param>
        /// <returns>
        /// The handle.
        /// </returns>
        public static IFCAnyHandle CreateDefaultMappedItem(IFCFile file, IFCAnyHandle repMap, XYZ orig)
        {
            if (MathUtil.IsAlmostZero(orig.X) && MathUtil.IsAlmostZero(orig.Y) && MathUtil.IsAlmostZero(orig.Z))
            {
                return(CreateDefaultMappedItem(file, repMap));
            }

            IFCAnyHandle origin        = CreateCartesianPoint(file, orig);
            double       scale         = 1.0;
            IFCAnyHandle mappingTarget =
                IFCInstanceExporter.CreateCartesianTransformationOperator3D(file, null, null, origin, scale, null);

            return(IFCInstanceExporter.CreateMappedItem(file, repMap, mappingTarget));
        }