コード例 #1
0
ファイル: P3Dbase.cs プロジェクト: Egyuza/Bentley.simpen
        public BCOM.Matrix3d getRotation()
        {
            BCOM.Matrix3d rot;
            rot.RowX = App.Point3dFromXYZ(
                OrientationMatrix_x0,
                OrientationMatrix_x1,
                OrientationMatrix_x2);
            //rot.RowX = RoundTool.roundExt(rot.RowX, 5, 10, 0);
            rot.RowX = RoundTool.roundExt(rot.RowX, 0.00001);

            rot.RowY = App.Point3dFromXYZ(
                OrientationMatrix_y0,
                OrientationMatrix_y1,
                OrientationMatrix_y2);
            rot.RowY = RoundTool.roundExt(rot.RowY, 0.00001);
            //rot.RowY = RoundTool.roundExt(rot.RowY, 5, 10, 0);

            rot.RowZ = App.Point3dFromXYZ(
                OrientationMatrix_z0,
                OrientationMatrix_z1,
                OrientationMatrix_z2);
            rot.RowZ = RoundTool.roundExt(rot.RowZ, 0.00001);
            //rot.RowZ = RoundTool.roundExt(rot.RowZ, 5, 10, 0);

            return(rot);
        }
コード例 #2
0
        public void SetRefPoint(int index, string coords)
        {
            BCOM.Point3d?pointInfo = ElementHelper.GetPoint3d(coords);

            if (!pointInfo.HasValue)
            {
                RefPoints[index] = null;
            }
            else if (index < RefPoints.Length)
            {
                BCOM.Point3d pt = RoundTool.roundExt(
                    pointInfo.Value, /* 5 мм */ 5 / UOR.activeSubPerMaster);
                RefPoints[index] = pt;
            }
        }
コード例 #3
0
        private BCOM.Matrix3d getRotation_(XDocument xdoc)
        {
            BCOM.Matrix3d rot = App.Matrix3dIdentity();
            foreach (XElement tag in xdoc.Root.Elements())
            {
                string tagName = tag.Name.LocalName;
                if (!tagName.IsMatch("(P3DEquipment)|(P3DHangerPipeSupport)"))
                {
                    continue;
                }

                foreach (XElement node in tag.Elements())
                {
                    string name = node.Name.LocalName;
                    if (name.IsMatch("OrientationMatrix"))
                    {
                        if (name.IsMatch("x0$"))
                        {
                            rot.RowX.X = node.Value.ToDouble();
                        }
                        else if (name.IsMatch("x1$"))
                        {
                            rot.RowX.Y = node.Value.ToDouble();
                        }
                        else if (name.IsMatch("x2$"))
                        {
                            rot.RowX.Z = node.Value.ToDouble();
                        }
                        else if (name.IsMatch("y0$"))
                        {
                            rot.RowY.X = node.Value.ToDouble();
                        }
                        else if (name.IsMatch("y1$"))
                        {
                            rot.RowY.Y = node.Value.ToDouble();
                        }
                        else if (name.IsMatch("y2$"))
                        {
                            rot.RowY.Z = node.Value.ToDouble();
                        }
                        else if (name.IsMatch("z0$"))
                        {
                            rot.RowZ.X = node.Value.ToDouble();
                        }
                        else if (name.IsMatch("z1$"))
                        {
                            rot.RowZ.Y = node.Value.ToDouble();
                        }
                        else if (name.IsMatch("z2$"))
                        {
                            rot.RowZ.Z = node.Value.ToDouble();
                        }
                    }
                }
            }

            rot.RowX = RoundTool.roundExt(rot.RowX, 0.00001);
            rot.RowY = RoundTool.roundExt(rot.RowY, 0.00001);
            rot.RowZ = RoundTool.roundExt(rot.RowZ, 0.00001);

            return(rot);
        }