~ubuntu-branches/ubuntu/lucid/meshlab/lucid

« back to all changes in this revision

Viewing changes to meshlab/src/meshlabplugins/io_expe/import_xyz.h

  • Committer: Bazaar Package Importer
  • Author(s): Teemu Ikonen
  • Date: 2009-10-08 16:40:41 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20091008164041-0c2ealqv8b8uc20c
Tags: 1.2.2-1
* New upstream version
* Do not build filter_isoparametrization because liblevmar dependency
  is not (yet) in Debian
* Fix compilation with gcc-4.4, thanks to Jonathan Liu for the patch
  (closes: #539544)
* rules: Add compiler variables to the qmake call (for testing with new
  GCC versions)
* io_3ds.pro: Make LIBS and INCLUDEPATH point to Debian version of lib3ds
* io_epoch.pro: Make LIBS point to Debian version of libbz2
* control:
  - Move Homepage URL to the source package section
  - Update to standards-version 3.8.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
149
149
 
150
150
                        loadmask = 0;
151
151
 
152
 
      loadmask |= Mask::IOM_VERTCOORD;
153
 
      loadmask |= Mask::IOM_VERTNORMAL;
 
152
      QString buf;
 
153
      QStringList line;
154
154
 
155
155
                        if (options.onlyMaskFlag)
 
156
      {
 
157
        // check the first line
 
158
        line = (buf = stream.readLine(1024)).split(QRegExp("[ |\t]"));
 
159
 
 
160
        if (line.size()==6)
 
161
        {
 
162
          loadmask |= Mask::IOM_VERTCOORD;
 
163
          loadmask |= Mask::IOM_VERTNORMAL;
 
164
        }
 
165
        else if (line.size()==3)
 
166
        {
 
167
          loadmask |= Mask::IOM_VERTCOORD;
 
168
        }
156
169
                                return 0;
 
170
      }
157
171
 
158
172
      std::vector<CoordType> pos,normals;
159
173
      CoordType p,n;
160
 
      QStringList line;
161
174
      while(!stream.atEnd())
162
175
      {
163
 
        line = stream.readLine(1024).split(" ");
 
176
        line = (buf = stream.readLine(1024)).split(QRegExp("[ |\t]"));
164
177
        if (line.size()==6)
165
178
        {
 
179
          loadmask |= Mask::IOM_VERTCOORD;
 
180
          loadmask |= Mask::IOM_VERTNORMAL;
166
181
          for (int k=0; k<3; ++k)
167
182
          {
168
183
            p[k] = line[k].toDouble();
171
186
          pos.push_back(p);
172
187
          normals.push_back(n);
173
188
        }
 
189
        else if (line.size()==3)
 
190
        {
 
191
          loadmask |= Mask::IOM_VERTCOORD;
 
192
          // there is no normal information
 
193
          for (int k=0; k<3; ++k)
 
194
          {
 
195
            p[k] = line[k].toDouble();
 
196
            n[k] = 0;
 
197
          }
 
198
          pos.push_back(p);
 
199
          normals.push_back(n);
 
200
        }
 
201
        else
 
202
        {
 
203
          std::cerr << "error: skip line " << buf.toAscii().data() << "\n";
 
204
          for (int i=0; i<line.size(); ++i)
 
205
            std::cerr << line[i].toAscii().data() << " $ ";
 
206
          std::cerr << "\n";
 
207
        }
174
208
      }
175
209
      VertexIterator v_iter = Allocator<MESH_TYPE>::AddVertices(mesh,pos.size());
176
210
      for (int i=0; i<pos.size(); ++i)