wiki:MapGuideRfc33

Version 7 (modified by trevorwekel, 17 years ago) ( diff )

--

MapGuide RFC 33 - Convenience Methods for Selection

This page contains an change request (RFC) for the MapGuide Open Source project. More MapGuide RFCs can be found on the RFCs page.

Status

RFC Template Version1.0
Submission DateSeptember 5, 2007
Last Modifiedtrevorwekel Timestamp
AuthorTrevor Wekel
RFC Statusadopted
Implementation Statuscompleted
Proposed Milestone2.0
Assigned PSC guide(s)
Voting HistorySeptember 5, 2007
+1Paul, Jason, Andy, Haris, Bruce, Tom, Bob
+0
-0
-1

Overview

This RFC adds convenience methods to MgSelection so that selected features can be obtained in a more straightforward fashion.

Motivation

The existing MgSelection API does not provide easy access to the selected features and is a bit of a hassle to use.

Proposed Solution

Implement three new methods for MgSelection through MgSelectionBase

/// Returns the number of selected features for the specified feature class. 
///
/// Input parameters
/// layer: Input layer, className: Feature class name
///
/// Returns a count of all selected features
///
INT32 GetSelectedFeaturesCount(MgLayerBase* layer, CREFSTRING className);
/// Returns the selected feature data for the specified feature class.
///
/// Input parameters
/// layer: Input layer, className: Feature class name
/// mappedOnly: return mapped (true) or all (false) properties for selected features
///
/// Returns a feature reader containing all the features for the given 
/// feature class in this selection.
///
MgFeatureReader* GetSelectedFeatures(MgLayerBase* layer, CREFSTRING className, bool mappedOnly);
/// Returns the selected feature data for the specified feature class.
///
/// Input parameters
/// layer: Input layer, className: Feature class name
/// propertyNames: properties to return for selected features
///
/// Returns a feature reader containing all the features for the given 
/// feature class in this selection.
///
MgFeatureReader* GetSelectedFeatures(MgLayerBase* layer, CREFSTRING className, MgStringCollection* propertyNames);

These methods will be implemented using existing MgSelection and MgLayer functionality.

Implications

None. These are new API additions so backward compatibility is maintained. Documentation will be autogenerated from the header file.

Test Plan

Validate that new APIs function correctly by returning the correct features and count. Perform visual testing with the existing sample applications to ensure that the existing MgSelection APIs are still functioning correctly.

Funding/Resources

Autodesk will providing funding and resources.

Note: See TracWiki for help on using the wiki.