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


C++ DynamicObject::getNumAttributes方法代码示例

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


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

示例1: status

Nitf::TreState Nitf::SectgaParser::isTreValid(const DynamicObject& tre, ostream& reporter) const
{
   TreState status(VALID);
   set<string>             testSet;
   unsigned int numFields = 0;

   testSet.clear();
   status = MaxState(status, testTagValidBcsASet(tre, reporter,
      &numFields, SECTGA::SEC_ID, testSet, true, true, false));

   status = MaxState(status, testTagValidBcsASet(tre, reporter,
      &numFields, SECTGA::SEC_BE, testSet, true, true, false));

   status = MaxState(status, testTagValueRange<unsigned int>(tre, reporter,
      &numFields, SECTGA::RESERVED001, 0U, 0U));

   unsigned int totalFields = tre.getNumAttributes();
   if (status != INVALID && totalFields != numFields)
   {
      reporter << "Total fields in the Dynamic Object(" <<
         totalFields << ") did not match the number found(" << numFields << ") ";
      status = INVALID;
   }

   if (status == INVALID)
   {
      reporter << " INVALID fields found in the SECTGA TAG/SDE\n" ;
   }
   else if (status == SUSPECT)
   {
      reporter << " SUSPECT fields found in the SECTGA TAG/SDE\n" ;
   }

   return status;
}
开发者ID:Siddharthk,项目名称:opticks,代码行数:35,代码来源:NitfSectgaParser.cpp

示例2: data

QVariant DynamicObjectItemModel::data(const QModelIndex& index, int role) const
{
   if (index.isValid() == false)
   {
      return QVariant();
   }

   AttributeWrapper* pWrapper = reinterpret_cast<AttributeWrapper*>(index.internalPointer());
   if (pWrapper != NULL)
   {
      const string& attributeName = pWrapper->getName();
      DataVariant* pValue = pWrapper->getValue();

      if (role == Qt::DisplayRole)
      {
         int column = index.column();
         if (column == 0)
         {
            // Name
            return QVariant(QString::fromStdString(attributeName));
         }
         else if ((pValue != NULL) && (pValue->isValid() == true))
         {
            string attributeType = pValue->getTypeName();
            if (column == 1)
            {
               // Value
               if (attributeType == TypeConverter::toString<DynamicObject>())
               {
                  DynamicObject* pObject = dv_cast<DynamicObject>(pValue);
                  if (pObject != NULL)
                  {
                     QString valueText = QString::number(pObject->getNumAttributes()) + " children";
                     return QVariant(valueText);
                  }
               }
               else
               {
                  string attributeValue = pValue->toDisplayString();
                  return QVariant(QString::fromStdString(attributeValue));
               }
            }
            else if (column == 2)
            {
               // Type
               return QVariant(QString::fromStdString(attributeType));
            }
         }
      }
      else if (role == Qt::UserRole)
      {
         return QVariant::fromValue(pValue);
      }
   }

   return QVariant();
}
开发者ID:Siddharthk,项目名称:opticks,代码行数:57,代码来源:DynamicObjectItemModel.cpp

示例3: status

Nitf::TreState Nitf::PatchbParser::isTreValid(const DynamicObject& tre, ostream& reporter) const
{
   TreState status(VALID);
   set<string> testSet;
   unsigned int numFields = 0;

   status = MaxState(status, testTagValueRange<int>(tre, reporter, &numFields, PATCHB::PAT_NO, 1, 999));
   status = MaxState(status, testTagValueRange<int>(tre, reporter, &numFields, PATCHB::LAST_PAT_FLAG, 0, 1, true));
   status = MaxState(status, testTagValueRange<int>(tre, reporter, &numFields, PATCHB::LNSTRT, 1, 9999999));
   status = MaxState(status, testTagValueRange<int>(tre, reporter, &numFields, PATCHB::LNSTOP, 20, 9999999));
   status = MaxState(status, testTagValueRange<int>(tre, reporter, &numFields, PATCHB::AZL, 20, 99999));
   status = MaxState(status, testTagValueRange<int>(tre, reporter, &numFields, PATCHB::NVL, 20, 99999, true));
   status = MaxState(status, testTagValueRange<int>(tre, reporter, &numFields, PATCHB::FVL, 1, 681, true));
   status = MaxState(status, testTagValueRange<int>(tre, reporter, &numFields, PATCHB::NPIXEL, 170, 43000));
   status = MaxState(status, testTagValueRange<int>(tre, reporter, &numFields, PATCHB::FVPIX, 1, 43000));
   status = MaxState(status, testTagValueRange<int>(tre, reporter, &numFields, PATCHB::FRAME, 1, 512, true));
   status = MaxState(status, testTagValueRange<double>(tre, reporter, &numFields, PATCHB::UTC, 0.0, 86399.99));
   status = MaxState(status, testTagValueRange<double>(tre, reporter, &numFields, PATCHB::SHEAD, 0.0, 359.999));
   status = MaxState(status, testTagValueRange<double>(tre, reporter, &numFields,
      PATCHB::GRAVITY, 31.0, 33.9999, true));
   status = MaxState(status, testTagValueRange<int>(tre, reporter, &numFields, PATCHB::INS_V_NC, -9999, 9999));
   status = MaxState(status, testTagValueRange<int>(tre, reporter, &numFields, PATCHB::INS_V_EC, -9999, 9999));
   status = MaxState(status, testTagValueRange<int>(tre, reporter, &numFields, PATCHB::INS_V_DC, -9999, 9999));
   status = MaxState(status, testTagValueRange<double>(tre, reporter, &numFields, PATCHB::OFFLAT, -80.0, 80.0, true));
   status = MaxState(status, testTagValueRange<double>(tre, reporter, &numFields, PATCHB::OFFLONG, -80.0, 80.0, true));
   status = MaxState(status, testTagValueRange<int>(tre, reporter, &numFields, PATCHB::TRACK, 0, 359));
   status = MaxState(status, testTagValueRange<double>(tre, reporter, &numFields, PATCHB::GSWEEP, 0.0, 120.00));
   status = MaxState(status, testTagValueRange<double>(tre, reporter, &numFields, PATCHB::SHEAR, 0.85, 1.0, true));
   status = MaxState(status, testTagValueRange<int>(tre, reporter, &numFields, PATCHB::BATCH_NO, 1, 999999, true));

   unsigned int totalFields = tre.getNumAttributes();
   if (status != INVALID && totalFields != numFields)
   {
      reporter << "Total fields in the Dynamic Object(" <<
         totalFields << ") did not match the number found(" << numFields << ") ";
      status = INVALID;
   }

   if (status == INVALID)
   {
      reporter << " INVALID fields found in the PATCHB TAG/SDE\n" ;
   }
   else if (status == SUSPECT)
   {
      reporter << " SUSPECT fields found in the PATCHB TAG/SDE\n" ;
   }

   return status;
}
开发者ID:Siddharthk,项目名称:opticks,代码行数:49,代码来源:NitfPatchbParser.cpp

示例4: status

Nitf::TreState Nitf::RpcParser::isTreValid(const DynamicObject& tre, ostream& reporter) const
{
   TreState status(VALID);
   set<string>             testSet;
   unsigned int numFields = 0;
   unsigned int u;

   static const double minCoef(-9.999999E9);
   static const double maxCoef(9.999999E9);

   status = MaxState(status, testTagValueRange<bool>(tre, reporter, &numFields, SUCCESS, false, true));
   status = MaxState(status, testTagValueRange<double>(tre, reporter, &numFields, ERR_BIAS, 0.0, 9999.99));
   status = MaxState(status, testTagValueRange<double>(tre, reporter, &numFields, ERR_RAND, 0.0, 9999.99));
   status = MaxState(status, testTagValueRange<unsigned int>(tre, reporter, &numFields, LINE_OFFSET, 0U, 999999U));
   status = MaxState(status, testTagValueRange<unsigned int>(tre, reporter, &numFields, SAMP_OFFSET, 0U, 99999U));
   status = MaxState(status, testTagValueRange<double>(tre, reporter, &numFields, LAT_OFFSET, -90.0000, 90.0000));
   status = MaxState(status, testTagValueRange<double>(tre, reporter, &numFields, LONG_OFFSET, -180.0000, 180.0000));
   status = MaxState(status, testTagValueRange<int>(tre, reporter, &numFields, HEIGHT_OFFSET, -9999, 9999));
   status = MaxState(status, testTagValueRange<unsigned int>(tre, reporter, &numFields, LINE_SCALE, 1U, 999999U));
   status = MaxState(status, testTagValueRange<unsigned int>(tre, reporter, &numFields, SAMP_SCALE, 1U, 99999U));
   status = MaxState(status, testTagValueRange<double>(tre, reporter, &numFields, LAT_SCALE, -90.0000, 90.0000));
   status = MaxState(status, testTagValueRange<double>(tre, reporter, &numFields, LONG_SCALE, -180.0000, 180.0000));
   status = MaxState(status, testTagValueRange<int>(tre, reporter, &numFields, HEIGHT_SCALE, -9999, 9999));

   for (u = 1; u <= 20; ++u)
   {
      status = MaxState(status, testTagValueRange<double>(tre, reporter, &numFields,
         getRpcCoefficient(LINE_NUMERATOR_COEF_PREFIX, u), minCoef, maxCoef));
   }

   for (u = 1; u <= 20; ++u)
   {
      status = MaxState(status, testTagValueRange<double>(tre, reporter, &numFields,
         getRpcCoefficient(LINE_DENOMINATOR_COEF_PREFIX, u), minCoef, maxCoef));
   }

   for (u = 1; u <= 20; ++u)
   {
      status = MaxState(status, testTagValueRange<double>(tre, reporter, &numFields,
         getRpcCoefficient(SAMPLE_NUMERATOR_COEF_PREFIX, u), minCoef, maxCoef));
   }

   for (u = 1; u <= 20; ++u)
   {
      status = MaxState(status, testTagValueRange<double>(tre, reporter, &numFields,
         getRpcCoefficient(SAMPLE_DENOMINATOR_COEF_PREFIX, u), minCoef, maxCoef));
   }

   unsigned int totalFields = tre.getNumAttributes();
   if (status != INVALID && totalFields != numFields)
   {
      reporter << "Total fields in the Dynamic Object(" <<
         totalFields << ") did not match the number found(" << numFields << ") ";
      status = INVALID;
   }

   if (status == INVALID)
   {
      reporter << " INVALID fields found in the RPC TAG/SDE\n" ;
   }
   else if (status == SUSPECT)
   {
      reporter << " SUSPECT fields found in the RPC TAG/SDE\n" ;
   }

   return status;
}
开发者ID:Siddharthk,项目名称:opticks,代码行数:67,代码来源:NitfRpcParser.cpp

示例5: status

Nitf::TreState Nitf::BandsaParser::isTreValid(const DynamicObject& tre, ostream& reporter) const
{
   TreState status(VALID);
   set<string>             testSet;
   unsigned int numFields = 0;

   unsigned int bandcount(0);
   try
   {
      bandcount = dv_cast<unsigned int>(tre.getAttribute(BANDSA::BANDCOUNT));
      numFields++;
   }
   catch (const bad_cast&)
   {
      reporter << "Field \"" << "BANDCOUNT" << "\" missing from the Dynamic Object";
      status = INVALID;
   }
   status = MaxState(status, testTagValueRange(reporter, bandcount, 1U, 999U));
   status = MaxState(status, testTagValueRange<double>(tre, reporter,
      &numFields, BANDSA::ROW_SPACING, 0.0F, 9999.99F));

   testSet.clear();
   testSet.insert("f");
   testSet.insert("m");
   testSet.insert("r");
   status = MaxState(status, testTagValidBcsASet(tre, reporter,
      &numFields, BANDSA::ROW_SPACING_UNITS, testSet, true, true, true));

   status = MaxState(status, testTagValueRange<double>(tre, reporter,
      &numFields, BANDSA::COL_SPACING, 0.0F, 9999.99F));

   testSet.clear();
   testSet.insert("f");
   testSet.insert("m");
   testSet.insert("r");
   status = MaxState(status, testTagValidBcsASet(tre, reporter,
      &numFields, BANDSA::COL_SPACING_UNITS, testSet, true, true, true));

   status = MaxState(status, testTagValueRange<double>(tre, reporter,
      &numFields, BANDSA::FOCAL_LENGTH, 0.005F, 999.99F));

   for (unsigned int i = 0; i < bandcount; ++i)
   {
      stringstream bandStreamStr;
      bandStreamStr << "#" << i;
      string bandStr(bandStreamStr.str());

      string fieldName;

      // In the following cases add 1/2 of the next decimal place (eg +0.005 to 0.01)
      // to the test range to allow for floating point round off

      fieldName = BANDSA::BANDPEAK + bandStr;
      status = MaxState(status, testTagValueRange<double>(tre, reporter,
         &numFields, fieldName, 0.005F, 19.995F, true));

      fieldName = BANDSA::BANDLBOUND + bandStr;
      status = MaxState(status, testTagValueRange<double>(tre, reporter,
         &numFields, fieldName, 0.005F, 19.995F, true));

      fieldName = BANDSA::BANDUBOUND + bandStr;
      status = MaxState(status, testTagValueRange<double>(tre, reporter,
         &numFields, fieldName, 0.005F, 19.995F, true));

      fieldName = BANDSA::BANDWIDTH + bandStr;
      status = MaxState(status, testTagValueRange<double>(tre, reporter,
         &numFields, fieldName, 0.005F, 19.995F, true));

      fieldName = BANDSA::BANDCALDRK + bandStr;
      status = MaxState(status, testTagValueRange<double>(tre, reporter,
         &numFields, fieldName, 0.05F, 9999.95F, true));

      fieldName = BANDSA::BANDCALINC + bandStr;
      status = MaxState(status, testTagValueRange<double>(tre, reporter,
         &numFields, fieldName, 0.005F, 19.995F, true));

      fieldName = BANDSA::BANDRESP + bandStr;
      status = MaxState(status, testTagValueRange<double>(tre, reporter,
         &numFields, fieldName, 0.05F, 999.995F, true));

      fieldName = BANDSA::BANDASD + bandStr;
      status = MaxState(status, testTagValueRange<double>(tre, reporter,
         &numFields, fieldName, 0.05F, 999.995F, true));

      fieldName = BANDSA::BANDGSD + bandStr;
      status = MaxState(status, testTagValueRange<double>(tre, reporter,
         &numFields, fieldName, 0.005F, 99.995F, true));
   }

   unsigned int totalFields = tre.getNumAttributes();
   if (status != INVALID && totalFields != numFields)
   {
      reporter << "Total fields in the Dynamic Object(" <<
         totalFields << ") did not match the number found(" << numFields << ") ";
      status = INVALID;
   }

   if (status == INVALID)
   {
      reporter << " INVALID fields found in the BANDSA TAG/SDE\n" ;
//.........这里部分代码省略.........
开发者ID:Siddharthk,项目名称:opticks,代码行数:101,代码来源:NitfBandsaParser.cpp


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