Opened 16 years ago

Closed 16 years ago

#244 closed defect (fixed)

FDOGeometricType not exposed in DotNET API

Reported by: chrisErickson Owned by: gregboone
Priority: minor Milestone: 3.3.0
Component: FDO API Version: 3.2.0
Severity: 3 Keywords:
Cc: External ID:

Description

The FDOGeometricType enumeration is not exposed in the Managed API.

Change History (6)

comment:1 by chrisErickson, 16 years ago

As an addition to this, when passing Enumerations that are bitwise in a DotNet API, you can still use the Enum name in the signature rather than casting it to an int. This makes the API much more friendly, especially when there are similarly named enumerations.

For instance: with a given enum of:

public enum GeometricType {

GeometricType_Point = 1, GeometricType_Curve = 2, GeometricType_Surface = 4, GeometricType_Solid = 8,

}

The signature for int GeometricPropertyDefinition::GeometryTypes could be: GeometryType GeometricPropertyDefinition::GeometryTypes

and GeometryTypes can return GeometricType_Solid | GeometricType_Surface

Similarly, void GeometricPropertyDefinition::set_SpecificGeometryTypes(GeometryType[] types, int length) could be void GeometricPropertyDefinition::set_SpecificGeometryTypes(GeometryType types)

and the user could hand in GeometricPropertyDefinition::set_SpecificGeometryTypes(GeometricType_Solid | GeometricType_Surface)

comment:2 by gregboone, 16 years ago

Resolution: invalid
Status: newclosed

The GeometricType Enumeration is currently defined in the FDO 3.3.0 Managed API as...

enum OSGeo::FDO::Schema::GeometricType

in file...

[trunk]\Fdo\Managed\Src\OSGeo\FDO\Schema\mgGeometricType.h

as follows...

/// \ingroup (OSGeoFDOSchema)
/// \brief
/// The GeometricType enumeration categorizes all of the geometry types
/// supported by FDO based on their geometric dimensionality.
public __value enum GeometricType
{
    /// Represents 0-dimensional geometric primitives, such as Points.
    GeometricType_Point = 0x01,

    /// Represents 1 dimensional geometric primitives, such as Curves and Lines.
    GeometricType_Curve = 0x02,

    /// Represents 2 dimensional geometric primitives, such as Polygons.
    GeometricType_Surface = 0x04,

    /// Represents 3 dimensional geometric primitives, such as Cubes.
    GeometricType_Solid = 0x08,

    /// All
    GeometricType_All = 0x01|0x02|0x04|0x08
};

Usage:

GeometricPropertyDefinition pGeomProp = new GeometricPropertyDefinition("Geometry", "location and shape");
pGeomProp.GeometryTypes = GeometricType.GeometricType_All;
pGeomProp.HasMeasure = true;
pGeomProp.ReadOnly = true;
pGeomProp.SpatialContextAssociation = "SC_0";
pGeomProp.Attributes.Add("Measure Units", "metres");
pDevClass.Properties.Add(pGeomProp);

comment:3 by crispinatime, 16 years ago

Hi,

I am using FDO 3.3 RC1 in .net and cannot see the enum described?!

OSGeo.FDO.Schema.GeometricType

Crispin

comment:4 by gregboone, 16 years ago

Resolution: invalid
Status: closedreopened

Ok. I see the issue. The enum is defined but not exported to the .NET Assembly.

comment:5 by gregboone, 16 years ago

Author: gregboone Date: 2008-01-30 14:29:10 -0500 (Wed, 30 Jan 2008) New Revision: r3754

Modified:

trunk/Fdo/Managed/Src/OSGeo/FDO/mgObjectFactory.cpp

Log: Ticket #244: FDO GeometricType not exposed in Dot NET API

comment:6 by gregboone, 16 years ago

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.