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


C++ UIDataset函数代码示例

本文整理汇总了C++中UIDataset函数的典型用法代码示例。如果您正苦于以下问题:C++ UIDataset函数的具体用法?C++ UIDataset怎么用?C++ UIDataset使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: RGISAnNetworkBasinProfCBK

void RGISAnNetworkBasinProfCBK (Widget widget,RGISWorkspace *workspace,XmAnyCallbackStruct *callData)

	{
	DBDataset *dataset = UIDataset ();
	DBObjData *netData = dataset->Data ();
	DBObjData *gridData, *tblData;

	widget = widget; callData = callData;

	if ((gridData = netData->LinkedData ()) == (DBObjData *) NULL)
		{ CMmsgPrint (CMmsgAppError, "Null Linked Data in: %s %d",__FILE__,__LINE__); return; }

	tblData  = new DBObjData ("",DBTypeTable);
	tblData->Document (DBDocGeoDomain,netData->Document (DBDocGeoDomain));
	tblData->Document (DBDocSubject,"Basin Profiles");

	if (UIDataHeaderForm (tblData))
		{
		UIPauseDialogOpen ((char *) "Creating Basin Profiles");
		if (RGlibNetworkBasinProf (netData,gridData,tblData) == DBSuccess)
			workspace->CurrentData  (tblData);
		else	delete tblData;
		UIPauseDialogClose ();
		}
	else delete tblData;
	}
开发者ID:rjs80,项目名称:RGIS,代码行数:26,代码来源:RGISAnNetwork.C

示例2: _UI2DViewScaleValueChangedCBK

static void _UI2DViewScaleValueChangedCBK (Widget widget,UI2DView *view,XmScaleCallbackStruct *callData)

	{
	int value;
	double dval;
	DBCoordinate center, size;
	DBRegion extent, dataEXT = (UIDataset ())->Extent (), viewEXT = view->Extent ();

	if (callData->reason != XmCR_VALUE_CHANGED) return;

	value = callData->value;
	value = value > 0 ? value : 1;
	dval = (double) value / 100.0;

	center.X = (viewEXT.UpperRight.X + viewEXT.LowerLeft.X) / 2.0;
	center.Y = (viewEXT.UpperRight.Y + viewEXT.LowerLeft.Y) / 2.0;
	size.X	= dataEXT.UpperRight.X - dataEXT.LowerLeft.X;
	size.Y	= dataEXT.UpperRight.Y - dataEXT.LowerLeft.Y;

	size.X = size.X * dval;
	size.Y = size.Y * dval;

	center.X = dataEXT.LowerLeft.X  + size.X / 2.0 > center.X ? dataEXT.LowerLeft.X  + size.X / 2.0 : center.X;
	center.X = dataEXT.UpperRight.X - size.X / 2.0 < center.X ? dataEXT.UpperRight.X - size.X / 2.0 : center.X;

	center.Y = dataEXT.LowerLeft.Y + size.Y / 2.0 > center.Y ? dataEXT.LowerLeft.Y + size.Y / 2.0 : center.Y ;
	center.Y = dataEXT.UpperRight.Y - size.Y / 2.0 < center.Y ? dataEXT.UpperRight.Y - size.Y / 2.0 : center.Y ;

	viewEXT.LowerLeft.X = center.X - size.X / 2.0; viewEXT.LowerLeft.Y = center.Y - size.Y / 2.0;
	extent.LowerLeft  = viewEXT.LowerLeft;
	viewEXT.UpperRight.X = center.X + size.X / 2.0; viewEXT.UpperRight.Y = center.Y + size.Y / 2.0;
	extent.UpperRight = viewEXT.UpperRight;
	view->Set (extent);
	}
开发者ID:bandi13,项目名称:RGIS,代码行数:34,代码来源:UI2DView.C

示例3: RGISAnNetworkCellSlopesCBK

void RGISAnNetworkCellSlopesCBK (Widget widget,RGISWorkspace *workspace,XmAnyCallbackStruct *callData)

	{
	DBDataset *dataset = UIDataset ();
	DBObjData *netData = dataset->Data ();
	DBObjData *inGridData, *outGridData;

	widget = widget; callData = callData;

	if ((inGridData = netData->LinkedData ()) == (DBObjData *) NULL)
		{ CMmsgPrint (CMmsgAppError,"Null Linked Data in: %s %d",__FILE__,__LINE__); return; }

	outGridData = DBNetworkToGrid (netData,DBTypeGridContinuous);
	outGridData->Document (DBDocGeoDomain,inGridData->Document (DBDocGeoDomain));
	outGridData->Document (DBDocSubject,"Slope");
	if (UIDataHeaderForm (outGridData))
		{
		UIPauseDialogOpen ((char *) "Calculating Slopes");
		if (RGlibNetworkCellSlopes (netData,inGridData,outGridData) == DBSuccess)
			workspace->CurrentData  (outGridData);
		else	delete outGridData;
		UIPauseDialogClose ();
	 	}
	else	delete outGridData;
	}
开发者ID:rjs80,项目名称:RGIS,代码行数:25,代码来源:RGISAnNetwork.C

示例4: _UI2DViewExtentActivateCBK

static void _UI2DViewExtentActivateCBK(Widget widget, UI2DView *view, XmPushButtonCallbackStruct *callData) {
    DBObjData *data = (UIDataset())->Data();
    if (callData->reason != XmCR_ACTIVATE) return;
    if (data == (DBObjData *) NULL) return;

    view->Set(data->Extent());
}
开发者ID:bmfekete,项目名称:RGIS,代码行数:7,代码来源:UI2DView.C

示例5: RGISAnalysePointSubbasinHistCBK

void RGISAnalysePointSubbasinHistCBK (Widget widget, RGISWorkspace *workspace,XmAnyCallbackStruct *callData)

	{
	char *selection;
	DBDataset *dataset  = UIDataset ();
	DBObjData *pntData  = dataset->Data ();
	DBObjData *grdData  = pntData->LinkedData ();
	DBObjData *netData;
	DBObjData *tblData;
	static Widget selectWidget = (Widget) NULL;

	if (selectWidget == (Widget) NULL) selectWidget = UISelectionCreate ((char *) "Select Network");
	if ((selection = UISelectObject (selectWidget,(DBObjectLIST<DBObject> *) dataset->DataList (),_RGISAnalyseTestNetwork)) == (char *) NULL) return;
	if ((netData = dataset->Data (selection)) == (DBObjData *) NULL) {  return; }

	tblData  = new DBObjData ("",DBTypeTable);
	tblData->Document (DBDocGeoDomain,pntData->Document (DBDocGeoDomain));
	tblData->Document (DBDocSubject,"Subbasin Histogram");
	if (UIDataHeaderForm (tblData))
		{
		UIPauseDialogOpen ((char *) "Calculating Histogram");
		if (RGlibPointSubbasinHist (pntData,netData,grdData,tblData) == DBSuccess)
			workspace->CurrentData  (tblData);
		else	delete tblData;
		UIPauseDialogClose ();
		}
	else	delete tblData;
	}
开发者ID:gyelnats,项目名称:RGIS,代码行数:28,代码来源:RGISAnPoint.C

示例6: _RGISGrpPanelNewCBK

static void _RGISGrpPanelNewCBK (Widget widget,RGISGrpPanel *grpPanel,XmAnyCallbackStruct *callData)

	{
	char *groupName;
	DBDataset *dataset = UIDataset ();
	DBObjData *dbData  = dataset->Data ();
	DBObjTable *groupTable = dbData->Table (DBrNGroups);
	DBObjTableField *group;
	DBObjRecord *record;

	if ((groupName = UIGetString ((char *) "Group Name",16)) == (char *) NULL) return;
	if (groupTable == (DBObjTable *) NULL)
		{
		DBObjTable *items  = dbData->Table (DBrNItems);
		DBObjectLIST<DBObjTable> *tables  = dbData->Tables ();

		DBTableFieldDefinition fieldDefs [] =	{
					DBTableFieldDefinition (groupName,	DBTableFieldInt,(char *) 	"%1d",sizeof (DBByte)),
					DBTableFieldDefinition () };
		tables->Add (groupTable = new DBObjTable (DBrNGroups,fieldDefs));
		grpPanel->Groups (groupTable->Fields ());
		group = groupTable->Field (groupName);
		for (record = items->First ();record != (DBObjRecord *) NULL;record = items->Next ())
			group->Int (groupTable->Add (record->Name ()),true);
		}
	else
		{
		groupTable->AddField (group = new DBObjTableField (groupName,DBTableFieldInt,"%1d",sizeof (DBByte)));
		for (record = groupTable->First ();record != (DBObjRecord *) NULL;record = groupTable->Next ())
			group->Int (record,true);
		}
	grpPanel->Add (group);
	}
开发者ID:gyelnats,项目名称:RGIS,代码行数:33,代码来源:RGISPanels.C

示例7: RGISAnalysePointSTNCharCBK

void RGISAnalysePointSTNCharCBK (Widget widget, RGISWorkspace *workspace,XmAnyCallbackStruct *callData)

	{
	DBDataset *dataset = UIDataset ();
	DBObjData *dbData = dataset->Data ();
	DBObjTable *pointTable = dbData->Table (DBrNItems);
	DBObjTableField *cellIDFLD			= pointTable->Field (RGlibCellID);
	DBObjTableField *basinFLD			= pointTable->Field (DBrNBasin);
	DBObjTableField *basinNameFLD		= pointTable->Field (RGlibBasinName);
	DBObjTableField *orderFLD			= pointTable->Field (DBrNOrder);
	DBObjTableField *colorFLD			= pointTable->Field (RGlibColor);
	DBObjTableField *basinCellsFLD	= pointTable->Field (RGlibCellNum);
	DBObjTableField *basinLengthFLD	= pointTable->Field (RGlibLength);
	DBObjTableField *basinAreaFLD		= pointTable->Field (RGlibArea);
	DBObjTableField *interAreaFLD		= pointTable->Field (RGlibInterStation);
	DBObjTableField *nextStationFLD	= pointTable->Field (RGlibNextStation);
	UITable *tableCLS = (UITable *) dbData->Display (UITableName (dbData,pointTable));

	UIPauseDialogOpen ((char *) "STN Characteristics");
	if ((RGlibPointSTNCharacteristics (dbData) == DBSuccess) && (tableCLS != (UITable *) NULL))
		{
		if (cellIDFLD      == (DBObjTableField *) NULL) tableCLS->AddField (pointTable->Field (RGlibCellID));
		if (basinFLD       == (DBObjTableField *) NULL) tableCLS->AddField (pointTable->Field (DBrNBasin));
		if (basinNameFLD   == (DBObjTableField *) NULL) tableCLS->AddField (pointTable->Field (RGlibBasinName));
		if (orderFLD       == (DBObjTableField *) NULL) tableCLS->AddField (pointTable->Field (DBrNOrder));
		if (colorFLD       == (DBObjTableField *) NULL) tableCLS->AddField (pointTable->Field (RGlibColor));
		if (basinCellsFLD  == (DBObjTableField *) NULL) tableCLS->AddField (pointTable->Field (RGlibCellNum));
		if (basinLengthFLD == (DBObjTableField *) NULL) tableCLS->AddField (pointTable->Field (RGlibLength));
		if (basinAreaFLD   == (DBObjTableField *) NULL) tableCLS->AddField (pointTable->Field (RGlibArea));
		if (interAreaFLD   == (DBObjTableField *) NULL) tableCLS->AddField (pointTable->Field (RGlibInterStation));
		if (nextStationFLD == (DBObjTableField *) NULL) tableCLS->AddField (pointTable->Field (RGlibNextStation));
		tableCLS->Draw ();
		}
	UIPauseDialogClose ();
	}
开发者ID:gyelnats,项目名称:RGIS,代码行数:35,代码来源:RGISAnPoint.C

示例8: _UI2DViewFullActivateCBK

void _UI2DViewFullActivateCBK (Widget widget,UI2DView *view,XmPushButtonCallbackStruct *callData)

	{
	if (callData->reason != XmCR_ACTIVATE) return;

	view->Set ((UIDataset ())->Extent ());
	}
开发者ID:bandi13,项目名称:RGIS,代码行数:7,代码来源:UI2DView.C

示例9: RGISAnNetworkToGridCBK

void RGISAnNetworkToGridCBK (Widget widget,RGISWorkspace *workspace,XmAnyCallbackStruct *callData)

	{
	char *selection;
	DBInt dataType;
	DBDataset *dataset = UIDataset ();
	DBObjData *netData = dataset->Data ();
	DBObjTable *cellTable = netData->Table (DBrNCells);
	DBObjTableField *field;
	DBObjData *grdData;
	static Widget select = NULL;

	if (select == NULL) select = UISelectionCreate ((char *) "Field Selection");
	selection = UISelectObject (select,(DBObjectLIST<DBObject> *) (cellTable->Fields ()),DBTableFieldIsSimple);
	if (selection == (char *) NULL) return;
	if ((field = cellTable->Field (selection)) == (DBObjTableField *) NULL)
		{ CMmsgPrint (CMmsgAppError,"Corrupt Network Dataset in: %s %d",__FILE__,__LINE__); return; }

	if (DBTableFieldIsCategory (field) && DBTableFieldIsNumeric (field))
		{
		DBObjData *tmpData;
		tmpData = new DBObjData ("",DBTypeGrid);
		tmpData->Document (DBDocGeoDomain,netData->Document (DBDocGeoDomain));
		tmpData->Document (DBDocSubject,field->Name ());
		if (UIDataHeaderForm (tmpData))
			{
			grdData = DBNetworkToGrid (netData,tmpData->Type ());
			grdData->Name (tmpData->Name ());
			grdData->Document (DBDocGeoDomain,tmpData->Document (DBDocGeoDomain));
			grdData->Document (DBDocSubject,tmpData->Document (DBDocSubject));
			grdData->Document (DBDocVersion,tmpData->Document (DBDocVersion));
			grdData->Document (DBDocCitationRef,tmpData->Document (DBDocCitationRef));
			grdData->Document (DBDocCitationInst,tmpData->Document (DBDocCitationInst));
			grdData->Document (DBDocSourceInst,tmpData->Document (DBDocSourceInst));
			grdData->Document (DBDocSourcePerson,tmpData->Document (DBDocSourcePerson));
			grdData->Document (DBDocOwnerPerson,tmpData->Document (DBDocOwnerPerson));
			grdData->Document (DBDocComment,tmpData->Document (DBDocComment));
			delete tmpData;
			}
		else { return; }
		}
	else
		{
		if (DBTableFieldIsCategory (field))		dataType = DBTypeGridDiscrete;
		else if (DBTableFieldIsNumeric (field))	dataType = DBTypeGridContinuous;
		else
			{
			CMmsgPrint (CMmsgAppError,"Invalid field type in: %s %d",__FILE__,__LINE__);
			return;
			}
		grdData = DBNetworkToGrid (netData,dataType);
		if (UIDataHeaderForm (grdData) == false) { delete grdData; return; }
		}

	UIPauseDialogOpen ((char *) "Converting Network to Grid");
	if (RGlibNetworkToGrid (netData,field,grdData) == DBSuccess) workspace->CurrentData (grdData);
	else delete grdData;
	UIPauseDialogClose ();
	}
开发者ID:rjs80,项目名称:RGIS,代码行数:59,代码来源:RGISAnNetwork.C

示例10: RGISAnNetworkCellSampleGridCBK

void RGISAnNetworkCellSampleGridCBK (Widget widget, RGISWorkspace *workspace,XmAnyCallbackStruct *callData)

	{
	DBDataset *dataset = UIDataset ();
	DBObjData *netData  = dataset->Data (), *grdData = netData->LinkedData ();

	UIPauseDialogOpen ((char *) "Cell Sampling");
	RGlibGridSampling (netData,grdData,true);
	UIPauseDialogClose ();
	}
开发者ID:bandi13,项目名称:RGIS,代码行数:10,代码来源:RGISAnNetwork.C

示例11: RGISEditGridRemovePitsCBK

void RGISEditGridRemovePitsCBK (Widget widget, RGISWorkspace *workspace,XmAnyCallbackStruct *callData)

	{
	DBDataset *dataset = UIDataset ();
	DBObjData *grdData = dataset->Data ();
	DBObjData *netData = grdData->LinkedData ();

	UIPauseDialogOpen ((char *) "Removing Pits");
	RGlibGridRemovePits (netData,grdData);
	UIPauseDialogClose ();
	}
开发者ID:bandi13,项目名称:RGIS,代码行数:11,代码来源:RGISEditGrid.C

示例12: _RGISMetaDBDeleteCBK

static void _RGISMetaDBDeleteCBK (Widget widget,RGISWorkspace *workspace,XmAnyCallbackStruct *callData)

	{
	char *subjectSTR = strlen (workspace->Subject ()) > 0 ? workspace->Subject () : (char *) NULL;
	char *domainSTR  = strlen (workspace->Domain ())  > 0 ? workspace->Domain ()  : (char *) NULL;
	DBObjMetaEntry *metaEntry;
	DBDataset *dataset = UIDataset ();

	if ((metaEntry = UIDatasetMetaData (subjectSTR,domainSTR,DBFault)) != (DBObjMetaEntry *) NULL)
		dataset->DeleteMetaEntry (metaEntry);
	}
开发者ID:bandi13,项目名称:RGIS,代码行数:11,代码来源:RGISMetaDB.C

示例13: _RGISToolsDuplicateCBK

static void _RGISToolsDuplicateCBK (Widget widget,RGISWorkspace *workspace,XmAnyCallbackStruct *callData)

	{
	DBDataset *dataset = UIDataset ();
	DBObjData *dbData = dataset->Data (), *newData;

	if (dbData == (DBObjData *) NULL) return;
	widget = widget; callData = callData;
	if (UIDataHeaderForm (newData = new DBObjData (*dbData)))
		workspace->CurrentData  (newData);
	else delete newData;
	}
开发者ID:rjs80,项目名称:RGIS,代码行数:12,代码来源:RGISTools.C

示例14: RGISEditNetDistToOceanCBK

void RGISEditNetDistToOceanCBK (Widget widget, RGISWorkspace *workspace,XmAnyCallbackStruct *callData)

	{
	DBDataset *dataset = UIDataset ();
	DBObjData *netData = dataset->Data ();
	DBNetworkIF *netIF = new DBNetworkIF (netData);

	UIPauseDialogOpen ((char *) "Calculate Distance to Ocean");
	netIF->SetDistToOcean ();
	UIPauseDialogClose ();
	delete netIF;
	}
开发者ID:bandi13,项目名称:RGIS,代码行数:12,代码来源:RGISEditNet.C

示例15: RGISEditGridStatsCBK

void RGISEditGridStatsCBK (Widget widget, RGISWorkspace *workspace,XmAnyCallbackStruct *callData)

	{
	DBDataset *dataset = UIDataset ();
	DBObjData *dbData = dataset->Data ();
	DBGridIF *gridIF = new DBGridIF (dbData);
	UITable *tableCLS = (UITable *) dbData->Display (UITableName (dbData,dbData->Table (DBrNItems)));

	if (dbData->Type () == DBTypeGridContinuous)
			gridIF->RecalcStats ();
	else	gridIF->DiscreteStats ();
	if (tableCLS != (UITable *) NULL) tableCLS->Draw ();
	}
开发者ID:bandi13,项目名称:RGIS,代码行数:13,代码来源:RGISEditGrid.C


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