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


C++ Cube::create方法代码示例

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


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

示例1: CreateTestScene

void Scene::CreateTestScene()
{
    Material* lambert1 = new LambertMaterial(glm::vec3(1, 0, 0));
    Material* lambert2 = new LambertMaterial(glm::vec3(0, 1, 0));

    Cube* c = new Cube();
    c->material = lambert1;
    c->transform = Transform(glm::vec3(1,0,0), glm::vec3(40,20,45), glm::vec3(1,1,1));
    c->create();
    c->setBBox();
    this->objects.append(c);

    Sphere* s = new Sphere();
    s->material = lambert2;
    s->transform = Transform(glm::vec3(-1,0,0), glm::vec3(30,50,30), glm::vec3(1,2,1));
    s->create();
    s->setBBox();
    this->objects.append(s);

    unsigned int w = 400, h = 400;
    camera = Camera(w, h);
    camera.near_clip = 0.1f;
    camera.far_clip = 100.0f;
    camera.create();
    film = Film(w, h);
}
开发者ID:zimengyang,项目名称:Graphics_BVH,代码行数:26,代码来源:scene.cpp

示例2: ReadVimsBIL

/**
 *   We created a method to manually skip the suffix and corner
 *   data for this image to avoid implementing it in
 *   ProcessImport and ProcessImportPds. To fully support this
 *   file format, we would have to re-implement the ISIS2 Cube
 *   IO plus add prefix data features to it. This is a shortcut;
 *   because we know these files have one sideplane and four
 *   backplanes, we know how much data to skip when. This should
 *   be fixed if we ever decide to fully support suffix and
 *   corner data, which would require extensive changes to
 *   ProcessImport/ProcessImportPds. Method written by Steven
 *   Lambright.
 *
 * @param inFileName FileName of the input file
 * @param outFile FileName of the output file
 */
void ReadVimsBIL(QString inFileName, const PvlKeyword &suffixItems, QString outFile) {
  Isis::PvlGroup &dataDir = Isis::Preference::Preferences().findGroup("DataDirectory");
  QString transDir = (QString) dataDir["Base"];

  Pvl pdsLabel(inFileName);
  Isis::FileName transFile(transDir + "/" + "translations/pdsQube.trn");
  Isis::PvlTranslationManager pdsXlater(pdsLabel, transFile.expanded());


  TableField sideplaneLine("Line", Isis::TableField::Integer);
  TableField sideplaneBand("Band", Isis::TableField::Integer);
  TableField sideplaneValue("Value", Isis::TableField::Integer);

  TableRecord record;
  record += sideplaneLine;
  record += sideplaneBand;
  record += sideplaneValue;
  Table sideplaneVisTable("SideplaneVis", record);
  Table sideplaneIrTable("SideplaneIr", record);

  sideplaneVisTable.SetAssociation(Table::Lines);
  sideplaneIrTable.SetAssociation(Table::Lines);

  QString str;
  str = pdsXlater.Translate("CoreBitsPerPixel");
  int bitsPerPixel = toInt(str);
  str = pdsXlater.Translate("CorePixelType");
  PixelType pixelType = Isis::Real;

  if((str == "Real") && (bitsPerPixel == 32)) {
    pixelType = Isis::Real;
  }
  else if((str == "Integer") && (bitsPerPixel == 8)) {
    pixelType = Isis::UnsignedByte;
  }
  else if((str == "Integer") && (bitsPerPixel == 16)) {
    pixelType = Isis::SignedWord;
  }
  else if((str == "Integer") && (bitsPerPixel == 32)) {
    pixelType = Isis::SignedInteger;
  }
  else if((str == "Natural") && (bitsPerPixel == 8)) {
    pixelType = Isis::UnsignedByte;
  }
  else if((str == "Natural") && (bitsPerPixel == 16)) {
    pixelType = Isis::UnsignedWord;
  }
  else if((str == "Natural") && (bitsPerPixel == 16)) {
    pixelType = Isis::SignedWord;
  }
  else if((str == "Natural") && (bitsPerPixel == 32)) {
    pixelType = Isis::UnsignedInteger;
  }
  else {
    QString msg = "Invalid PixelType and BitsPerPixel combination [" + str +
                 ", " + toString(bitsPerPixel) + "]";
    throw IException(IException::Io, msg, _FILEINFO_);
  }

  str = pdsXlater.Translate("CoreByteOrder");
  Isis::ByteOrder byteOrder = Isis::ByteOrderEnumeration(str);

  str = pdsXlater.Translate("CoreSamples", 0);
  int ns = toInt(str);
  str = pdsXlater.Translate("CoreLines", 2);
  int nl = toInt(str);
  str = pdsXlater.Translate("CoreBands", 1);
  int nb = toInt(str);

  std::vector<double> baseList;
  std::vector<double> multList;

  str = pdsXlater.Translate("CoreBase");
  baseList.clear();
  baseList.push_back(toDouble(str));
  str = pdsXlater.Translate("CoreMultiplier");
  multList.clear();
  multList.push_back(toDouble(str));

  Cube outCube;
  outCube.setPixelType(Isis::Real);
  outCube.setDimensions(ns, nl, nb);
  outCube.create(outFile);

//.........这里部分代码省略.........
开发者ID:corburn,项目名称:ISIS,代码行数:101,代码来源:vims2isis.cpp


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