Opened 17 years ago
Closed 17 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 , 17 years ago
comment:2 by , 17 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
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 , 17 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 , 17 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
Ok. I see the issue. The enum is defined but not exported to the .NET Assembly.
comment:5 by , 17 years ago
comment:6 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Note:
See TracTickets
for help on using tickets.
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 {
}
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)