当前位置: 首页>>代码示例>>C++>>正文


C++ Ptr::ClearChanges方法代码示例

本文整理汇总了C++中Ptr::ClearChanges方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::ClearChanges方法的具体用法?C++ Ptr::ClearChanges怎么用?C++ Ptr::ClearChanges使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Ptr的用法示例。


在下文中一共展示了Ptr::ClearChanges方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetMapLegendImage

//////////////////////////////////////////////////////////////////
// processes a GetMapLegendImage request from the Viewer and returns
// an image of the specified maps legend.
//
MgByteReader* MgHtmlController::GetMapLegendImage(CREFSTRING mapName,
    CREFSTRING format, MgColor* backgroundColor, INT32 width,
    INT32 height)
{
    // Create a Resource Service instance
    Ptr<MgResourceService> resourceService = (MgResourceService*)GetService(MgServiceType::ResourceService);

    // Create MgMap
    Ptr<MgMap> map = new MgMap();
    map->Open(resourceService, mapName);

    // Make sure we clear any track changes - these are not applicable for AJAX.
    Ptr<MgNamedCollection> changeLists = map->GetChangeLists();
    if (changeLists->GetCount() > 0)
    {
        map->ClearChanges();
        map->Save(resourceService);
    }

    // Create Proxy Rendering Service instance
    Ptr<MgRenderingService> service = (MgRenderingService*)(GetService(MgServiceType::RenderingService));

    // Call the C++ API
    return service->RenderMapLegend(map, width, height, backgroundColor, format);
}
开发者ID:asir6,项目名称:Colt,代码行数:29,代码来源:HtmlController.cpp

示例2: GetDynamicMapOverlayImage_ViewCommands

//////////////////////////////////////////////////////////////////
// Processes a GetDynamicMapOverlayImage request from the Viewer and returns an image of the specified map.
//
MgByteReader* c_RestFetchImage::GetDynamicMapOverlayImage_ViewCommands(c_RestMgSiteConnection* MgSiteConn,CREFSTRING mapName, CREFSTRING format, bool bKeepSelection,MgPropertyCollection* mapViewCommands)
{
	// Create a Resource Service instance
	Ptr<MgResourceService> resourceService = (MgResourceService*)MgSiteConn->CreateService(MgServiceType::ResourceService);

	// Create MgMap
	Ptr<MgMap> map = new MgMap();
	map->Open(resourceService, mapName);

	// Apply map view commands
	ApplyMapViewCommands(map, mapViewCommands);

	// Make sure we clear any track changes - these are not applicable for AJAX.
	Ptr<MgNamedCollection> changeLists = map->GetChangeLists();
	if (changeLists->GetCount() > 0)
	{
		map->ClearChanges();
		map->Save(resourceService);
	}

	// Get the selection
	Ptr<MgSelection> selection = new MgSelection(map);
	selection->Open(resourceService, mapName);

	// Create Proxy Rendering Service instance
	Ptr<MgRenderingService> service = (MgRenderingService*)(MgSiteConn->CreateService(MgServiceType::RenderingService));

	// Call the C++ API
	return service->RenderDynamicOverlay(map, selection, format, bKeepSelection);
}//end of c_RestFetchImage::GetDynamicMapOverlayImage_ViewCommands
开发者ID:Victorcasas,项目名称:georest,代码行数:33,代码来源:c_RestFetchImage.cpp

示例3: GetDynamicMapOverlayImage

//////////////////////////////////////////////////////////////////
// Processes a GetDynamicMapOverlayImage request from the Viewer and returns an image of the specified map.
//
MgByteReader* MgHtmlController::GetDynamicMapOverlayImage(CREFSTRING mapName, MgRenderingOptions* options, MgPropertyCollection* mapViewCommands)
{
    // Create a Resource Service instance
    Ptr<MgResourceService> resourceService = (MgResourceService*)GetService(MgServiceType::ResourceService);

    // Create MgMap
    Ptr<MgMap> map = new MgMap();
    map->Open(resourceService, mapName);

    // Make sure we clear any track changes - these are not applicable for AJAX.
    Ptr<MgNamedCollection> changeLists = map->GetChangeLists();
    if (changeLists->GetCount() > 0)
    {
        map->ClearChanges();
        map->Save(resourceService);
    }

    // Get the selection
    Ptr<MgSelection> selection = new MgSelection(map);
    selection->Open(resourceService, mapName);

    // Apply map view commands
    ApplyMapViewCommands(map, mapViewCommands);

    // Make sure we clear any track changes - these are not applicable for AJAX.
    map->ClearChanges();

    // Save the MgMap state
    map->Save(resourceService);

    // Create Proxy Rendering Service instance
    Ptr<MgRenderingService> service = (MgRenderingService*)(GetService(MgServiceType::RenderingService));

    // Call the C++ API
    return service->RenderDynamicOverlay(map, selection, options);
}
开发者ID:asir6,项目名称:Colt,代码行数:39,代码来源:HtmlController.cpp

示例4: QueryMapFeatures

//////////////////////////////////////////////////////////////////
// Processes a QueryMapFeatures request from the Viewer
//
MgByteReader* MgHtmlController::QueryMapFeatures(
    CREFSTRING mapName,
    MgStringCollection* layerNames,
    MgGeometry* selectionGeometry,
    INT32 selectionVariant,
    CREFSTRING featureFilter,
    INT32 maxFeatures,
    bool persist,
    INT32 layerAttributeFilter)
{
    // Create a Resource Service instance
    Ptr<MgResourceService> resourceService = (MgResourceService*)GetService(MgServiceType::ResourceService);

    // Create MgMap
    Ptr<MgMap> map = new MgMap();
    map->Open(resourceService, mapName);

    // Make sure we clear any track changes - these are not applicable for AJAX.
    Ptr<MgNamedCollection> changeLists = map->GetChangeLists();
    if (changeLists->GetCount() > 0)
    {
        map->ClearChanges();
        map->Save(resourceService);
    }

    // Create Proxy Rendering Service instance
    Ptr<MgRenderingService> service = (MgRenderingService*)(GetService(MgServiceType::RenderingService));

    // Call the C++ API
    Ptr<MgFeatureInformation> featureInfo = service->QueryFeatures(map, layerNames, selectionGeometry,
        selectionVariant, featureFilter, maxFeatures, layerAttributeFilter);

    if(persist)
    {
        //save the selection set in the session repository
        Ptr<MgSelection> selection = featureInfo->GetSelection();
        if(!selection)
            selection = new MgSelection(map);
        selection->Save(resourceService, mapName);
    }

    // Return XML
    return featureInfo->ToXml();
}
开发者ID:asir6,项目名称:Colt,代码行数:47,代码来源:HtmlController.cpp

示例5: GetVisibleMapExtent

//////////////////////////////////////////////////////////////////
// Processes a GetVisibleMapExtent request from the Viewer and returns info on the specified map.
//
MgByteReader* MgHtmlController::GetVisibleMapExtent(CREFSTRING mapName,
    MgPropertyCollection* mapViewCommands)
{
    // Create a Resource Service instance
    Ptr<MgResourceService> resourceService = (MgResourceService*)GetService(MgServiceType::ResourceService);

    // Open the MgMap
    Ptr<MgMap> map = new MgMap();
    map->Open(resourceService, mapName);

    // Apply map view commands
    ApplyMapViewCommands(map, mapViewCommands);

    // Make sure we clear any track changes - these are not applicable for AJAX.
    map->ClearChanges();

    // Save the MgMap state
    map->Save(resourceService);

    // Calculate mcs width and height
    double metersPerUnit = map->GetMetersPerUnit();
    double mapScale = map->GetViewScale();
    double devW = map->GetDisplayWidth();
    double devH = map->GetDisplayHeight();
    double metersPerPixel = 0.0254 / map->GetDisplayDpi();

    double mcsW = mapScale * devW * metersPerPixel / metersPerUnit;
    double mcsH = mapScale * devH * metersPerPixel / metersPerUnit;

    // Make an envelope
    Ptr<MgPoint> center = map->GetViewCenter();
    Ptr<MgCoordinate> coord = center->GetCoordinate();
    Ptr<MgCoordinateXY> coord0 = new MgCoordinateXY(coord->GetX() - 0.5*mcsW, coord->GetY() - 0.5*mcsH);
    Ptr<MgCoordinateXY> coord1 = new MgCoordinateXY(coord->GetX() + 0.5*mcsW, coord->GetY() + 0.5*mcsH);
    Ptr<MgEnvelope> envelope = new MgEnvelope(coord0, coord1);

    // Return XML
    return envelope->ToXml();
}
开发者ID:asir6,项目名称:Colt,代码行数:42,代码来源:HtmlController.cpp


注:本文中的Ptr::ClearChanges方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。