本文整理汇总了C++中QwtArray::resize方法的典型用法代码示例。如果您正苦于以下问题:C++ QwtArray::resize方法的具体用法?C++ QwtArray::resize怎么用?C++ QwtArray::resize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QwtArray
的用法示例。
在下文中一共展示了QwtArray::resize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: activePickers
static QwtArray<QwtPicker *> activePickers(QWidget *w)
{
QwtArray<QwtPicker *> pickers;
#if QT_VERSION >= 0x040000
QObjectList children = w->children();
for ( int i = 0; i < children.size(); i++ ) {
QObject *obj = children[i];
if ( obj->inherits("QwtPicker") ) {
QwtPicker *picker = (QwtPicker *)obj;
if ( picker->isEnabled() )
pickers += picker;
}
}
#else
QObjectList *children = (QObjectList *)w->children();
if ( children ) {
for ( QObjectListIterator it(*children); it.current(); ++it ) {
QObject *obj = (QObject *)it.current();
if ( obj->inherits("QwtPicker") ) {
QwtPicker *picker = (QwtPicker *)obj;
if ( picker->isEnabled() ) {
pickers.resize(pickers.size() + 1);
pickers[int(pickers.size()) - 1] = picker;
}
}
}
}
#endif
return pickers;
}
示例2: on_m_CalculateODFBtn_clicked
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void StatsGenODFWidget::on_m_CalculateODFBtn_clicked()
{
int err = 0;
QwtArray<float> e1s;
QwtArray<float> e2s;
QwtArray<float> e3s;
QwtArray<float> weights;
QwtArray<float> sigmas;
QwtArray<float> odf;
SGODFTableModel* tableModel = NULL;
if(weightSpreadGroupBox->isChecked() )
{
tableModel = m_ODFTableModel;
}
else
{
tableModel = m_OdfBulkTableModel;
}
e1s = tableModel->getData(SGODFTableModel::Euler1);
e2s = tableModel->getData(SGODFTableModel::Euler2);
e3s = tableModel->getData(SGODFTableModel::Euler3);
weights = tableModel->getData(SGODFTableModel::Weight);
sigmas = tableModel->getData(SGODFTableModel::Sigma);
// Convert from Degrees to Radians
for(int i = 0; i < e1s.size(); i++)
{
e1s[i] = e1s[i] * M_PI / 180.0;
e2s[i] = e2s[i] * M_PI / 180.0;
e3s[i] = e3s[i] * M_PI / 180.0;
}
size_t numEntries = e1s.size();
int imageSize = pfImageSize->value();
int lamberSize = pfLambertSize->value();
int numColors = 16;
int npoints = pfSamplePoints->value();
QVector<size_t> dims(1, 3);
FloatArrayType::Pointer eulers = FloatArrayType::CreateArray(npoints, dims, "Eulers");
PoleFigureConfiguration_t config;
QVector<UInt8ArrayType::Pointer> figures;
if ( Ebsd::CrystalStructure::Cubic_High == m_CrystalStructure)
{
// We now need to resize all the arrays here to make sure they are all allocated
odf.resize(CubicOps::k_OdfSize);
Texture::CalculateCubicODFData(e1s.data(), e2s.data(), e3s.data(),
weights.data(), sigmas.data(), true,
odf.data(), numEntries);
err = StatsGen::GenCubicODFPlotData(odf.data(), eulers->getPointer(0), npoints);
CubicOps ops;
config.eulers = eulers.get();
config.imageDim = imageSize;
config.lambertDim = lamberSize;
config.numColors = numColors;
figures = ops.generatePoleFigure(config);
}
else if ( Ebsd::CrystalStructure::Hexagonal_High == m_CrystalStructure)
{
// We now need to resize all the arrays here to make sure they are all allocated
odf.resize(HexagonalOps::k_OdfSize);
Texture::CalculateHexODFData(e1s.data(), e2s.data(), e3s.data(),
weights.data(), sigmas.data(), true,
odf.data(), numEntries);
err = StatsGen::GenHexODFPlotData(odf.data(), eulers->getPointer(0), npoints);
HexagonalOps ops;
config.eulers = eulers.get();
config.imageDim = imageSize;
config.lambertDim = lamberSize;
config.numColors = numColors;
figures = ops.generatePoleFigure(config);
}
else if ( Ebsd::CrystalStructure::OrthoRhombic == m_CrystalStructure)
{
// // We now need to resize all the arrays here to make sure they are all allocated
odf.resize(OrthoRhombicOps::k_OdfSize);
Texture::CalculateOrthoRhombicODFData(e1s.data(), e2s.data(), e3s.data(),
weights.data(), sigmas.data(), true,
odf.data(), numEntries);
err = StatsGen::GenOrthoRhombicODFPlotData(odf.data(), eulers->getPointer(0), npoints);
OrthoRhombicOps ops;
config.eulers = eulers.get();
config.imageDim = imageSize;
config.lambertDim = lamberSize;
//.........这里部分代码省略.........