本文整理汇总了C++中DimensionDescriptor::setActiveNumber方法的典型用法代码示例。如果您正苦于以下问题:C++ DimensionDescriptor::setActiveNumber方法的具体用法?C++ DimensionDescriptor::setActiveNumber怎么用?C++ DimensionDescriptor::setActiveNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DimensionDescriptor
的用法示例。
在下文中一共展示了DimensionDescriptor::setActiveNumber方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: operator
DimensionDescriptor operator()(const DimensionDescriptor& val)
{
DimensionDescriptor temp = val;
temp.setActiveNumber(0);
temp.setActiveNumberValid(false);
return temp;
}
示例2: getPreview
QWidget* RasterElementImporterShell::getPreview(const DataDescriptor* pDescriptor, Progress* pProgress)
{
if (pDescriptor == NULL)
{
return NULL;
}
// Create a copy of the descriptor to change the loading parameters
string previewName = string("Preview: ") + pDescriptor->getName();
RasterDataDescriptor* pLoadDescriptor = dynamic_cast<RasterDataDescriptor*>(pDescriptor->copy(previewName, NULL));
if (pLoadDescriptor == NULL)
{
return NULL;
}
// Set the active row and column numbers
vector<DimensionDescriptor> newRows = pLoadDescriptor->getRows();
for (unsigned int i = 0; i < newRows.size(); ++i)
{
newRows[i].setActiveNumber(i);
}
pLoadDescriptor->setRows(newRows);
vector<DimensionDescriptor> newColumns = pLoadDescriptor->getColumns();
for (unsigned int i = 0; i < newColumns.size(); ++i)
{
newColumns[i].setActiveNumber(i);
}
pLoadDescriptor->setColumns(newColumns);
// Set the bands to load to just the first band and display it in grayscale mode
const vector<DimensionDescriptor>& bands = pLoadDescriptor->getBands();
if (bands.empty() == false)
{
DimensionDescriptor displayBand = bands.front();
displayBand.setActiveNumber(0);
vector<DimensionDescriptor> newBands;
newBands.push_back(displayBand);
pLoadDescriptor->setBands(newBands);
pLoadDescriptor->setDisplayMode(GRAYSCALE_MODE);
pLoadDescriptor->setDisplayBand(GRAY, displayBand);
}
// Set the processing location to load on-disk read-only
pLoadDescriptor->setProcessingLocation(ON_DISK_READ_ONLY);
// Do not georeference
GeoreferenceDescriptor* pLoadGeorefDescriptor = pLoadDescriptor->getGeoreferenceDescriptor();
if (pLoadGeorefDescriptor != NULL)
{
pLoadGeorefDescriptor->setGeoreferenceOnImport(false);
}
// Validate the preview
string errorMessage;
bool bValidPreview = validate(pLoadDescriptor, vector<const DataDescriptor*>(), errorMessage);
if (bValidPreview == false)
{
// Try an in-memory preview
pLoadDescriptor->setProcessingLocation(IN_MEMORY);
bValidPreview = validate(pLoadDescriptor, vector<const DataDescriptor*>(), errorMessage);
}
QWidget* pPreviewWidget = NULL;
if (bValidPreview == true)
{
// Create the model element
RasterElement* pRasterElement = static_cast<RasterElement*>(mpModel->createElement(pLoadDescriptor));
if (pRasterElement != NULL)
{
// Add the progress and raster element to an input arg list
PlugInArgList* pInArgList = NULL;
bool bSuccess = getInputSpecification(pInArgList);
if ((bSuccess == true) && (pInArgList != NULL))
{
bSuccess = pInArgList->setPlugInArgValue(Executable::ProgressArg(), pProgress);
if (bSuccess)
{
bSuccess = pInArgList->setPlugInArgValue(Importer::ImportElementArg(), pRasterElement);
}
}
// Load the data in batch mode
bool bBatch = isBatch();
setBatch();
bSuccess = execute(pInArgList, NULL);
// Restore to interactive mode if necessary
if (bBatch == false)
{
setInteractive();
}
// Create the spatial data view
if (bSuccess == true)
{
//.........这里部分代码省略.........