message: cleanups in sg .obj importer
diff: @@ -37,18 +37,16 @@ int strncasecmp(const char *s1, const char *s2, size_t n)
  namespace ospray {
  namespace sg {
  - using std::string;
  - using std::cout;
  - using std::endl;
  std::shared_ptr<Texture2D> loadTexture(const std::string &path,
  const std::string &fileName,
  const bool preferLinear = false)
  {
  FileName texFileName = path + "/" + fileName;
  - std::shared_ptr<Texture2D> tex = Texture2D::load(texFileName, preferLinear);
  + std::shared_ptr<Texture2D> tex = Texture2D::load(texFileName,
  + preferLinear);
  if (!tex)
  - std::cout << "could not load texture " << texFileName << " !" << endl;
  + std::cout << "could not load texture " << texFileName << " !\n";
  return tex;
  }
  @@ -117,21 +115,17 @@ namespace ospray {
  return vec3f(x,y,z);
  }
  -
  class OBJLoader
  {
  public:
  - std::shared_ptr<Node> world;
  - std::map<std::string,std::shared_ptr<Material> > material;
  -
  - /*! Constructor. */
  OBJLoader(std::shared_ptr<Node> world, const FileName& fileName);
  - /*! Destruction */
  - ~OBJLoader();
  + private:
  +
  + std::shared_ptr<Node> world;
  + std::map<std::string, std::shared_ptr<Material>> material;
  - /*! Public methods. */
  void loadMTL(const FileName& fileName);
  template<typename T>
  @@ -153,8 +147,6 @@ namespace ospray {
  const std::shared_ptr<Material> &mat,
  bool preferLinear=false);
  - private:
  -
  FileName path;
  FileName fullPath;
  @@ -203,17 +195,14 @@ namespace ospray {
  }
  // /* generate default material */
  - // Handle<Device::RTMaterial> defaultMaterial = g_device->rtNewMaterial("matte");
  - // g_device->rtSetFloat3(defaultMaterial, "reflectance", 0.5f, 0.5f, 0.5f);
  - // g_device->rtCommit(defaultMaterial);
  - defaultMaterial = std::static_pointer_cast<Material>(createNode("material","Material"));
  + defaultMaterial =
  + std::static_pointer_cast<Material>(createNode("material","Material"));
  curMaterial = defaultMaterial;
  char line[1000000];
  memset(line, 0, sizeof(line));
  - while (cin.peek() != -1)
  - {
  + while (cin.peek() != -1) {
  /* load next multiline */
  char* pline = line;
  while (true) {
  @@ -282,11 +271,6 @@ namespace ospray {
  cin.close();
  }
  - OBJLoader::~OBJLoader()
  - {
  - }
  -
  -
  /*! try to parse given token stream as a float-type with given
  keyword; and if successful, assign to material. returns true
  if matched, false if not */
  @@ -371,7 +355,7 @@ namespace ospray {
  if (!cur) {
  std::cout << "#osp:sg:importOBJ: Ignoring line >> " << line << " <<"
  - << endl;
  + << std::endl;
  continue;
  }//throw std::runtime_error("invalid material file: newmtl expected first");
  @@ -538,7 +522,8 @@ namespace ospray {
  void importOBJ(const std::shared_ptr<Node> &world, const FileName &fileName)
  {
  - std::cout << "ospray::sg::importOBJ: importing from " << fileName << endl;
  + std::cout << "ospray::sg::importOBJ: importing from " << fileName
  + << std::endl;
  OBJLoader loader(world, fileName);
  }
  }
  