message: XYZ sg importer cleanups
diff: @@ -106,13 +106,15 @@ namespace ospray {
  FILE *file = fopen(fileName.c_str(),"r");
  if (!file)
  throw std::runtime_error("could not open input file " + fileName);
  - int numAtoms;
  - // int rc = sscanf(line,"%i",&numAtoms);
  + int numAtoms;
  int rc = fscanf(file,"%i\n",&numAtoms);
  PRINT(numAtoms);
  - if (rc != 1)
  - throw std::runtime_error("could not parse .dat.xyz header in input file "+fileName);
  +
  + if (rc != 1) {
  + throw std::runtime_error("could not parse .dat.xyz header in "
  + "input file " + fileName);
  + }
  char line[10000];
  if (!fgets(line,10000,file))
  @@ -154,11 +156,6 @@ namespace ospray {
  a.radius = atomType[a.type]->radius;
  if (a.radius == 0.f)
  a.radius = defaultRadius;
  - if (a.radius == 0.f)
  - throw std::runtime_error("particle has invalid radius. Either "
  - "specify proper radius in the def file, or "
  - "use '--radius' cmdline parameter to set a "
  - "valid radius");
  atom[a.type].push_back(a);
  }
  }
  @@ -192,15 +189,18 @@ namespace ospray {
  void Model::loadXYZ3(const std::string &fileName)
  {
  FILE *file = fopen(fileName.c_str(),"r");
  +
  if (!file)
  throw std::runtime_error("could not open input file "+fileName);
  +
  int numAtoms;
  - // int rc = sscanf(line,"%i",&numAtoms);
  int rc = fscanf(file, "%i\n", &numAtoms);
  PRINT(numAtoms);
  - if (rc != 1)
  - throw std::runtime_error("could not parse .dat.xyz header in input file "+fileName);
  + if (rc != 1) {
  + throw std::runtime_error("could not parse .dat.xyz header in "
  + "input file "+fileName);
  + }
  char line[10000];
  if (!fgets(line,10000,file))
  @@ -241,11 +241,6 @@ namespace ospray {
  a.radius = atomType[a.type]->radius;
  if (a.radius == 0.f)
  a.radius = defaultRadius;
  - if (a.radius == 0.f)
  - throw std::runtime_error("particle has invalid radius. Either "
  - "specify proper radius in the def file, or "
  - "use '--radius' cmdline parameter to set a "
  - "valid radius");
  atom[a.type].push_back(a);
  }
  }
  