Esempio n. 1
0
        public static SdoGeometryTypes.GTYPE generateGeometryFromSDO(SdoGeometry sdoGeomData, out object geomOut)
        {
            SdoGeometryTypes.GTYPE sdoGtype;
            int gtype   = sdoGeomData.PropertiesFromGTYPE();
            int geomtyp = sdoGeomData.GeometryType;

            if (geomtyp == (int)SdoGeometryTypes.GTYPE.SOLID || geomtyp == (int)SdoGeometryTypes.GTYPE.MULTISOLID)
            {
                Polyhedron geomOutPH;
                generate_Polyhedron(sdoGeomData, out geomOutPH);
                geomOut  = geomOutPH;
                sdoGtype = SdoGeometryTypes.GTYPE.SOLID;
            }
            else if (geomtyp == (int)SdoGeometryTypes.GTYPE.POLYGON && sdoGeomData.OrdinatesArrayOfDoubles.Count() == 6)
            {  // Bounding Box
                BoundingBox3D bbox;
                generate_BoundingBox(sdoGeomData, out bbox);
                geomOut  = bbox;
                sdoGtype = SdoGeometryTypes.GTYPE.POLYGON;
            }
            else if (geomtyp == (int)SdoGeometryTypes.GTYPE.POLYGON || geomtyp == (int)SdoGeometryTypes.GTYPE.MULTIPOLYGON)
            {
                Face3D geomOutF3D;
                generate_Face3D(sdoGeomData, out geomOutF3D);
                geomOut  = geomOutF3D;
                sdoGtype = SdoGeometryTypes.GTYPE.POLYGON;
            }
            else if (geomtyp == (int)SdoGeometryTypes.GTYPE.LINE || geomtyp == (int)SdoGeometryTypes.GTYPE.MULTILINE)
            {
                List <LineSegment3D> geomOutLS;
                generate_Line(sdoGeomData, out geomOutLS);
                geomOut  = geomOutLS;
                sdoGtype = SdoGeometryTypes.GTYPE.LINE;
            }
            else if (geomtyp == (int)SdoGeometryTypes.GTYPE.POINT || geomtyp == (int)SdoGeometryTypes.GTYPE.MULTIPOINT)
            {
                List <Point3D> geomOutP;
                generate_Point(sdoGeomData, out geomOutP);
                geomOut  = geomOutP;
                sdoGtype = SdoGeometryTypes.GTYPE.POINT;
            }
            else
            {
                throw new Exception("Geometry not supported!");
            }

            return(sdoGtype);
        }
Esempio n. 2
0
        public static bool generate_Point(SdoGeometry geom, out List <Point3D> pointList)
        {
            pointList = new List <Point3D>();
            int gtype = geom.PropertiesFromGTYPE();

            if (geom.GeometryType == (int)SdoGeometryTypes.GTYPE.MULTIPOINT)
            {
                int[]    elInfo   = geom.ElemArrayOfInts;
                double[] ordArray = geom.OrdinatesArrayOfDoubles;
                for (int oCount = 0; oCount < elInfo.Count() / 3; oCount++)
                {
                    Point3D point = new Point3D(ordArray[(oCount * 3) + 0], ordArray[(oCount * 3) + 1], ordArray[(oCount * 3) + 2]);
                    pointList.Add(point);
                }
            }
            else
            {
                Point3D point = sdopointToPoint3D(geom.SdoPoint);
                pointList.Add(point);
            }
            return(true);
        }