[C#]
ICommand cmd = new ControlsGlobeOrbitalFlyToolClass();
cmd.OnCreate(axGlobeControl1.Object);if (cmd.Enabled) axGlobeControl1.CurrentTool = cmd as ITool;
ITool tool = cmd as ITool;
//显示指北针
axGlobeControl1.GlobeViewer.NorthArrowEnabled = true;
axGlobeControl1.GlobeDisplay.RefreshViewers();
[Qt C++]
ICommandPtr cmd(CLSID_ControlsGlobeOrbitalFlyTool);
IDispatchPtr disp;
m_IpGlobeControl->get_Object(&disp);
cmd->OnCreate(disp);
VARIANT_BOOL bEnable;
hr = cmd->get_Enabled(&bEnable);
if(bEnable)
{
m_IpGlobeControl->putref_CurrentTool(IToolPtr(cmd));
}
//显示指北针
m_IpGlobeViewer->put_NorthArrowEnabled(VARIANT_TRUE);
M_IpGlobeDisplay->RefreshViewers();