本文整理汇总了C++中FactoryResource::setWritable方法的典型用法代码示例。如果您正苦于以下问题:C++ FactoryResource::setWritable方法的具体用法?C++ FactoryResource::setWritable怎么用?C++ FactoryResource::setWritable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FactoryResource
的用法示例。
在下文中一共展示了FactoryResource::setWritable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: copyImage
bool bilinear_bayer::copyImage(RasterElement * pRaster,
RasterElement * dRaster, int i,
Progress * pProgress)
{
VERIFY(pRaster != NULL);
RasterDataDescriptor *pDesc =
dynamic_cast < RasterDataDescriptor * >(pRaster->getDataDescriptor());
VERIFY(dRaster != NULL);
RasterDataDescriptor *rDesc =
dynamic_cast < RasterDataDescriptor * >(dRaster->getDataDescriptor());
DimensionDescriptor thirdBand = pDesc->getActiveBand(i); // get active
// band
// source
FactoryResource < DataRequest > pRequest;
pRequest->setInterleaveFormat(BSQ);
pRequest->setBands(thirdBand, thirdBand);
DataAccessor thirdBandDa = pRaster->getDataAccessor(pRequest.release());
thirdBand = rDesc->getActiveBand(i);
// destination
FactoryResource < DataRequest > pResultRequest;
pResultRequest->setWritable(true);
pRequest->setInterleaveFormat(BSQ);
pResultRequest->setBands(thirdBand, thirdBand);
DataAccessor pDestAcc = dRaster->getDataAccessor(pResultRequest.release());
VERIFY(thirdBandDa.isValid());
VERIFY(pDestAcc.isValid());
for (unsigned int curRow = 0; curRow < pDesc->getRowCount(); ++curRow)
{
for (unsigned int curCol = 0; curCol < pDesc->getColumnCount();
++curCol)
{
switchOnEncoding(pDesc->getDataType(), bilinear,
pDestAcc->getColumn(), thirdBandDa, curRow,
curCol, pDesc->getRowCount(),
pDesc->getColumnCount(), i, pRaster);
pDestAcc->nextColumn();
}
pDestAcc->nextRow();
}
return true;
}
示例2: getAccessor
DataAccessor getAccessor(int band, bool writable = false) {
FactoryResource<DataRequest> pRequest = FactoryResource<DataRequest>();
pRequest->setRows(pDataDescriptor->getActiveRow(0), pDataDescriptor->getActiveRow(getRowCount() - 1));
pRequest->setColumns(pDataDescriptor->getActiveColumn(0), pDataDescriptor->getActiveColumn(getColumnCount() - 1));
pRequest->setBands(pDataDescriptor->getActiveBand(band), pDataDescriptor->getActiveBand(band));
pRequest->setWritable(writable);
return pRaster->getDataAccessor(pRequest.release());
}
示例3: generateResampledLibrary
//.........这里部分代码省略.........
unsuitableSignatures.push_back((*it)->getName());
continue;
}
resampledData.push_back(resampledValues);
resampledSignatures.push_back(*it);
}
if (resampledSignatures.empty())
{
std::string errMsg = "None of the signatures in the library cover the spectral range of the data.";
if (mpProgress != NULL)
{
mpProgress->updateProgress(errMsg, 0, ERRORS);
return false;
}
}
if (unsuitableSignatures.empty() == false)
{
std::string warningMsg = "The following library signatures do not cover the spectral range of the data:\n";
for (std::vector<std::string>::iterator it = unsuitableSignatures.begin();
it != unsuitableSignatures.end(); ++it)
{
warningMsg += *it + "\n";
}
warningMsg += "These signatures will not be searched for in the data.";
Service<DesktopServices>()->showMessageBox("SpectralLibraryManager", warningMsg);
StepResource pStep("Spectral LibraryManager", "spectral", "64B6C87A-A6C3-4378-9B6E-221D89D8707B");
pStep->finalize(Message::Unresolved, warningMsg);
}
std::string libName = "Resampled Spectral Library";
// Try to get the resampled lib element in case session was restored. If NULL, create a new raster element with
// num rows = num valid signatures, num cols = 1, num bands = pRaster num bands
RasterElement* pLib = dynamic_cast<RasterElement*>(Service<ModelServices>()->getElement(libName,
TypeConverter::toString<RasterElement>(), pRaster));
if (pLib != NULL)
{
// check that pLib has same number of sigs as SpectralLibraryManager
RasterDataDescriptor* pLibDesc = dynamic_cast<RasterDataDescriptor*>(pLib->getDataDescriptor());
VERIFY(pLibDesc != NULL);
if (pLibDesc->getRowCount() != mSignatures.size())
{
mpProgress->updateProgress("An error occurred during session restore and some signatures were not restored."
" Check the spectral library before using.", 0, ERRORS);
Service<ModelServices>()->destroyElement(pLib);
pLib = NULL;
}
}
bool isNewElement(false);
if (pLib == NULL)
{
pLib = RasterUtilities::createRasterElement(libName,
static_cast<unsigned int>(resampledData.size()), 1, pDesc->getBandCount(), FLT8BYTES, BIP,
true, const_cast<RasterElement*>(pRaster));
isNewElement = true;
}
if (pLib == NULL)
{
mpProgress->updateProgress("Error occurred while trying to create the resampled spectral library", 0, ERRORS);
return false;
}
RasterDataDescriptor* pLibDesc = dynamic_cast<RasterDataDescriptor*>(pLib->getDataDescriptor());
VERIFY(pLibDesc != NULL);
// copy resampled data into new element
if (isNewElement)
{
FactoryResource<DataRequest> pRequest;
pRequest->setWritable(true);
pRequest->setRows(pLibDesc->getActiveRow(0), pLibDesc->getActiveRow(pLibDesc->getRowCount()-1), 1);
DataAccessor acc = pLib->getDataAccessor(pRequest.release());
for (std::vector<std::vector<double> >::iterator sit = resampledData.begin(); sit != resampledData.end(); ++sit)
{
VERIFY(acc->isValid());
void* pData = acc->getColumn();
memcpy(acc->getColumn(), &(sit->begin()[0]), pLibDesc->getBandCount() * sizeof(double));
acc->nextRow();
}
// set wavelength info in resampled library
pWavelengths->applyToDynamicObject(pLib->getMetadata());
FactoryResource<Units> libUnits;
libUnits->setUnitType(mLibraryUnitType);
libUnits->setUnitName(StringUtilities::toDisplayString<UnitType>(mLibraryUnitType));
pLibDesc->setUnits(libUnits.get());
}
pLib->attach(SIGNAL_NAME(Subject, Deleted), Slot(this, &SpectralLibraryManager::resampledElementDeleted));
mLibraries[pRaster] = pLib;
mResampledSignatures[pLib] = resampledSignatures;
const_cast<RasterElement*>(pRaster)->attach(SIGNAL_NAME(Subject, Deleted),
Slot(this, &SpectralLibraryManager::elementDeleted));
return true;
}
示例4: execute
bool EdgeDetector::execute(PlugInArgList* pInArgList, PlugInArgList* pOutArgList)
{
StepResource pStep("Edge Detector", "app", "37C57772-DD49-4532-8BC6-9CFB8587D0C9");
if (pInArgList == NULL || pOutArgList == NULL)
{
return false;
}
Progress* pProgress = pInArgList->getPlugInArgValue<Progress>(Executable::ProgressArg());
RasterElement* pCube = pInArgList->getPlugInArgValue<RasterElement>(Executable::DataElementArg());
if (pCube == NULL)
{
std::string msg = "A raster cube must be specified.";
pStep->finalize(Message::Failure, msg);
if (pProgress != NULL)
{
pProgress->updateProgress(msg, 0, ERRORS);
}
return false;
}
RasterDataDescriptor* pDesc = static_cast<RasterDataDescriptor*>(pCube->getDataDescriptor());
VERIFY(pDesc != NULL);
EncodingType ResultType = INT1UBYTE;
FactoryResource<DataRequest> pRequest;
pRequest->setInterleaveFormat(BSQ);
DataAccessor pSrcAcc = pCube->getDataAccessor(pRequest.release());
ModelResource<RasterElement> pResultCube(RasterUtilities::createRasterElement(pCube->getName() +
"_Edge_Detect_Result", pDesc->getRowCount(), pDesc->getColumnCount(), ResultType));
if (pResultCube.get() == NULL)
{
std::string msg = "A raster cube could not be created.";
pStep->finalize(Message::Failure, msg);
if (pProgress != NULL)
{
pProgress->updateProgress(msg, 0, ERRORS);
}
return false;
}
FactoryResource<DataRequest> pResultRequest;
pResultRequest->setWritable(true);
DataAccessor pDestAcc = pResultCube->getDataAccessor(pResultRequest.release());
Service<DesktopServices> pDesktop;
EdgeRatioThresholdDlg dlg(pDesktop->getMainWidget(), SMALL_WINDOW_THRESHOLD, MEDIAN_WINDOW_THRESHOLD, LARGE_WINDOW_THRESHOLD);
int stat = dlg.exec();
if (stat == QDialog::Accepted)
{
for (unsigned int row = 0; row < pDesc->getRowCount(); ++row)
{
if (pProgress != NULL)
{
pProgress->updateProgress("Edge detect ", row * 100 / pDesc->getRowCount(), NORMAL);
}
if (isAborted())
{
std::string msg = getName() + " has been aborted.";
pStep->finalize(Message::Abort, msg);
if (pProgress != NULL)
{
pProgress->updateProgress(msg, 0, ABORT);
}
return false;
}
if (!pDestAcc.isValid())
{
std::string msg = "Unable to access the cube data.";
pStep->finalize(Message::Failure, msg);
if (pProgress != NULL)
{
pProgress->updateProgress(msg, 0, ERRORS);
}
return false;
}
for (unsigned int col = 0; col < pDesc->getColumnCount(); ++col)
{
switchOnEncoding(ResultType, EdgeDetectSAR, pDestAcc->getColumn(), pSrcAcc, row, col,
pDesc->getRowCount(), pDesc->getColumnCount(), pDesc->getDataType(),
dlg.getSmallThreshold(), dlg.getMedianThreshold(), dlg.getLargeThreshold());
pDestAcc->nextColumn();
}
pDestAcc->nextRow();
}
if (!isBatch())
{
//Service<DesktopServices> pDesktop;
SpatialDataWindow* pWindow = static_cast<SpatialDataWindow*>(pDesktop->createWindow(pResultCube->getName(),
SPATIAL_DATA_WINDOW));
SpatialDataView* pView = (pWindow == NULL) ? NULL : pWindow->getSpatialDataView();
if (pView == NULL)
{
std::string msg = "Unable to create view.";
pStep->finalize(Message::Failure, msg);
if (pProgress != NULL)
{
pProgress->updateProgress(msg, 0, ERRORS);
//.........这里部分代码省略.........
示例5: getReporter
void ConvolutionFilterShell::ConvolutionFilterThread::convolve(const T*)
{
int numResultsCols = mInput.mpIterCheck->getNumSelectedColumns();
if (mInput.mpResult == NULL)
{
return;
}
const RasterDataDescriptor* pResultDescriptor = static_cast<const RasterDataDescriptor*>(
mInput.mpResult->getDataDescriptor());
// account for AOIs which extend outside the dataset
int maxRowNum = static_cast<int>(mInput.mpDescriptor->getRowCount()) - 1;
mRowRange.mFirst = std::max(0, mRowRange.mFirst);
mRowRange.mLast = std::min(mRowRange.mLast, maxRowNum);
unsigned int bandCount = mInput.mBands.size();
for (unsigned int bandNum = 0; bandNum < bandCount; ++bandNum)
{
FactoryResource<DataRequest> pResultRequest;
pResultRequest->setRows(pResultDescriptor->getActiveRow(mRowRange.mFirst),
pResultDescriptor->getActiveRow(mRowRange.mLast));
pResultRequest->setColumns(pResultDescriptor->getActiveColumn(0),
pResultDescriptor->getActiveColumn(numResultsCols - 1));
pResultRequest->setBands(pResultDescriptor->getActiveBand(bandNum),
pResultDescriptor->getActiveBand(bandNum));
pResultRequest->setWritable(true);
DataAccessor resultAccessor = mInput.mpResult->getDataAccessor(pResultRequest.release());
if (!resultAccessor.isValid())
{
return;
}
int oldPercentDone = -1;
int rowOffset = static_cast<int>(mInput.mpIterCheck->getOffset().mY);
int startRow = mRowRange.mFirst + rowOffset;
int stopRow = mRowRange.mLast + rowOffset;
int columnOffset = static_cast<int>(mInput.mpIterCheck->getOffset().mX);
int startColumn = columnOffset;
int stopColumn = numResultsCols + columnOffset - 1;
int yshift = (mInput.mKernel.Nrows() - 1) / 2;
int xshift = (mInput.mKernel.Ncols() - 1) / 2;
FactoryResource<DataRequest> pRequest;
pRequest->setRows(mInput.mpDescriptor->getActiveRow(std::max(0, startRow - yshift)),
mInput.mpDescriptor->getActiveRow(std::min(maxRowNum, stopRow + mInput.mKernel.Nrows() - yshift)));
pRequest->setColumns(mInput.mpDescriptor->getActiveColumn(startColumn),
mInput.mpDescriptor->getActiveColumn(stopColumn));
pRequest->setBands(mInput.mpDescriptor->getActiveBand(mInput.mBands[bandNum]),
mInput.mpDescriptor->getActiveBand(mInput.mBands[bandNum]));
DataAccessor accessor = mInput.mpRaster->getDataAccessor(pRequest.release());
if (!accessor.isValid())
{
return;
}
Service<ModelServices> model;
ModelServices* pModel = model.get();
int numRows = stopRow - startRow + 1;
for (int row_index = startRow; row_index <= stopRow; ++row_index)
{
int percentDone = 100 * ((bandNum * numRows) + (row_index - startRow)) / (numRows * bandCount);
if (percentDone > oldPercentDone)
{
oldPercentDone = percentDone;
getReporter().reportProgress(getThreadIndex(), percentDone);
}
if (mInput.mpAbortFlag != NULL && *mInput.mpAbortFlag)
{
break;
}
for (int col_index = startColumn; col_index <= stopColumn; ++col_index)
{
double accum = 0.0;
if (mInput.mpIterCheck->getPixel(col_index, row_index))
{
for (int kernelrow = 0; kernelrow < mInput.mKernel.Nrows(); kernelrow++)
{
int neighbor_row = row_index - yshift + kernelrow;
int real_row = std::min(std::max(0, neighbor_row),
static_cast<int>(mInput.mpDescriptor->getRowCount()) - 1);
for (int kernelcol = 0; kernelcol < mInput.mKernel.Ncols(); kernelcol++)
{
int neighbor_col = col_index - xshift + kernelcol;
int real_col = std::min(std::max(0, neighbor_col),
static_cast<int>(mInput.mpDescriptor->getColumnCount()) - 1);
accessor->toPixel(real_row, real_col);
if (accessor.isValid() == false)
{
return;
}
double val = 0.0;
pModel->getDataValue<T>(reinterpret_cast<T*>(accessor->getColumn()), COMPLEX_MAGNITUDE, 0, val);
accum += mInput.mKernel(kernelrow+1, kernelcol+1) * val / mInput.mKernel.Storage();
}
}
//.........这里部分代码省略.........
示例6: execute
bool HIGHPASS::execute(PlugInArgList* pInArgList, PlugInArgList* pOutArgList)
{
StepResource pStep("Tutorial 5", "app", "219F1882-A59F-4835-BE2A-E83C0C8111EB");
if (pInArgList == NULL || pOutArgList == NULL)
{
return false;
}
Progress* pProgress = pInArgList->getPlugInArgValue<Progress>(Executable::ProgressArg());
RasterElement* pCube = pInArgList->getPlugInArgValue<RasterElement>(Executable::DataElementArg());
if (pCube == NULL)
{
std::string msg = "A raster cube must be specified.";
pStep->finalize(Message::Failure, msg);
if (pProgress != NULL)
{
pProgress->updateProgress(msg, 0, ERRORS);
}
return false;
}
RasterDataDescriptor* pDesc = static_cast<RasterDataDescriptor*>(pCube->getDataDescriptor());
VERIFY(pDesc != NULL);
FactoryResource<DataRequest> pRequest;
pRequest->setInterleaveFormat(BSQ);
DataAccessor pSrcAcc = pCube->getDataAccessor(pRequest.release());
ModelResource<RasterElement> pResultCube(RasterUtilities::createRasterElement(pCube->getName() +
"DResult", pDesc->getRowCount(), pDesc->getColumnCount(), pDesc->getDataType()));
if (pResultCube.get() == NULL)
{
std::string msg = "A raster cube could not be created.";
pStep->finalize(Message::Failure, msg);
if (pProgress != NULL)
{
pProgress->updateProgress(msg, 0, ERRORS);
}
return false;
}
FactoryResource<DataRequest> pResultRequest;
pResultRequest->setWritable(true);
DataAccessor pDestAcc = pResultCube->getDataAccessor(pResultRequest.release());
int rowSize= pDesc->getRowCount();
int colSize = pDesc->getColumnCount();
int zero=0;
int prevCol = 0;
int prevRow = 0;
int nextCol = 0;
int nextRow = 0;
int prevCol1 = 0;
int prevRow1= 0;
int nextCol1= 0;
int nextRow1= 0;
for (unsigned int row = 0; row < pDesc->getRowCount(); ++row)
{
if (pProgress != NULL)
{
pProgress->updateProgress("Calculating result", row * 100 / pDesc->getRowCount(), NORMAL);
}
if (isAborted())
{
std::string msg = getName() + " has been aborted.";
pStep->finalize(Message::Abort, msg);
if (pProgress != NULL)
{
pProgress->updateProgress(msg, 0, ABORT);
}
return false;
}
if (!pDestAcc.isValid())
{
std::string msg = "Unable to access the cube data.";
pStep->finalize(Message::Failure, msg);
if (pProgress != NULL)
{
pProgress->updateProgress(msg, 0, ERRORS);
}
return false;
}
for (unsigned int col = 0; col < pDesc->getColumnCount(); ++col)
{
double value=edgeDetection7(pSrcAcc, row, col, pDesc->getRowCount(), pDesc->getColumnCount());
switchOnEncoding(pDesc->getDataType(), conversion, pDestAcc->getColumn(), value);
pDestAcc->nextColumn();
}
pDestAcc->nextRow();
}
if (!isBatch())
{
Service<DesktopServices> pDesktop;
SpatialDataWindow* pWindow = static_cast<SpatialDataWindow*>(pDesktop->createWindow(pResultCube->getName(),
SPATIAL_DATA_WINDOW));
//.........这里部分代码省略.........
示例7: execute
bool WaveletKSigmaFilter::execute(PlugInArgList* pInArgList, PlugInArgList* pOutArgList)
{
StepResource pStep("Wavelet K-Sigma Filter", "app", "1A4BDC34-5A95-419B-8E53-C92333AFFC3E");
if (pInArgList == NULL || pOutArgList == NULL)
{
return false;
}
Progress* pProgress = pInArgList->getPlugInArgValue<Progress>(Executable::ProgressArg());
RasterElement* pCube = pInArgList->getPlugInArgValue<RasterElement>(Executable::DataElementArg());
if (pCube == NULL)
{
std::string msg = "A raster cube must be specified.";
pStep->finalize(Message::Failure, msg);
if (pProgress != NULL)
{
pProgress->updateProgress(msg, 0, ERRORS);
}
return false;
}
RasterDataDescriptor* pDesc = static_cast<RasterDataDescriptor*>(pCube->getDataDescriptor());
VERIFY(pDesc != NULL);
EncodingType ResultType = pDesc->getDataType();
if (pDesc->getDataType() == INT4SCOMPLEX)
{
ResultType = INT4SBYTES;
}
else if (pDesc->getDataType() == FLT8COMPLEX)
{
ResultType = FLT8BYTES;
}
FactoryResource<DataRequest> pRequest;
pRequest->setInterleaveFormat(BSQ);
DataAccessor pSrcAcc = pCube->getDataAccessor(pRequest.release());
ModelResource<RasterElement> pResultCube(RasterUtilities::createRasterElement(pCube->getName() +
"_Noise_Removal_Result", pDesc->getRowCount(), pDesc->getColumnCount(), ResultType));
if (pResultCube.get() == NULL)
{
std::string msg = "A raster cube could not be created.";
pStep->finalize(Message::Failure, msg);
if (pProgress != NULL)
{
pProgress->updateProgress(msg, 0, ERRORS);
}
return false;
}
FactoryResource<DataRequest> pResultRequest;
pResultRequest->setWritable(true);
DataAccessor pDestAcc = pResultCube->getDataAccessor(pResultRequest.release());
Service<DesktopServices> pDesktop;
WaveletKSigmaDlg dlg(pDesktop->getMainWidget());
int stat = dlg.exec();
if (stat != QDialog::Accepted)
{
// pProgress->updateProgress("Level 4 " + StringUtilities::toDisplayString(dlg.getLevelThreshold(3))
// + " Level5 " + StringUtilities::toDisplayString(dlg.getLevelThreshold(4)), dlg.getLevelThreshold(0), NORMAL);
return true;
}
unsigned int rowLoops;
unsigned int colLoops;
unsigned int rowIndex = 0;
unsigned int colIndex = 0;
double ScaleKValue[MAX_WAVELET_LEVELS] = {0.0};
for (int k=0; k<MAX_WAVELET_LEVELS;k++)
{
ScaleKValue[k] = dlg.getLevelThreshold(k);
}
if (0 == pDesc->getRowCount()%rowBlocks)
{
rowLoops = pDesc->getRowCount()/rowBlocks;
}
else
{
rowLoops = pDesc->getRowCount()/rowBlocks + 1;
}
if (0 == pDesc->getColumnCount()%colBlocks)
{
colLoops = pDesc->getColumnCount()/colBlocks;
}
else
{
colLoops = pDesc->getColumnCount()/colBlocks + 1;
}
for (unsigned int i = 0; i < rowLoops; i++)
{
if ( rowIndex + rowBlocks > pDesc->getRowCount())
{
rowIndex = pDesc->getRowCount() - rowBlocks;
}
colIndex = 0;
for (unsigned int j = 0; j < colLoops; j++)
//.........这里部分代码省略.........
示例8: execute
bool NefImporter::execute(PlugInArgList* pInArgList, PlugInArgList* pOutArgList)
{
if (pInArgList == NULL || pOutArgList == NULL)
{
return false;
}
//setting up mpRasterElement
parseInputArgList(pInArgList);
RasterElement* pRaster = getRasterElement();
VERIFY(pRaster != NULL);
RasterDataDescriptor *pDescriptor = dynamic_cast<RasterDataDescriptor*>(pRaster->getDataDescriptor());
VERIFY(pDescriptor != NULL);
FileDescriptor *pFileDescriptor = pDescriptor->getFileDescriptor();
VERIFY(pFileDescriptor != NULL);
//data accessor
//RED
DimensionDescriptor firstBand = pDescriptor->getActiveBand(0);
FactoryResource<DataRequest> pRequest;
pRequest->setInterleaveFormat(BSQ);
pRequest->setBands(firstBand, firstBand);
pRequest->setWritable(true);
DataAccessor firstBandDa = pRaster->getDataAccessor(pRequest.release());
//GREEN
DimensionDescriptor secondBand = pDescriptor->getActiveBand(1);
FactoryResource<DataRequest> qRequest;
qRequest->setInterleaveFormat(BSQ);
qRequest->setBands(secondBand, secondBand);
qRequest->setWritable(true);
DataAccessor secondBandDa = pRaster->getDataAccessor(qRequest.release());
//BLUE
DimensionDescriptor thirdBand = pDescriptor->getActiveBand(2);
FactoryResource<DataRequest> rRequest;
rRequest->setInterleaveFormat(BSQ);
rRequest->setBands(thirdBand, thirdBand);
rRequest->setWritable(true);
DataAccessor thirdBandDa = pRaster->getDataAccessor(rRequest.release());
std::string filename = pRaster->getFilename();
Progress *pProgress = getProgress();
FactoryResource<Filename> pFilename;
pFilename->setFullPathAndName(filename);
LibRaw RawProcessor;
putenv ((char*)"TZ=UTC");
#define P1 RawProcessor.imgdata.idata
#define S RawProcessor.imgdata.sizes
#define C RawProcessor.imgdata.color
#define T RawProcessor.imgdata.thumbnail
#define P2 RawProcessor.imgdata.other
#define OUT RawProcessor.imgdata.params
const char *fname=filename.c_str();
RawProcessor.open_file(fname);
// Let us unpack the image
if (RawProcessor.unpack() != LIBRAW_SUCCESS)
{
return false;
}
/*
unsigned int *r=NULL;
unsigned int *g=NULL;
unsigned int *b=NULL;
unsigned int *h=NULL;
*/
unsigned int *zero=0;
int row=0,col=0,r=0,c=0;
/*
r=(unsigned int*)(&RawProcessor.imgdata.image[i][0]);
g=(unsigned int*)(&RawProcessor.imgdata.image[i][1]);
b=(unsigned int*)(&RawProcessor.imgdata.image[i][2]);
h=(unsigned int*)(&RawProcessor.imgdata.image[i][3]);
*/
//secondBandDa->toPixel(row,col);
//thirdBandDa->toPixel(row,col);
unsigned short *pData=reinterpret_cast<unsigned short*>(pRaster->getRawData());
if (pData == NULL)
{
return NULL;
}
memcpy(pData, RawProcessor.imgdata.rawdata.raw_image, sizeof(unsigned short) * RawProcessor.imgdata.sizes.raw_height * RawProcessor.imgdata.sizes.raw_width);
//.........这里部分代码省略.........
示例9: processAll
bool SamAlgorithm::processAll()
{
auto_ptr<Wavelengths> pWavelengths;
ProgressTracker progress(getProgress(), "Starting SAM", "spectral", "C4320027-6359-4F5B-8820-8BC72BF1B8F0");
progress.getCurrentStep()->addProperty("Interactive", isInteractive());
RasterElement* pElement = getRasterElement();
if (pElement == NULL)
{
progress.report(SAMERR012, 0, ERRORS, true);
return false;
}
progress.getCurrentStep()->addProperty("Cube", pElement->getName());
const RasterDataDescriptor* pDescriptor = static_cast<RasterDataDescriptor*>(pElement->getDataDescriptor());
VERIFY(pDescriptor != NULL);
BitMaskIterator iter(getPixelsToProcess(), pElement);
unsigned int numRows = iter.getNumSelectedRows();
unsigned int numColumns = iter.getNumSelectedColumns();
unsigned int numBands = pDescriptor->getBandCount();
Opticks::PixelOffset layerOffset(iter.getColumnOffset(), iter.getRowOffset());
// get cube wavelengths
DynamicObject* pMetadata = pElement->getMetadata();
if (pMetadata != NULL)
{
pWavelengths.reset(new Wavelengths(pMetadata));
if (!pWavelengths->isEmpty() && (!pWavelengths->hasEndValues() || !pWavelengths->hasStartValues()))
{
pWavelengths->calculateFwhm();
}
}
VERIFY(pWavelengths.get() != NULL);
int sig_index = 0;
bool bSuccess = true;
if (mInputs.mSignatures.empty())
{
progress.report(SAMERR005, 0, ERRORS, true);
return false;
}
int iSignatureCount = mInputs.mSignatures.size();
// Get colors for all the signatures
vector<ColorType> layerColors, excludeColors;
excludeColors.push_back(ColorType(0, 0, 0));
excludeColors.push_back(ColorType(255, 255, 255));
ColorType::getUniqueColors(iSignatureCount, layerColors, excludeColors);
// Create a vector for the signature names
vector<string> sigNames;
// Create a pseudocolor results matrix if necessary
RasterElement* pPseudocolorMatrix = NULL;
RasterElement* pLowestSAMValueMatrix = NULL;
// Check for multiple Signatures and if the user has selected
// to combined multiple results in one pseudocolor output layer
if (iSignatureCount > 1 && mInputs.mbCreatePseudocolor)
{
pPseudocolorMatrix = createResults(numRows, numColumns, mInputs.mResultsName);
pLowestSAMValueMatrix = createResults(numRows, numColumns, "LowestSAMValue");
if (pPseudocolorMatrix == NULL || pLowestSAMValueMatrix == NULL )
{
progress.report(SAMERR007, 0, ERRORS, true);
return false;
}
FactoryResource<DataRequest> pseudoRequest;
pseudoRequest->setWritable(true);
string failedDataRequestErrorMessage =
SpectralUtilities::getFailedDataRequestErrorMessage(pseudoRequest.get(), pPseudocolorMatrix);
DataAccessor pseudoAccessor = pPseudocolorMatrix->getDataAccessor(pseudoRequest.release());
if (!pseudoAccessor.isValid())
{
string msg = "Unable to access results.";
if (!failedDataRequestErrorMessage.empty())
{
msg += "\n" + failedDataRequestErrorMessage;
}
progress.report(msg, 0, ERRORS, true);
return false;
}
FactoryResource<DataRequest> lsvRequest;
lsvRequest->setWritable(true);
failedDataRequestErrorMessage =
SpectralUtilities::getFailedDataRequestErrorMessage(lsvRequest.get(), pLowestSAMValueMatrix);
DataAccessor lowestSamValueAccessor = pLowestSAMValueMatrix->getDataAccessor(lsvRequest.release());
if (!lowestSamValueAccessor.isValid())
{
string msg = "Unable to access results.";
if (!failedDataRequestErrorMessage.empty())
{
msg += "\n" + failedDataRequestErrorMessage;
}
//.........这里部分代码省略.........
示例10: ComputeSam
void SamThread::ComputeSam(const T* pDummyData)
{
int reSamBan_index = 0, row_index = 0, col_index = 0;
float* pResultsData = NULL;
int oldPercentDone = -1;
double spectrumMag = 0.0;
const T* pData=NULL;
const RasterDataDescriptor* pDescriptor = static_cast<const RasterDataDescriptor*>(
mInput.mpCube->getDataDescriptor());
unsigned int numCols = pDescriptor->getColumnCount();
unsigned int numBands = pDescriptor->getBandCount();
unsigned int numRows = (mRowRange.mLast - mRowRange.mFirst + 1);
int numResultsCols = 0;
//Sets area to apply the SAM algortihm to. Either
//the entire cube, or a selected ROI.
if (mInput.mIterCheck.useAllPixels())
{
//Total number of Columns in cube.
numResultsCols = numCols;
}
else
{
numResultsCols = mInput.mIterCheck.getNumSelectedColumns();
}
if (mInput.mpResultsMatrix == NULL)
{
return;
}
const RasterDataDescriptor* pResultDescriptor = static_cast<const RasterDataDescriptor*>(
mInput.mpResultsMatrix->getDataDescriptor());
// Gets results matrix that was initialized in ProcessAll()
mRowRange.mFirst = std::max(0, mRowRange.mFirst);
mRowRange.mLast = std::min(mRowRange.mLast, static_cast<int>(pDescriptor->getRowCount()) - 1);
FactoryResource<DataRequest> pResultRequest;
pResultRequest->setRows(pResultDescriptor->getActiveRow(mRowRange.mFirst),
pResultDescriptor->getActiveRow(mRowRange.mLast));
pResultRequest->setColumns(pResultDescriptor->getActiveColumn(0),
pResultDescriptor->getActiveColumn(numResultsCols - 1));
pResultRequest->setWritable(true);
DataAccessor resultAccessor = mInput.mpResultsMatrix->getDataAccessor(pResultRequest.release());
if (!resultAccessor.isValid())
{
return;
}
// Resamples and sets search signature
for (reSamBan_index = 0; reSamBan_index < (int) mInput.mResampledBands.size(); ++reSamBan_index)
{
spectrumMag += mInput.mSpectrum[reSamBan_index] * mInput.mSpectrum[reSamBan_index];
}
spectrumMag = sqrt(spectrumMag);
int rowOffset = mInput.mIterCheck.getOffset().mY;
int startRow = (mRowRange.mFirst + rowOffset);
int stopRow = (mRowRange.mLast + rowOffset);
int columnOffset = mInput.mIterCheck.getOffset().mX;
int startColumn = columnOffset;
int stopColumn = (numResultsCols + columnOffset - 1);
FactoryResource<DataRequest> pRequest;
pRequest->setInterleaveFormat(BIP);
pRequest->setRows(pDescriptor->getActiveRow(startRow), pDescriptor->getActiveRow(stopRow));
pRequest->setColumns(pDescriptor->getActiveColumn(startColumn), pDescriptor->getActiveColumn(stopColumn));
DataAccessor accessor = mInput.mpCube->getDataAccessor(pRequest.release());
if (!accessor.isValid())
{
return;
}
for (row_index = startRow; row_index <= stopRow; ++row_index)
{
int percentDone = mRowRange.computePercent(row_index-rowOffset);
if (percentDone > oldPercentDone)
{
oldPercentDone = percentDone;
getReporter().reportProgress(getThreadIndex(), percentDone);
}
if (mInput.mpAbortFlag != NULL && *mInput.mpAbortFlag)
{
break;
}
for (col_index = startColumn; col_index <= stopColumn; ++col_index)
{
VERIFYNRV(resultAccessor.isValid());
VERIFYNRV(accessor.isValid());
// Pointer to results data
pResultsData = reinterpret_cast<float*>(resultAccessor->getColumn());
if (pResultsData == NULL)
{
return;
}
if (mInput.mIterCheck.getPixel(col_index, row_index))
{
//Pointer to cube/sensor data
pData = reinterpret_cast<T*>(accessor->getColumn());
//.........这里部分代码省略.........
示例11: execute
bool conservative_filter::execute(PlugInArgList* pInArgList, PlugInArgList* pOutArgList)
{
StepResource pStep("Conservative", "Filter", "5EA0CC75-9E0B-4c3d-BA23-6DB7157BBD55"); //what is this?
if (pInArgList == NULL || pOutArgList == NULL)
{
return false;
}
Service <DesktopServices> pDesktop;
conservative_filter_ui dialog(pDesktop->getMainWidget());
int status = dialog.exec();
if (status == QDialog::Accepted)
{
int radius = dialog.getRadiusValue();
Progress* pProgress = pInArgList->getPlugInArgValue<Progress>(Executable::ProgressArg());
RasterElement* pCube = pInArgList->getPlugInArgValue<RasterElement>(Executable::DataElementArg());
if (pCube == NULL)
{
std::string msg = "A raster cube must be specified.";
pStep->finalize(Message::Failure, msg);
if (pProgress != NULL)
{
pProgress->updateProgress(msg, 0, ERRORS);
}
return false;
}
RasterDataDescriptor* pDesc = static_cast<RasterDataDescriptor*>(pCube->getDataDescriptor());
VERIFY(pDesc != NULL);
if (pDesc->getDataType() == INT4SCOMPLEX || pDesc->getDataType() == FLT8COMPLEX)
{
std::string msg = "Conservative Filter cannot be performed on complex types.";
pStep->finalize(Message::Failure, msg);
if (pProgress != NULL)
{
pProgress->updateProgress(msg, 0, ERRORS);
}
return false;
}
FactoryResource<DataRequest> pRequest;
pRequest->setInterleaveFormat(BSQ);
DataAccessor pSrcAcc = pCube->getDataAccessor(pRequest.release());
ModelResource<RasterElement> pResultCube(RasterUtilities::createRasterElement(pCube->getName() + "_Conservative_Filter_Result", pDesc->getRowCount(), pDesc->getColumnCount(), pDesc->getDataType()));
if (pResultCube.get() == NULL)
{
std::string msg = "A raster cube could not be created.";
pStep->finalize(Message::Failure, msg);
if (pProgress != NULL)
{
pProgress->updateProgress(msg, 0, ERRORS);
}
return false;
}
FactoryResource<DataRequest> pResultRequest;
pResultRequest->setWritable(true);
DataAccessor pDestAcc = pResultCube->getDataAccessor(pResultRequest.release());
for (unsigned int row = 0; row < pDesc->getRowCount(); ++row)
{
if (pProgress != NULL)
{
pProgress->updateProgress("Applying Conservative Filter", row * 100 / pDesc->getRowCount(), NORMAL);
}
if (isAborted())
{
std::string msg = getName() + " has been aborted.";
pStep->finalize(Message::Abort, msg);
if (pProgress != NULL)
{
pProgress->updateProgress(msg, 0, ABORT);
}
return false;
}
if (!pDestAcc.isValid())
{
std::string msg = "Unable to access the cube data.";
pStep->finalize(Message::Failure, msg);
if (pProgress != NULL)
{
pProgress->updateProgress(msg, 0, ERRORS);
}
return false;
}
for (unsigned int col = 0; col < pDesc->getColumnCount(); ++col)
{
switchOnEncoding(pDesc->getDataType(), verifyRange, pDestAcc->getColumn(), pSrcAcc, row, col, pDesc->getRowCount(), pDesc->getColumnCount(), radius);
pDestAcc->nextColumn();
}
pDestAcc->nextRow();
}
if (!isBatch())
{
Service<DesktopServices> pDesktop;
SpatialDataWindow* pWindow = static_cast<SpatialDataWindow*>(pDesktop->createWindow(pResultCube->getName(),
//.........这里部分代码省略.........
示例12: execute
bool KDISTRIBUTION::execute(PlugInArgList* pInArgList, PlugInArgList* pOutArgList)
{
StepResource pStep("KDISTRIBUTION", "app10", "F298D57C-D816-42F0-AE27-43DAA02C0544");
if (pInArgList == NULL || pOutArgList == NULL)
{
return false;
}
Progress* pProgress = pInArgList->getPlugInArgValue<Progress>(Executable::ProgressArg());
RasterElement* pCube = pInArgList->getPlugInArgValue<RasterElement>(Executable::DataElementArg());
if (pCube == NULL)
{
std::string msg = "A raster cube must be specified.";
pStep->finalize(Message::Failure, msg);
if (pProgress != NULL)
{
pProgress->updateProgress(msg, 0, ERRORS);
}
return false;
}
RasterDataDescriptor* pDesc = static_cast<RasterDataDescriptor*>(pCube->getDataDescriptor());
VERIFY(pDesc != NULL);
FactoryResource<DataRequest> pRequest;
FactoryResource<DataRequest> pRequest2;
pRequest->setInterleaveFormat(BSQ);
pRequest2->setInterleaveFormat(BSQ);
DataAccessor pAcc = pCube->getDataAccessor(pRequest.release());
DataAccessor pAcc2 = pCube->getDataAccessor(pRequest2.release());
ModelResource<RasterElement> pResultCube(RasterUtilities::createRasterElement(pCube->getName() +
"Result", pDesc->getRowCount(), pDesc->getColumnCount(), pDesc->getDataType()));
if (pResultCube.get() == NULL)
{
std::string msg = "A raster cube could not be created.";
pStep->finalize(Message::Failure, msg);
if (pProgress != NULL)
{
pProgress->updateProgress(msg, 0, ERRORS);
}
return false;
}
FactoryResource<DataRequest> pResultRequest;
pResultRequest->setWritable(true);
DataAccessor pDestAcc = pResultCube->getDataAccessor(pResultRequest.release());
const RasterDataDescriptor* pDescriptor = dynamic_cast<const RasterDataDescriptor*>(pCube->getDataDescriptor());
int tester_count = 0;
int eastCol = 0;
int northRow = 0;
int westCol = 0;
int southRow = 0;
double zstatistic = 0;
double total = 0.0;
double total_sum = 0.0;
double mean = 0.0;
double std = 0.0;
double a=0;
int rowSize=pDesc->getRowCount();
int colSize=pDesc->getColumnCount();
int prevCol = 0;
int prevRow = 0;
int nextCol = 0;
int nextRow = 0;
double long PFA = 0.0;
int DEPTH1 = 10;
int DEPTH2 = 10;
int DEPTH3 = 1;
int DEPTH4 = 1;
int count=0;
int zero=0;
double long threshold = 100000.0;
double look_table1[24][6];
for(int i=0; i<24; i++)
{
for(int j=0; j<3; j++)
{
look_table1[i][j]=0.0;
}
}
QStringList Names("0.0000001");
QString value = QInputDialog::getItem(Service<DesktopServices>()->getMainWidget(),
"Input a PFA value", "Input a PFA value (0.0000001 or 0.00000001)", Names);
std::string strAoi = value.toStdString();
//.........这里部分代码省略.........
示例13: execute
bool LocalSharpening::execute(PlugInArgList* pInArgList, PlugInArgList* pOutArgList)
{
StepResource pStep("Local Sharpening", "app", "08BB9B79-5D24-4AB0-9F35-92DE77CED8E7");
if (pInArgList == NULL || pOutArgList == NULL)
{
return false;
}
Progress* pProgress = pInArgList->getPlugInArgValue<Progress>(Executable::ProgressArg());
RasterElement* pCube = pInArgList->getPlugInArgValue<RasterElement>(Executable::DataElementArg());
if (pCube == NULL)
{
std::string msg = "A raster cube must be specified.";
pStep->finalize(Message::Failure, msg);
if (pProgress != NULL)
{
pProgress->updateProgress(msg, 0, ERRORS);
}
return false;
}
RasterDataDescriptor* pDesc = static_cast<RasterDataDescriptor*>(pCube->getDataDescriptor());
VERIFY(pDesc != NULL);
EncodingType ResultType = pDesc->getDataType();
if (pDesc->getDataType() == INT4SCOMPLEX)
{
ResultType = INT4SBYTES;
}
else if (pDesc->getDataType() == FLT8COMPLEX)
{
ResultType = FLT8BYTES;
}
FactoryResource<DataRequest> pRequest;
pRequest->setInterleaveFormat(BSQ);
DataAccessor pSrcAcc = pCube->getDataAccessor(pRequest.release());
ModelResource<RasterElement> pResultCube(RasterUtilities::createRasterElement(pCube->getName() +
"_Local_Sharpening_Result", pDesc->getRowCount(), pDesc->getColumnCount(), ResultType));
if (pResultCube.get() == NULL)
{
std::string msg = "A raster cube could not be created.";
pStep->finalize(Message::Failure, msg);
if (pProgress != NULL)
{
pProgress->updateProgress(msg, 0, ERRORS);
}
return false;
}
FactoryResource<DataRequest> pResultRequest;
pResultRequest->setWritable(true);
DataAccessor pDestAcc = pResultCube->getDataAccessor(pResultRequest.release());
Service<DesktopServices> pDesktop;
LocalSharpeningDlg dlg(pDesktop->getMainWidget());
int stat = dlg.exec();
if (stat != QDialog::Accepted)
{
return true;
}
double contrastVal = dlg.getContrastValue();
int nFilterType = dlg.getCurrentFilterType();
int windowSize = dlg.getCurrentWindowSize();
windowSize = (windowSize-1)/2;
for (unsigned int row = 0; row < pDesc->getRowCount(); ++row)
{
if (pProgress != NULL)
{
pProgress->updateProgress("Local sharpening", row * 100 / pDesc->getRowCount(), NORMAL);
}
if (isAborted())
{
std::string msg = getName() + " has been aborted.";
pStep->finalize(Message::Abort, msg);
if (pProgress != NULL)
{
pProgress->updateProgress(msg, 0, ABORT);
}
return false;
}
if (!pDestAcc.isValid())
{
std::string msg = "Unable to access the cube data.";
pStep->finalize(Message::Failure, msg);
if (pProgress != NULL)
{
pProgress->updateProgress(msg, 0, ERRORS);
}
return false;
}
for (unsigned int col = 0; col < pDesc->getColumnCount(); ++col)
{
if (nFilterType == 0)
{
switchOnEncoding(ResultType, localAdaptiveSharpening, pDestAcc->getColumn(), pSrcAcc, row, col,
pDesc->getRowCount(), pDesc->getColumnCount(), pDesc->getDataType(), windowSize, contrastVal);
}
else
{
switchOnEncoding(ResultType, localExtremeSharpening, pDestAcc->getColumn(), pSrcAcc, row, col,
//.........这里部分代码省略.........
示例14: process
bool Orthorectification::process(int type, RasterElement *pDSM, GRID DSMGrid, double Geoid_Offset, int DSM_resampling)
{
StepResource pStep("Orthorectification Process", "app", "B4D426EC-E06D-11E1-83C8-42E56088709B");
pStep->addStep("Start","app", "B4D426EC-E06D-11E1-83C8-42E56088709B");
boxsize=0;
res_type = type;
if (res_type == 0)
{
boxsize=0;
}
else if (res_type == 1)
{
boxsize=1;
}
else if (res_type == 2)
{
boxsize=2;
}
else if (res_type == 3)
{
boxsize=3;
}
ProgressResource pResource("ProgressBar");
Progress *pProgress=pResource.get();
pProgress->setSettingAutoClose(false);
RasterDataDescriptor* pDesc = static_cast<RasterDataDescriptor*>(Image->getDataDescriptor());
FactoryResource<DataRequest> pRequest;
DataAccessor pSrcAcc = Image->getDataAccessor(pRequest.release());
RasterDataDescriptor* pDescDSM = static_cast<RasterDataDescriptor*>(pDSM->getDataDescriptor());
FactoryResource<DataRequest> pRequestDSM;
DataAccessor pDSMAcc = pDSM->getDataAccessor(pRequestDSM.release());
unsigned int N_Row = int(OrthoGrid.Y_Dim)+1;
unsigned int N_Col = int(OrthoGrid.X_Dim)+1;
// Check name of raster element //
Service<ModelServices> pModel;
vector<string> mCubeNames = pModel->getElementNames("RasterElement");
int NameIndex = 0, control=0;
stringstream out;
string OutputName=Image->getName();
string OutputName1 = OutputName.substr(0,OutputName.find_last_of("."));
while (control == 0)
{
control = 1;
OutputName = OutputName1+"_ortho_";
out << NameIndex;
OutputName.append(out.str()+".tiff");
for (unsigned int k=0; k<mCubeNames.size(); k++)
{
if (OutputName.compare(mCubeNames[k]) == 0) control = 0;
}
NameIndex++;
out.str("");
out.clear();
}
// Create output raster element and assoiciated descriptor and accessor //
ModelResource<RasterElement> pResultCube(RasterUtilities::createRasterElement(OutputName,N_Row ,N_Col, FLT4BYTES));
RasterDataDescriptor* pResultDesc = static_cast<RasterDataDescriptor*> (pResultCube->getDataDescriptor());
FactoryResource<DataRequest> pResultRequest;
pResultRequest->setWritable(true);
DataAccessor pDestAcc = pResultCube->getDataAccessor(pResultRequest.release());
double NodeLat, NodeLon, H_IJ=0;
//int DSM_I, DSM_J;
for (unsigned int row = 0; row < N_Row; ++row)
{
if (pProgress != NULL)
{
pProgress->updateProgress("Calculating result", row * 100 / N_Row, NORMAL);
}
if (!pDestAcc.isValid())
{
std::string msg = "Unable to access the cube data.";
pProgress->updateProgress(msg, 0, ERRORS);
pStep->finalize(Message::Failure, msg);
return false;
}
//.........这里部分代码省略.........
示例15: execute
bool BandMath::execute(PlugInArgList* pInputArgList, PlugInArgList* pOutputArgList)
{
StepResource pStep("Start BandMath", "app", "02E18066-1355-4a5f-ABC5-0366D9890C1C");
mpStep = pStep.get();
// Initilize variables
initialize();
// Get pointers
// parse arg in list
if (!parse(pInputArgList, pOutputArgList))
{
meGabbiness = ERRORS;
displayErrorMessage();
return false;
}
// Get important stuff
pStep->addProperty("Dataset", mpCube->getFilename());
const RasterDataDescriptor* pDescriptor = dynamic_cast<const RasterDataDescriptor*>(mpCube->getDataDescriptor());
if (pDescriptor != NULL)
{
mCubeRows = pDescriptor->getRowCount();
mCubeColumns = pDescriptor->getColumnCount();
mCubeBands = pDescriptor->getBandCount();
}
std::string tmpResultName;
vector<DataElement*> elements = mpDataModel->getElements("RasterElement");
vector<DataElement*>::iterator iter;
for (iter = elements.begin(); iter != elements.end(); ++iter)
{
RasterElement* pRaster = static_cast<RasterElement*>(*iter);
if (pRaster != NULL)
{
const RasterDataDescriptor* pCurrentDescriptor =
dynamic_cast<const RasterDataDescriptor*>(pRaster->getDataDescriptor());
if (pCurrentDescriptor != NULL)
{
if ((mCubeRows == static_cast<int>(pCurrentDescriptor->getRowCount())) &&
(mCubeColumns == static_cast<int>(pCurrentDescriptor->getColumnCount())) &&
(mCubeBands == static_cast<int>(pCurrentDescriptor->getBandCount())))
{
mCubesList.push_back(pRaster);
}
}
}
}
char errorVal[80];
int errorCode = -1;
if (mbInteractive)
{
QWidget* pParent = mpDesktop->getMainWidget();
FrmBM frmASIT(pDescriptor, mCubesList, pParent);
if (frmASIT.exec() == QDialog::Rejected)
{
pStep->finalize(Message::Abort);
return false;
}
mExpression = frmASIT.getExpression(true).toStdString();
mbDegrees = frmASIT.isDegrees();
mbCubeMath = frmASIT.isMultiCube();
mbAsLayerOnExistingView = frmASIT.isResultsMatrix();
}
else
{
mbCubeMath = false;
//check for cube math
unsigned int pos = mExpression.find_first_of(string("cC"));
if ((pos >= 0) && (pos < (mExpression.length() - 1)) && ((mExpression[pos + 1] > '0') &&
(mExpression[pos + 1] < '9')))
{
mbCubeMath = true;
}
}
if (!createReturnValue(mExpression))
{
mstrProgressString = "Could not allocate space for results.";
meGabbiness = ERRORS;
displayErrorMessage();
return false;
}
{
StepResource pResultStep("Compute result", "app", "CDCC12AC-32DD-4831-BC6B-225538C92053");
mpStep = pResultStep.get();
pResultStep->addProperty("Expression", mExpression);
FactoryResource<DataRequest> pReturnRequest;
pReturnRequest->setInterleaveFormat(BIP);
pReturnRequest->setWritable(true);
DataAccessor returnDa = mpResultData->getDataAccessor(pReturnRequest.release());
//.........这里部分代码省略.........