本文整理汇总了C++中DBObjTable::Delete方法的典型用法代码示例。如果您正苦于以下问题:C++ DBObjTable::Delete方法的具体用法?C++ DBObjTable::Delete怎么用?C++ DBObjTable::Delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBObjTable
的用法示例。
在下文中一共展示了DBObjTable::Delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DBImportARCPoly
int DBImportARCPoly (DBObjData *vecData,const char *arcCov)
{
DBInt polyNum = 0, line, lineNum, vertexNum, polyDir;
DBObjTable *items = vecData->Table (DBrNItems);
DBObjTable *lines = vecData->Table (DBrNContours);
DBObjTableField *firstLineFLD = items->Field (DBrNFirstLine);
DBObjTableField *lineNumFLD = items->Field (DBrNLineNum);
DBObjTableField *polyVertexNumFLD = items->Field (DBrNVertexNum);
DBObjTableField *polyExtentFLD = items->Field (DBrNRegion);
DBObjTableField *leftPolyFLD = lines->Field (DBrNLeftPoly);
DBObjTableField *rightPolyFLD = lines->Field (DBrNRightPoly);
DBObjTableField *nextLineFLD = lines->Field (DBrNNextLine);
DBObjTableField *prevLineFLD = lines->Field (DBrNPrevLine);
DBObjTableField *fromNodeFLD = lines->Field (DBrNFromNode);
DBObjTableField *toNodeFLD = lines->Field (DBrNToNode);
DBObjTableField *lineVertextNumFLD = lines->Field (DBrNVertexNum);
DBObjTableField *lineExtentFLD = lines->Field (DBrNRegion);
DBObjRecord *polyRec, *lineRec, *firstNodeRec, *nodeRec, **lineRecArray;
DBRegion extent, initRegion;
if (DBImportARCLine (vecData,arcCov) == DBFault) return (DBFault);
items->Delete (0);
for (polyRec = items->First ();polyRec != (DBObjRecord *) NULL;polyRec = items->Next ())
lineNumFLD->Int (polyRec,0);
for (lineRec = lines->First ();lineRec != (DBObjRecord *) NULL;lineRec = lines->Next ())
{
rightPolyFLD->Record (lineRec,items->Item ((DBInt) (rightPolyFLD->Record(lineRec) - (DBObjRecord *) NULL)));
leftPolyFLD->Record (lineRec,items->Item ((DBInt) (leftPolyFLD->Record (lineRec) - (DBObjRecord *) NULL)));
nextLineFLD->Record (lineRec,(DBObjRecord *) NULL);
prevLineFLD->Record (lineRec,(DBObjRecord *) NULL);
}
if ((lineRecArray = (DBObjRecord **) calloc (lines->ItemNum (),sizeof (DBObjRecord *))) == (DBObjRecord **) NULL)
{ CMmsgPrint (CMmsgSysError, "Memory Allocation Error in: %s %d",__FILE__,__LINE__); return (DBFault); }
for (polyRec = items->First ();polyRec != (DBObjRecord *) NULL;polyRec = items->Next ())
{
DBPause ((++polyNum * 100) / items->ItemNum ());
lineNum = vertexNum = 0;
extent = initRegion;
for (lineRec = lines->First ();lineRec != (DBObjRecord *) NULL;lineRec = lines->Next ())
if ((rightPolyFLD->Record (lineRec) == polyRec) || (leftPolyFLD->Record (lineRec) == polyRec))
{
lineRecArray [lineNum++] = lineRec;
vertexNum += lineVertextNumFLD->Int (lineRec);
extent.Expand (lineExtentFLD->Region (lineRec));
}
lineNumFLD->Int (polyRec,lineNum);
polyExtentFLD->Region (polyRec,extent);
firstLineFLD->Record (polyRec,lineRecArray [0]);
firstNodeRec = (rightPolyFLD->Record (lineRecArray [0]) == polyRec) ?
fromNodeFLD->Record (lineRecArray [0]) : toNodeFLD->Record(lineRecArray [0]);
for (lineNum = 1;lineNum < lineNumFLD->Int (polyRec);++lineNum)
{
polyDir = (rightPolyFLD->Record (lineRecArray [lineNum - 1]) == polyRec);
nodeRec = polyDir ? toNodeFLD->Record (lineRecArray [lineNum - 1]) :
fromNodeFLD->Record(lineRecArray [lineNum - 1]);
for (line = lineNum;line < lineNumFLD->Int (polyRec); ++line)
if ((nodeRec == fromNodeFLD->Record (lineRecArray [line])) ||
(nodeRec == toNodeFLD->Record (lineRecArray [line]))) break;
if (line < lineNumFLD->Int (polyRec))
{
lineRec = lineRecArray [lineNum];
lineRecArray [lineNum] = lineRecArray [line];
lineRecArray [line] = lineRec;
}
else
{
vertexNum += 1;
if (nodeRec != firstNodeRec) vertexNum += 1;
}
}
polyDir = (rightPolyFLD->Record (lineRecArray [lineNum - 1]) == polyRec);
nodeRec = polyDir ? toNodeFLD->Record (lineRecArray [lineNum - 1]) :
fromNodeFLD->Record(lineRecArray [lineNum - 1]);
polyVertexNumFLD->Int (polyRec,vertexNum + lineNum + 1 + (nodeRec != firstNodeRec ? 1 : 0));
for (lineNum = 1;lineNum < lineNumFLD->Int (polyRec);++lineNum)
{
if (rightPolyFLD->Record (lineRecArray [lineNum - 1]) == polyRec)
nextLineFLD->Record (lineRecArray [lineNum - 1],lineRecArray [lineNum]);
else prevLineFLD->Record (lineRecArray [lineNum - 1],lineRecArray [lineNum]);
}
if (rightPolyFLD->Record (lineRecArray [lineNum - 1]) == polyRec)
nextLineFLD->Record (lineRecArray [lineNum - 1],lineRecArray [0]);
else prevLineFLD->Record (lineRecArray [lineNum - 1],lineRecArray [0]);
}
free (lineRecArray);
return (DBSuccess);
}
示例2: RGISAnalysePointSTNPointsCBK
//.........这里部分代码省略.........
XmNbottomAttachment, XmATTACH_FORM,
XmNbottomOffset, 10,
XmNrowColumnType, XmMENU_OPTION,
XmNlabelString, string,
XmNsubMenuId, menu,
NULL);
XmStringFree (string);
XtAddCallback (UIDialogFormGetOkButton (dShell),XmNactivateCallback,(XtCallbackProc) UIAuxSetBooleanTrueCBK,&cont);
XtSetSensitive (UIDialogFormGetOkButton (dShell),true);
}
dataset = UIDataset ();
dbData = dataset->Data ();
table = dbData->Table (DBrNItems);
XtVaSetValues (srcTextF,XmNuserData,table->Fields (),NULL);
XtVaSetValues (dstTextF,XmNuserData,table->Fields (),NULL);
XtVaSetValues (cmpTextF,XmNuserData,table->Fields (),NULL);
XtVaSetValues (errTextF,XmNuserData,table->Fields (),NULL);
UIDialogFormPopup (dShell);
cont = false;
while (UILoop ())
{
if ((strlen (srcText = XmTextFieldGetString (srcTextF)) > 0) &&
((field = table->Field (srcText)) != (DBObjTableField *) NULL))
XtSetSensitive (UIDialogFormGetOkButton (dShell),True);
else XtSetSensitive (UIDialogFormGetOkButton (dShell),False);
XtFree (srcText);
if ((strlen (srcText = XmTextFieldGetString (cmpTextF)) > 0) &&
((field = table->Field (srcText)) != (DBObjTableField *) NULL))
{
XtSetSensitive (button,True);
XtSetSensitive (errTextF,True);
XtSetSensitive (menu,True);
}
else
{
XmTextFieldSetString (errTextF,(char *) "");
XtSetSensitive (button,False);
XtSetSensitive (errTextF,False);
XtSetSensitive (menu,False);
}
XtFree (srcText);
}
UIDialogFormPopdown (dShell);
if (cont)
{
char dataName [DBDataNameLen + 5];
DBObjData *netData = dbData->LinkedData ();
sprintf (dataName,"%s STN",dbData->Name ());
dbData = new DBObjData (*dbData);
dbData->Name (dataName);
if (UIDataHeaderForm (dbData))
{
char *dstText;
DBObjTable *groups;
DBObjRecord *pointRec;
srcText = XmTextFieldGetString (srcTextF);
dbData->LinkedData (netData);
table = dbData->Table (DBrNItems);
groups = dbData->Table (DBrNGroups);
for (pointRec = table->First ();pointRec != (DBObjRecord *) NULL;pointRec = table->Next ())
if ((pointRec->Flags () & DBObjectFlagIdle) == DBObjectFlagIdle)
{
if (groups != (DBObjTable *) NULL)
groups->Delete (groups->Item (pointRec->RowID ()));
table->Delete (pointRec);
pointRec = table->Next (DBBackward);
}
field = table->Field (srcText);
XtFree (srcText);
RGlibPointSTNCoordinates (dbData,field);
UIPauseDialogOpen ((char *) "Moving Points");
RGlibPointSTNCharacteristics (dbData);
UIPauseDialogClose ();
srcText = XmTextFieldGetString (srcTextF);
if (strlen (dstText = XmTextFieldGetString (dstTextF)) > 0)
{
srcText = XmTextFieldGetString (srcTextF);
RGlibGenFuncTopoSubtract (table,RGlibNextStation,srcText,dstText);
XtFree (dstText);
}
if (strlen (dstText = XmTextFieldGetString (errTextF)) > 0)
{
char *cmpText;
srcText = XmTextFieldGetString (srcTextF);
cmpText = XmTextFieldGetString (cmpTextF);
RGlibGenFuncFieldCompare (table,srcText,cmpText,dstText,diffMethod);
XtFree (dstText);
XtFree (cmpText);
}
XtFree (srcText);
UI2DViewRedrawAll ();
workspace->CurrentData (dbData);
}
else delete dbData;
}
}