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


C++ DBObjRecord::Data方法代码示例

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


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

示例1: Value

DBInt DBGridIF::Value (DBObjRecord *layerRec,DBPosition pos,DBFloat value)

	{
	DBInt j = DimensionVAR.Col * (DimensionVAR.Row - pos.Row - 1) + pos.Col;
	DBObjRecord *dataRec = LayerFLD->Record (layerRec);

	if (pos.Col < 0) return (DBFault);
	if (pos.Row < 0) return (DBFault);
	if (pos.Col >= DimensionVAR.Col) return (DBFault);
	if (pos.Row >= DimensionVAR.Row) return (DBFault);

	switch (ValueTypeVAR)
		{
		case DBTableFieldFloat:
			switch (ValueSizeVAR)
				{
				case sizeof (DBFloat4): ((DBFloat4 *) (dataRec->Data ())) [j] = (DBFloat4) value; break;
				case sizeof (DBFloat):  ((DBFloat *)  (dataRec->Data ())) [j] = value; break;
				}
			break;
		case DBTableFieldInt:
			switch (ValueSizeVAR)
				{
				case sizeof (DBByte):  ((DBByte *)  (dataRec->Data ())) [j] = (DBByte)  value;	break;
				case sizeof (DBShort): ((DBShort *) (dataRec->Data ())) [j] = (DBShort) value;	break;
				case sizeof (DBInt):   ((DBInt *)   (dataRec->Data ())) [j] = (DBInt)   value;	break;
				}
			break;
		}
	return (DBSuccess);
	}
开发者ID:amiara,项目名称:RGIS,代码行数:31,代码来源:DBGridMisc.C

示例2: Document

void DBObjData::Document(const char *docName, const char *string) {
    DBObjRecord *obj = DocsPTR->Item(docName);

    if (obj == (DBObjRecord *) NULL) {
        DocsPTR->Add(obj = new DBObjRecord(docName, sizeof(DBVarString)));
        memset(obj->Data(), 0, sizeof(DBVarString));
        ((DBVarString *) obj->Data())->VString(string);
    }
    else ((DBVarString *) obj->Data())->VString(string);
}
开发者ID:bmfekete,项目名称:RGIS,代码行数:10,代码来源:DBObjData.C

示例3: _Write

int DBObjData::_Write (FILE *file)

	{
	DBInt id, userFlags;
	DBObjRecord *docRec;

	userFlags = Flags () & DBDataFlagUserModeFlags;
	Flags (DBDataFlagUserModeFlags,DBClear);
	if (DBObject::Write (file) == DBFault)		return (DBFault);
	Flags (userFlags,DBSet);
	if (DocsPTR->Write (file) == DBFault)		return (DBFault);
	for (id = 0;id < DocsPTR->ItemNum ();++id)
		{
		if (DocsPTR->WriteItem (file,id) == DBFault) return (DBFault);
		docRec = DocsPTR->Item (id);
		if (((DBVarString *) docRec->Data ())->Write (file) == DBFault) return (DBFault);
		}
	if (ArraysPTR->Write (file) == DBFault)		return (DBFault);
	for (id = 0;id < ArraysPTR->ItemNum ();++id)
		if (ArraysPTR->WriteItem (file,id) == DBFault) return (DBFault);
	TablesPTR->Write (file);
	for (id = 0;id < TablesPTR->ItemNum ();++id)
		if (TablesPTR->WriteItem (file,id) == DBFault) return (DBFault);
	return (BuildFields ());
	}
开发者ID:gyelnats,项目名称:RGIS,代码行数:25,代码来源:DBObjReadWrit.C

示例4: return

char *DBObjData::Document(const char *docName) {
    DBObjRecord *obj = DocsPTR->Item(docName);
    if (obj == (DBObjRecord *) NULL) {
        if ((strcmp(docName, DBDocSubject) == 0) || (strcmp(docName, DBDocGeoDomain) == 0)) {
            Document(docName, (char *) "unspecified");
            return ((char *) "unspecified");
        }
        else return ((char *) "");
    }
    return (((DBVarString *) obj->Data())->VString());
}
开发者ID:bmfekete,项目名称:RGIS,代码行数:11,代码来源:DBObjData.C

示例5: DeleteField

void DBObjTable::DeleteField(DBObjTableField *delField) {
    DBInt i, recID, fieldID;
    DBObjRecord *record;
    DBObjTableField *field;
    unsigned char *data;

    for (fieldID = 0; fieldID < FieldPTR->ItemNum(); ++fieldID) {
        field = FieldPTR->Item(fieldID);
        if (field->StartByte() > delField->StartByte())
            field->StartByte(field->StartByte() - delField->Length());
    }
    for (recID = 0; recID < ItemNum(); ++recID) {
        record = Item(recID);
        data = (unsigned char *) record->Data() + delField->StartByte();
        for (i = 0; i < RecordLengthVAR - delField->StartByte() - delField->Length(); ++i)
            data[i] = data[i + delField->Length()];
        record->Realloc(RecordLengthVAR - delField->Length());
    }
    FieldPTR->Remove(delField);
    RecordLengthVAR -= delField->Length();
    delete delField;
}
开发者ID:ztessler,项目名称:RGIS,代码行数:22,代码来源:DBObjTables.C

示例6: Vertexes

void DBVLineIF::Vertexes (DBObjRecord *lineRec,DBCoordinate *coord,DBInt vertexNum)

	{
	DBInt vertex;
	DBFloat length = 0;
	DBCoordinate *vertexes, prevCoord;
	DBObjRecord *dataRec = (DBObjRecord *) NULL;
	DBObjectLIST<DBObjRecord> *dataArrays = Data ()->Arrays ();
	DBRegion lineExtent, dataExtent = Data ()->Extent ();
	DBMathDistanceFunction distFunc = DBMathGetDistanceFunction (Data ());

	prevCoord = NodeCoordFLD->Coordinate (FromNodeFLD->Record (lineRec));
	lineExtent.Expand (prevCoord);
	if (vertexNum > 0)
		{
		if ((dataRec = dataArrays->Item (lineRec->RowID ())) == (DBObjRecord *) NULL)
			{
			if ((dataRec = new DBObjRecord (lineRec->Name (),((size_t) vertexNum) * sizeof (DBCoordinate),sizeof (DBFloat))) == (DBObjRecord *) NULL) return;
			dataArrays->Add (dataRec);
			}
		else	dataRec->Realloc (vertexNum * sizeof (DBCoordinate));
		if ((vertexes = (DBCoordinate *) dataRec->Data ()) == NULL)
			{ CMmsgPrint (CMmsgSysError, "Memory Allocation Error in: %s %d",__FILE__,__LINE__); return; }
		for (vertex = 0;vertex < vertexNum;vertex++)
			{
			lineExtent.Expand (vertexes [vertex] = coord [vertex]);
			length += DBMathCoordinateDistance (distFunc,prevCoord,coord [vertex]);
			prevCoord = coord [vertex];
			}
		}
	VertexesFLD->Record (lineRec,dataRec);
	VertexNumFLD->Int (lineRec,vertexNum);
	length += DBMathCoordinateDistance (distFunc,prevCoord,NodeCoordFLD->Coordinate (ToNodeFLD->Record (lineRec)));
	PerimeterFLD->Float (lineRec,length);
	lineExtent.Expand (NodeCoordFLD->Coordinate (ToNodeFLD->Record (lineRec)));
	ExtentFLD->Region (lineRec,lineExtent);
	dataExtent.Expand (lineExtent);
	Data ()->Extent (dataExtent);
	}
开发者ID:bandi13,项目名称:RGIS,代码行数:39,代码来源:DBVLineMisc.C

示例7: _RGISUserFuncionQuery

void _RGISUserFuncionQuery (DBObjData *dbData,UI2DView *view,XEvent *event)

	{
	DBInt sX, sY;
	DBCoordinate coord;
	DBObjData *data = dbData;
	UIAttribView *attribView;

	if (event->type != ButtonPress) return;
	sX = event->xbutton.x;
	sY = event->xbutton.y;
	view->Window2Map  (sX,sY, &(coord.X), &(coord.Y));

	for (data = dbData;
		  (data != (DBObjData *) NULL) && ((data->Flags () & DBObjectFlagProcessed) != DBObjectFlagProcessed);
		  data = data->LinkedData ())
		{
		data->Flags (DBObjectFlagProcessed,DBSet);
		if ((data->Flags () & DBDataFlagUserModeFlags) == DBDataFlagUserModeQuery)
			{
			if ((attribView = (UIAttribView *) data->Display (UIAttribViewSTR)) == (UIAttribView *) NULL)
				data->DispAdd (attribView = new UIAttribView (data));
			switch (data->Type ())
				{
				case DBTypeVectorPoint:
				case DBTypeVectorLine:
				case DBTypeVectorPolygon:
					{
					DBVectorIF *vectorIF = new DBVectorIF (data);
					attribView->Draw (vectorIF->Item (coord));
					} break;
				case DBTypeGridDiscrete:
					{
					DBGridIF *gridIF = new DBGridIF (data);
					attribView->Draw (gridIF->GridItem (coord));
					delete gridIF;
					} break;
				case DBTypeGridContinuous:
					{
					DBPosition pos;
					DBGridIF *gridIF = new DBGridIF (data);
					char nameString [DBStringLength * 2];
					DBObjRecord *record = new DBObjRecord ("Noname",sizeof (DBCoordinate));
					gridIF->Coord2Pos (coord,pos);
					gridIF->Pos2Coord (pos,coord);
					sprintf (nameString,"CellCoordinate %10.2f%10.2f",coord.X,coord.Y);
					record->Name (nameString);
					memcpy (record->Data (),(void *) &coord,sizeof (coord));
					attribView->Draw (record);
					delete record;
					delete gridIF;
					} break;
				case DBTypeNetwork:
					{
					DBNetworkIF *netIF = new DBNetworkIF (data);
					attribView->Draw (netIF->Cell (coord));
					delete netIF;
					} break;
				default:
					CMmsgPrint (CMmsgAppError, "Invalid Data Type in: %s %d",__FILE__,__LINE__); break;
				}
			}
		}
	for (data = dbData;
		  (data != (DBObjData *) NULL) && ((data->Flags () & DBObjectFlagProcessed) == DBObjectFlagProcessed);
		  data = data->LinkedData ())
		data->Flags (DBObjectFlagProcessed,DBClear);
	}
开发者ID:gyelnats,项目名称:RGIS,代码行数:68,代码来源:RGISUsrFuncQry.C


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