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

« back to all changes in this revision

Viewing changes to meshlab/src/meshlabplugins/io_collada/io_collada.cpp

  • 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:
104
104
using namespace std;
105
105
using namespace vcg;
106
106
 
107
 
bool ColladaIOPlugin::open(const QString &formatName, const QString &fileName, MeshModel &m, int& mask, const FilterParameterSet &, CallBackPos *cb, QWidget *parent)
 
107
bool ColladaIOPlugin::open(const QString &formatName, const QString &fileName, MeshModel &m, int& mask, const RichParameterSet &, CallBackPos *cb, QWidget *parent)
108
108
{
109
109
        // initializing mask
110
110
  mask = 0;
120
120
 
121
121
        if(formatName.toUpper() == tr("DAE"))
122
122
        {
123
 
                m.addinfo = NULL;
 
123
                //m.addinfo = NULL;
124
124
                tri::io::InfoDAE* info = NULL;
125
125
                if (!tri::io::ImporterDAE<CMeshO>::LoadMask(filename.c_str(), info))
126
126
                        return false;
153
153
        return true;
154
154
}
155
155
 
156
 
void ColladaIOPlugin::initPreOpenParameter(const QString &/*format*/, const QString &filename, FilterParameterSet & parlst)
 
156
void ColladaIOPlugin::initPreOpenParameter(const QString &/*format*/, const QString &filename, RichParameterSet & parlst)
157
157
{
158
158
        QTime t;
159
159
        t.start();
178
178
                idList.push_back(idVal);
179
179
                qDebug("Node %i geom id = '%s'",i,qPrintable(idVal));
180
180
        }
181
 
        parlst.addEnum("geomnode", 0, idList, tr("geometry nodes"),  tr("dsasdfads"));
 
181
        parlst.addParam(new RichEnum("geomnode",0, idList, tr("geometry nodes"),  tr("dsasdfads")));
182
182
        qDebug("Time elapsed: %d ms", t.elapsed());
183
183
}
184
184
 
185
185
 
186
186
 
187
 
bool ColladaIOPlugin::save(const QString &formatName, const QString &fileName, MeshModel &m, const int mask, const FilterParameterSet &, vcg::CallBackPos *cb, QWidget *parent)
 
187
bool ColladaIOPlugin::save(const QString &formatName, const QString &fileName, MeshModel &m, const int mask, const RichParameterSet &, vcg::CallBackPos *cb, QWidget *parent)
188
188
{
189
189
        QString errorMsgFormat = "Error encountered while exportering file %1:\n%2";
190
190
        string filename = QFile::encodeName(fileName).constData ();
191
191
  //std::string filename = fileName.toUtf8().data();
192
192
        std::string ex = formatName.toUtf8().data();
193
193
        int result;
194
 
    
 
194
  tri::Allocator<CMeshO>::CompactVertexVector(m.cm);  
 
195
  tri::Allocator<CMeshO>::CompactFaceVector(m.cm);  
195
196
        // Collada exporting function do not manage very correctly the case
196
197
    // of null texture index faces (e.g. faces that have no texture and have a default -1 tex index.
197
198
    // so we convert it to a more standard mesh adding a fake notexture.png texture.
198
199
        if(tri::HasPerWedgeTexCoord(m.cm))
199
200
                        tri::UpdateTexture<CMeshO>::WedgeTexRemoveNull(m.cm,"notexture.png");
200
 
 
 
201
        
201
202
        //if (std::find(_mp.begin(),_mp.end(),&m) == _mp.end())
202
203
                result = vcg::tri::io::ExporterDAE<CMeshO>::Save(m.cm,filename.c_str(),mask);
203
204
        //else