1) removed problems with gcc
2) removed stupid bug setContent 3) removed the diamond inherits in AddiotionalInfoDAE 4) removed some compiler warnings
This commit is contained in:
parent
deb5402d35
commit
609ee7db96
|
@ -32,9 +32,9 @@ private:
|
|||
// n.appendChild(el);
|
||||
//}
|
||||
|
||||
static void SaveTextureName(QDomDocument& doc,QDomNode& lbim,const std::vector<std::string>& stv)
|
||||
static void SaveTextureName(QDomDocument doc,QDomNode lbim,const std::vector<std::string>& stv)
|
||||
{
|
||||
for(int img = 0;img < stv.size();++img)
|
||||
for(unsigned int img = 0;img < stv.size();++img)
|
||||
{
|
||||
QDomElement imgnode = doc.createElement("image");
|
||||
imgnode.setAttribute("id","file"+QString::number(img));
|
||||
|
@ -47,23 +47,23 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
static void SaveTexture(QDomDocument& doc,QDomNode& n,const std::vector<std::string>& stv)
|
||||
static void SaveTexture(QDomDocument doc,QDomNode n,const std::vector<std::string>& stv)
|
||||
{
|
||||
QDomElement el = doc.createElement("library_images");
|
||||
SaveTextureName(doc,el,stv);
|
||||
n.appendChild(el);
|
||||
}
|
||||
|
||||
static void SaveTexture(QDomDocument& doc,const std::vector<std::string>& stv)
|
||||
static void SaveTexture(QDomDocument doc,const std::vector<std::string>& stv)
|
||||
{
|
||||
QDomNodeList lbim = doc.elementsByTagName("library_images");
|
||||
assert(lbim.size() == 1);
|
||||
removeChildNode(lbim.at(0));
|
||||
if (lbim.size() == 1)
|
||||
removeChildNode(lbim.at(0));
|
||||
|
||||
SaveTextureName(doc,lbim.at(0),stv);
|
||||
}
|
||||
|
||||
static void CreateVertInput(QDomDocument& doc,QDomNode& vert,const QString& attr,const QString& ref)
|
||||
static void CreateVertInput(QDomDocument doc,QDomNode vert,const QString& attr,const QString& ref)
|
||||
{
|
||||
QDomElement vinp_pos = doc.createElement("input");
|
||||
vinp_pos.setAttribute("semantic",attr);
|
||||
|
@ -71,7 +71,7 @@ private:
|
|||
vert.appendChild(vinp_pos);
|
||||
}
|
||||
|
||||
static void CreateFaceInput(QDomDocument& doc,QDomNode& tri,const QString& attr,const QString& ref,const int offset)
|
||||
static void CreateFaceInput(QDomDocument doc,QDomNode tri,const QString& attr,const QString& ref,const int offset)
|
||||
{
|
||||
QDomElement tinp_vert = doc.createElement("input");
|
||||
tinp_vert.setAttribute("offset",QString::number(offset));
|
||||
|
@ -80,7 +80,7 @@ private:
|
|||
tri.appendChild(tinp_vert);
|
||||
}
|
||||
|
||||
static void CreateSource(QDomDocument& doc,QDomNode& meshnode,const QString& attr,const QDomText& val,int nvert)
|
||||
static void CreateSource(QDomDocument doc,QDomNode meshnode,const QString& attr,const QDomText& val,int nvert)
|
||||
{
|
||||
int nel;
|
||||
std::vector<QString> coord;
|
||||
|
@ -137,7 +137,7 @@ private:
|
|||
meshnode.appendChild(srcnmnode);
|
||||
}
|
||||
|
||||
static int SaveMesh(SaveMeshType& m,QDomDocument& doc,QDomNode& meshnode,const int mask)
|
||||
static int SaveMesh(SaveMeshType& m,QDomDocument& doc,QDomNode meshnode,const int mask)
|
||||
{
|
||||
QString arrp;
|
||||
arrp.reserve(10 * 3 * m.vert.size());
|
||||
|
@ -333,7 +333,7 @@ public:
|
|||
QFile file(filename);
|
||||
if (!file.open(QIODevice::ReadWrite | QIODevice::Truncate))
|
||||
return E_CANTOPEN;
|
||||
doc.setContent(&file);
|
||||
|
||||
file.write(st.toAscii());
|
||||
file.close();
|
||||
return E_NOERROR;
|
||||
|
@ -351,7 +351,7 @@ public:
|
|||
InfoDAE* info = inf->dae;
|
||||
QDomNodeList scenelst = info->doc->elementsByTagName("scene");
|
||||
//removeChildNode(scenelst,"instance_visual_scene");
|
||||
assert(scenelst.size() == 1);
|
||||
//assert(scenelst.size() == 1);
|
||||
|
||||
if (m.textures.size() != 0)
|
||||
SaveTexture(*(info->doc),m.textures);
|
||||
|
@ -359,6 +359,7 @@ public:
|
|||
|
||||
|
||||
QDomNodeList geolib = info->doc->elementsByTagName("library_geometries");
|
||||
|
||||
assert(geolib.size() == 1);
|
||||
|
||||
if (info->doc->elementsByTagName("instance_geometry").size() != 0)
|
||||
|
@ -408,7 +409,8 @@ public:
|
|||
/*QDomElement mshnode;
|
||||
mshnode.setTagName("mesh");*/
|
||||
|
||||
removeChildNode(geolib.at(0),QString("geometry"),QString("id"),QString("vcg-mesh-lib"));
|
||||
geolib.at(0).childNodes().size();
|
||||
removeChildNode(geolib.at(0),QString("geometry"),QString("id"),QString("vcg-mesh-lib"));
|
||||
QDomElement geonode = info->doc->createElement("geometry");
|
||||
geonode.setAttribute("id","vcg-mesh-lib");
|
||||
geonode.setAttribute("name","vcg-mesh");
|
||||
|
@ -417,12 +419,13 @@ public:
|
|||
|
||||
|
||||
int res = SaveMesh(m,*(info->doc),meshnode,mask);
|
||||
if (res != 0) return res;
|
||||
geonode.appendChild(meshnode);
|
||||
geolib.at(0).appendChild(geonode);
|
||||
}
|
||||
else
|
||||
{
|
||||
removeChildNodeList(scenelst,QString("instance_visual_scene"));
|
||||
/* removeChildNodeList(scenelst,QString("instance_visual_scene")); */
|
||||
for(int vsscn = 0;vsscn < scenelst.size();++vsscn)
|
||||
{
|
||||
QString url = scenelst.at(vsscn).toElement().attribute("url");
|
||||
|
@ -432,9 +435,9 @@ public:
|
|||
vsnode.setAttribute("url","#vcg-scene-node");
|
||||
scenelst.at(0).appendChild(vsnode);
|
||||
|
||||
int vsscene_size = vsscene.size();
|
||||
|
||||
assert(vsscene.size() == 1);
|
||||
removeChildNodeList(vsscene,QString("visual_scene"),QString("id"),QString("vcg-scene-node"));
|
||||
removeChildNodeList(vsscene,QString("visual_scene"),QString("id"),QString("vcg-scene-node"));
|
||||
QDomElement vslnode = info->doc->createElement("visual_scene");
|
||||
vslnode.setAttribute("id","vcg-scene-node");
|
||||
vslnode.setAttribute("name","vcg-untitled");
|
||||
|
@ -453,7 +456,7 @@ public:
|
|||
QDomNodeList geolib = info->doc->elementsByTagName("library_geometries");
|
||||
assert(geolib.size() == 1);
|
||||
|
||||
removeChildNode(geolib.at(0),QString("geometry"),QString("id"),QString("vcg-mesh-lib"));
|
||||
removeChildNode(geolib.at(0),QString("geometry"),QString("id"),QString("vcg-mesh-lib"));
|
||||
QDomElement geonode = info->doc->createElement("geometry");
|
||||
geonode.setAttribute("id","vcg-mesh-lib");
|
||||
geonode.setAttribute("name","vcg-mesh");
|
||||
|
@ -464,13 +467,16 @@ public:
|
|||
geonode.appendChild(meshnode);
|
||||
geolib.at(0).appendChild(geonode);
|
||||
}
|
||||
|
||||
|
||||
QString st = info->doc->toString();
|
||||
QFile file(filename);
|
||||
if (!file.open(QIODevice::ReadWrite | QIODevice::Truncate))
|
||||
return E_CANTOPEN;
|
||||
info->doc->setContent(&file);
|
||||
|
||||
file.write(st.toAscii());
|
||||
file.close();
|
||||
|
||||
return E_NOERROR;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace io {
|
|||
|
||||
private:
|
||||
|
||||
static int LoadMesh(OpenMeshType& m,InfoDAE* info,const QDomNode& geo,const vcg::Matrix44f& t, CallBackPos *cb=0)
|
||||
static int LoadMesh(OpenMeshType& m,AdditionalInfoDAE* info,const QDomNode& geo,const vcg::Matrix44f& t, CallBackPos *cb=0)
|
||||
{
|
||||
if (isThereTag(geo,"mesh"))
|
||||
{
|
||||
|
@ -31,7 +31,7 @@ namespace io {
|
|||
if (vertices_size != 1)
|
||||
return E_INCOMPATIBLECOLLADA141FORMAT;
|
||||
|
||||
QDomNode srcnode = attributeSourcePerSimplex(vertices.at(0),*(info->doc),"POSITION");
|
||||
QDomNode srcnode = attributeSourcePerSimplex(vertices.at(0),*(info->dae->doc),"POSITION");
|
||||
if (srcnode.isNull())
|
||||
return E_NOVERTEXPOSITION;
|
||||
|
||||
|
@ -43,202 +43,205 @@ namespace io {
|
|||
return E_CANTOPEN;
|
||||
int nvert = geosrcposarr_size / 3;
|
||||
size_t offset = m.vert.size();
|
||||
vcg::tri::Allocator<OpenMeshType>::AddVertices(m,nvert);
|
||||
|
||||
QDomNode srcnodenorm = attributeSourcePerSimplex(vertices.at(0),*(info->doc),"NORMAL");
|
||||
QStringList geosrcvertnorm;
|
||||
if (!srcnodenorm.isNull())
|
||||
valueStringList(geosrcvertnorm,srcnodenorm,"float_array");
|
||||
|
||||
QDomNode srcnodetext = attributeSourcePerSimplex(vertices.at(0),*(info->doc),"TEXCOORD");
|
||||
QStringList geosrcverttext;
|
||||
if (!srcnodetext.isNull())
|
||||
valueStringList(geosrcverttext,srcnodetext,"float_array");
|
||||
|
||||
QDomNode srcnodecolor = attributeSourcePerSimplex(vertices.at(0),*(info->doc),"COLOR");
|
||||
QStringList geosrcvertcol;
|
||||
if (!srcnodecolor.isNull())
|
||||
valueStringList(geosrcvertcol,srcnodecolor,"float_array");
|
||||
|
||||
int ii = 0;
|
||||
for(size_t vv = offset;vv < m.vert.size();++vv)
|
||||
if (geosrcposarr_size != 0)
|
||||
{
|
||||
|
||||
assert((ii * 3 < geosrcposarr_size) && (ii * 3 + 1 < geosrcposarr_size) && (ii * 3 + 2 < geosrcposarr_size));
|
||||
vcg::Point4f tmp = t * vcg::Point4f(geosrcposarr[ii * 3].toFloat(),geosrcposarr[ii * 3 + 1].toFloat(),geosrcposarr[ii * 3 + 2].toFloat(),1.0f);
|
||||
m.vert[vv].P() = vcg::Point3f(tmp.X(),tmp.Y(),tmp.Z());
|
||||
vcg::tri::Allocator<OpenMeshType>::AddVertices(m,nvert);
|
||||
|
||||
QDomNode srcnodenorm = attributeSourcePerSimplex(vertices.at(0),*(info->dae->doc),"NORMAL");
|
||||
QStringList geosrcvertnorm;
|
||||
if (!srcnodenorm.isNull())
|
||||
{
|
||||
assert((ii * 3 < geosrcvertnorm.size()) && (ii * 3 + 1 < geosrcvertnorm.size()) && (ii * 3 + 2 < geosrcvertnorm.size()));
|
||||
vcg::Matrix44f intr44 = vcg::Inverse(t);
|
||||
vcg::Transpose(intr44);
|
||||
Matrix33f intr33;
|
||||
for(unsigned int rr = 0; rr < 2; ++rr)
|
||||
{
|
||||
for(unsigned int cc = 0;cc < 2;++cc)
|
||||
intr33[rr][cc] = intr44[rr][cc];
|
||||
}
|
||||
m.vert[vv].N() = (intr33 * vcg::Point3f(geosrcvertnorm[ii * 3].toFloat(),geosrcvertnorm[ii * 3 + 1].toFloat(),geosrcvertnorm[ii * 3 + 2].toFloat())).Normalize();
|
||||
}
|
||||
|
||||
/*if (!srcnodecolor.isNull())
|
||||
{
|
||||
assert((ii * 4 < geosrcvertcol.size()) && (ii * 4 + 1 < geosrcvertcol.size()) && (ii * 4 + 2 < geosrcvertcol.size()) && (ii * 4 + 1 < geosrcvertcol.size()));
|
||||
m.vert[vv].C() = vcg::Color4b(geosrcvertcol[ii * 4].toFloat(),geosrcvertcol[ii * 4 + 1].toFloat(),geosrcvertcol[ii * 4 + 2].toFloat(),geosrcvertcol[ii * 4 + 3].toFloat());
|
||||
}*/
|
||||
valueStringList(geosrcvertnorm,srcnodenorm,"float_array");
|
||||
|
||||
QDomNode srcnodetext = attributeSourcePerSimplex(vertices.at(0),*(info->dae->doc),"TEXCOORD");
|
||||
QStringList geosrcverttext;
|
||||
if (!srcnodetext.isNull())
|
||||
valueStringList(geosrcverttext,srcnodetext,"float_array");
|
||||
|
||||
QDomNode srcnodecolor = attributeSourcePerSimplex(vertices.at(0),*(info->dae->doc),"COLOR");
|
||||
QStringList geosrcvertcol;
|
||||
if (!srcnodecolor.isNull())
|
||||
valueStringList(geosrcvertcol,srcnodecolor,"float_array");
|
||||
|
||||
int ii = 0;
|
||||
for(size_t vv = offset;vv < m.vert.size();++vv)
|
||||
{
|
||||
assert((ii * 2 < geosrcverttext.size()) && (ii * 2 + 1 < geosrcverttext.size()));
|
||||
m.vert[vv].T() = vcg::TCoord2<float>();
|
||||
m.vert[vv].T().u() = geosrcverttext[ii * 2].toFloat();
|
||||
m.vert[vv].T().v() = geosrcverttext[ii * 2 + 1].toFloat();
|
||||
}
|
||||
++ii;
|
||||
}
|
||||
|
||||
assert((ii * 3 < geosrcposarr_size) && (ii * 3 + 1 < geosrcposarr_size) && (ii * 3 + 2 < geosrcposarr_size));
|
||||
vcg::Point4f tmp = t * vcg::Point4f(geosrcposarr[ii * 3].toFloat(),geosrcposarr[ii * 3 + 1].toFloat(),geosrcposarr[ii * 3 + 2].toFloat(),1.0f);
|
||||
m.vert[vv].P() = vcg::Point3f(tmp.X(),tmp.Y(),tmp.Z());
|
||||
|
||||
QDomNodeList tripatch = geo.toElement().elementsByTagName("triangles");
|
||||
int tripatch_size = tripatch.size();
|
||||
if (tripatch_size == 0)
|
||||
return E_NOTRIANGLES;
|
||||
if (!srcnodenorm.isNull())
|
||||
{
|
||||
assert((ii * 3 < geosrcvertnorm.size()) && (ii * 3 + 1 < geosrcvertnorm.size()) && (ii * 3 + 2 < geosrcvertnorm.size()));
|
||||
vcg::Matrix44f intr44 = vcg::Inverse(t);
|
||||
vcg::Transpose(intr44);
|
||||
Matrix33f intr33;
|
||||
for(unsigned int rr = 0; rr < 2; ++rr)
|
||||
{
|
||||
for(unsigned int cc = 0;cc < 2;++cc)
|
||||
intr33[rr][cc] = intr44[rr][cc];
|
||||
}
|
||||
m.vert[vv].N() = (intr33 * vcg::Point3f(geosrcvertnorm[ii * 3].toFloat(),geosrcvertnorm[ii * 3 + 1].toFloat(),geosrcvertnorm[ii * 3 + 2].toFloat())).Normalize();
|
||||
}
|
||||
|
||||
for(int tript = 0; tript < tripatch_size;++tript)
|
||||
{
|
||||
/*if (!srcnodecolor.isNull())
|
||||
{
|
||||
assert((ii * 4 < geosrcvertcol.size()) && (ii * 4 + 1 < geosrcvertcol.size()) && (ii * 4 + 2 < geosrcvertcol.size()) && (ii * 4 + 1 < geosrcvertcol.size()));
|
||||
m.vert[vv].C() = vcg::Color4b(geosrcvertcol[ii * 4].toFloat(),geosrcvertcol[ii * 4 + 1].toFloat(),geosrcvertcol[ii * 4 + 2].toFloat(),geosrcvertcol[ii * 4 + 3].toFloat());
|
||||
}*/
|
||||
|
||||
int nfcatt = tripatch.at(tript).toElement().elementsByTagName("input").size();
|
||||
|
||||
QStringList face;
|
||||
valueStringList(face,tripatch.at(tript),"p");
|
||||
int face_size = face.size();
|
||||
int offsetface = (int)m.face.size();
|
||||
if (face_size == 0) return E_NOMESH;
|
||||
vcg::tri::Allocator<OpenMeshType>::AddFaces(m,face_size / (nfcatt * 3));
|
||||
QDomNode wnsrc = QDomNode();
|
||||
QStringList wn;
|
||||
wnsrc = findNodeBySpecificAttributeValue(tripatch.at(tript),"input","semantic","NORMAL");
|
||||
int offnm;
|
||||
if (!wnsrc.isNull())
|
||||
{
|
||||
offnm = wnsrc.toElement().attribute("offset").toInt();
|
||||
QDomNode sn = attributeSourcePerSimplex(tripatch.at(tript),*(info->doc),"NORMAL");
|
||||
valueStringList(wn,sn,"float_array");
|
||||
if (!srcnodetext.isNull())
|
||||
{
|
||||
assert((ii * 2 < geosrcverttext.size()) && (ii * 2 + 1 < geosrcverttext.size()));
|
||||
m.vert[vv].T() = vcg::TCoord2<float>();
|
||||
m.vert[vv].T().u() = geosrcverttext[ii * 2].toFloat();
|
||||
m.vert[vv].T().v() = geosrcverttext[ii * 2 + 1].toFloat();
|
||||
}
|
||||
++ii;
|
||||
}
|
||||
|
||||
QDomNode wtsrc = QDomNode();
|
||||
QStringList wt;
|
||||
wtsrc = findNodeBySpecificAttributeValue(tripatch.at(tript),"input","semantic","TEXCOORD");
|
||||
int offtx;
|
||||
if (!wtsrc.isNull())
|
||||
QDomNodeList tripatch = geo.toElement().elementsByTagName("triangles");
|
||||
int tripatch_size = tripatch.size();
|
||||
if (tripatch_size == 0)
|
||||
return E_NOTRIANGLES;
|
||||
|
||||
for(int tript = 0; tript < tripatch_size;++tript)
|
||||
{
|
||||
offtx = wtsrc.toElement().attribute("offset").toInt();
|
||||
QDomNode st = attributeSourcePerSimplex(tripatch.at(tript),*(info->doc),"TEXCOORD");
|
||||
valueStringList(wt,st,"float_array");
|
||||
}
|
||||
|
||||
QDomNode wcsrc = QDomNode();
|
||||
QStringList wc;
|
||||
wcsrc = findNodeBySpecificAttributeValue(tripatch.at(tript),"input","semantic","COLOR");
|
||||
int offcl;
|
||||
if (!wcsrc.isNull())
|
||||
{
|
||||
offcl = wcsrc.toElement().attribute("offset").toInt();
|
||||
QDomNode sc = attributeSourcePerSimplex(tripatch.at(tript),*(info->doc),"COLOR");
|
||||
valueStringList(wc,sc,"float_array");
|
||||
}
|
||||
int nfcatt = tripatch.at(tript).toElement().elementsByTagName("input").size();
|
||||
|
||||
int jj = 0;
|
||||
//int dd = m.face.size();
|
||||
for(int ff = offsetface;ff < (int) m.face.size();++ff)
|
||||
{
|
||||
int indvt = face.at(jj).toInt();
|
||||
assert(indvt + offset < m.vert.size());
|
||||
m.face[ff].V(0) = &(m.vert[indvt + offset]);
|
||||
|
||||
int indnm;
|
||||
QStringList face;
|
||||
valueStringList(face,tripatch.at(tript),"p");
|
||||
int face_size = face.size();
|
||||
int offsetface = (int)m.face.size();
|
||||
if (face_size == 0) return E_NOMESH;
|
||||
vcg::tri::Allocator<OpenMeshType>::AddFaces(m,face_size / (nfcatt * 3));
|
||||
QDomNode wnsrc = QDomNode();
|
||||
QStringList wn;
|
||||
wnsrc = findNodeBySpecificAttributeValue(tripatch.at(tript),"input","semantic","NORMAL");
|
||||
int offnm;
|
||||
if (!wnsrc.isNull())
|
||||
{
|
||||
indnm = face.at(jj + offnm).toInt();
|
||||
assert(indnm * 3 < wn.size());
|
||||
m.face[ff].WN(0) = vcg::Point3f(wn.at(indnm * 3).toFloat(),wn.at(indnm * 3 + 1).toFloat(),wn.at(indnm * 3 + 2).toFloat());
|
||||
offnm = wnsrc.toElement().attribute("offset").toInt();
|
||||
QDomNode sn = attributeSourcePerSimplex(tripatch.at(tript),*(info->dae->doc),"NORMAL");
|
||||
valueStringList(wn,sn,"float_array");
|
||||
}
|
||||
|
||||
int indtx;
|
||||
QDomNode wtsrc = QDomNode();
|
||||
QStringList wt;
|
||||
wtsrc = findNodeBySpecificAttributeValue(tripatch.at(tript),"input","semantic","TEXCOORD");
|
||||
int offtx;
|
||||
if (!wtsrc.isNull())
|
||||
{
|
||||
indtx = face.at(jj + offtx).toInt();
|
||||
assert(indtx * 2 < wt.size());
|
||||
m.face[ff].WT(0) = vcg::TCoord2<float>();
|
||||
m.face[ff].WT(0).u() = wt.at(indtx * 2).toFloat();
|
||||
m.face[ff].WT(0).v() = wt.at(indtx * 2 + 1).toFloat();
|
||||
m.face[ff].WT(0).n() = 1;
|
||||
offtx = wtsrc.toElement().attribute("offset").toInt();
|
||||
QDomNode st = attributeSourcePerSimplex(tripatch.at(tript),*(info->dae->doc),"TEXCOORD");
|
||||
valueStringList(wt,st,"float_array");
|
||||
}
|
||||
|
||||
/*int indcl;
|
||||
QDomNode wcsrc = QDomNode();
|
||||
QStringList wc;
|
||||
wcsrc = findNodeBySpecificAttributeValue(tripatch.at(tript),"input","semantic","COLOR");
|
||||
int offcl;
|
||||
if (!wcsrc.isNull())
|
||||
{
|
||||
indcl = face.at(jj + offcl).toInt();
|
||||
assert(indcl * 4 < wc.size());
|
||||
m.face[ff].WC(0) = vcg::Color4b(wc.at(indcl * 4).toFloat(),wc.at(indcl * 4 + 1).toFloat(),wc.at(indcl * 4 + 2).toFloat(),wc.at(indcl * 4 + 3).toFloat());
|
||||
}*/
|
||||
jj += nfcatt;
|
||||
|
||||
indvt = face.at(jj).toInt();
|
||||
assert(indvt + offset < m.vert.size());
|
||||
m.face[ff].V(1) = &(m.vert[indvt + offset]);
|
||||
if (!wnsrc.isNull())
|
||||
{
|
||||
indnm = face.at(jj + offnm).toInt();
|
||||
assert(indnm * 3 < wn.size());
|
||||
m.face[ff].WN(1) = vcg::Point3f(wn.at(indnm * 3).toFloat(),wn.at(indnm * 3 + 1).toFloat(),wn.at(indnm * 3 + 2).toFloat());
|
||||
offcl = wcsrc.toElement().attribute("offset").toInt();
|
||||
QDomNode sc = attributeSourcePerSimplex(tripatch.at(tript),*(info->dae->doc),"COLOR");
|
||||
valueStringList(wc,sc,"float_array");
|
||||
}
|
||||
|
||||
if (!wtsrc.isNull())
|
||||
{
|
||||
indtx = face.at(jj + offtx).toInt();
|
||||
assert(indtx * 2 < wt.size());
|
||||
m.face[ff].WT(1) = vcg::TCoord2<float>();
|
||||
m.face[ff].WT(1).u() = wt.at(indtx * 2).toFloat();
|
||||
m.face[ff].WT(1).v() = wt.at(indtx * 2 + 1).toFloat();
|
||||
m.face[ff].WT(1).n() = 1;
|
||||
int jj = 0;
|
||||
//int dd = m.face.size();
|
||||
for(int ff = offsetface;ff < (int) m.face.size();++ff)
|
||||
{
|
||||
int indvt = face.at(jj).toInt();
|
||||
assert(indvt + offset < m.vert.size());
|
||||
m.face[ff].V(0) = &(m.vert[indvt + offset]);
|
||||
|
||||
int indnm;
|
||||
if (!wnsrc.isNull())
|
||||
{
|
||||
indnm = face.at(jj + offnm).toInt();
|
||||
assert(indnm * 3 < wn.size());
|
||||
m.face[ff].WN(0) = vcg::Point3f(wn.at(indnm * 3).toFloat(),wn.at(indnm * 3 + 1).toFloat(),wn.at(indnm * 3 + 2).toFloat());
|
||||
}
|
||||
|
||||
int indtx;
|
||||
if (!wtsrc.isNull())
|
||||
{
|
||||
indtx = face.at(jj + offtx).toInt();
|
||||
assert(indtx * 2 < wt.size());
|
||||
m.face[ff].WT(0) = vcg::TCoord2<float>();
|
||||
m.face[ff].WT(0).u() = wt.at(indtx * 2).toFloat();
|
||||
m.face[ff].WT(0).v() = wt.at(indtx * 2 + 1).toFloat();
|
||||
m.face[ff].WT(0).n() = 1;
|
||||
}
|
||||
|
||||
/*int indcl;
|
||||
if (!wcsrc.isNull())
|
||||
{
|
||||
indcl = face.at(jj + offcl).toInt();
|
||||
assert(indcl * 4 < wc.size());
|
||||
m.face[ff].WC(0) = vcg::Color4b(wc.at(indcl * 4).toFloat(),wc.at(indcl * 4 + 1).toFloat(),wc.at(indcl * 4 + 2).toFloat(),wc.at(indcl * 4 + 3).toFloat());
|
||||
}*/
|
||||
jj += nfcatt;
|
||||
|
||||
indvt = face.at(jj).toInt();
|
||||
assert(indvt + offset < m.vert.size());
|
||||
m.face[ff].V(1) = &(m.vert[indvt + offset]);
|
||||
if (!wnsrc.isNull())
|
||||
{
|
||||
indnm = face.at(jj + offnm).toInt();
|
||||
assert(indnm * 3 < wn.size());
|
||||
m.face[ff].WN(1) = vcg::Point3f(wn.at(indnm * 3).toFloat(),wn.at(indnm * 3 + 1).toFloat(),wn.at(indnm * 3 + 2).toFloat());
|
||||
}
|
||||
|
||||
if (!wtsrc.isNull())
|
||||
{
|
||||
indtx = face.at(jj + offtx).toInt();
|
||||
assert(indtx * 2 < wt.size());
|
||||
m.face[ff].WT(1) = vcg::TCoord2<float>();
|
||||
m.face[ff].WT(1).u() = wt.at(indtx * 2).toFloat();
|
||||
m.face[ff].WT(1).v() = wt.at(indtx * 2 + 1).toFloat();
|
||||
m.face[ff].WT(1).n() = 1;
|
||||
}
|
||||
|
||||
/*if (!wcsrc.isNull())
|
||||
{
|
||||
indcl = face.at(jj + offcl).toInt();
|
||||
assert(indcl * 4 < wc.size());
|
||||
m.face[ff].WC(1) = vcg::Color4b(wc.at(indcl * 4).toFloat(),wc.at(indcl * 4 + 1).toFloat(),wc.at(indcl * 4 + 2).toFloat(),wc.at(indcl * 4 + 3).toFloat());
|
||||
}*/
|
||||
jj += nfcatt;
|
||||
|
||||
indvt = face.at(jj).toInt();
|
||||
assert(indvt + offset < m.vert.size());
|
||||
m.face[ff].V(2) = &(m.vert[indvt + offset]);
|
||||
if (!wnsrc.isNull())
|
||||
{
|
||||
indnm = face.at(jj + offnm).toInt();
|
||||
assert(indnm * 3 < wn.size());
|
||||
m.face[ff].WN(2) = vcg::Point3f(wn.at(indnm * 3).toFloat(),wn.at(indnm * 3 + 1).toFloat(),wn.at(indnm * 3 + 2).toFloat());
|
||||
}
|
||||
|
||||
if (!wtsrc.isNull())
|
||||
{
|
||||
indtx = face.at(jj + offtx).toInt();
|
||||
assert(indtx * 2 < wt.size());
|
||||
m.face[ff].WT(2) = vcg::TCoord2<float>();
|
||||
m.face[ff].WT(2).u() = wt.at(indtx * 2).toFloat();
|
||||
m.face[ff].WT(2).v() = wt.at(indtx * 2 + 1).toFloat();
|
||||
m.face[ff].WT(2).n() = 1;
|
||||
}
|
||||
|
||||
/*if (!wcsrc.isNull())
|
||||
{
|
||||
indcl = face.at(jj + offcl).toInt();
|
||||
assert(indcl * 4 < wc.size());
|
||||
m.face[ff].WC(2) = vcg::Color4b(wc.at(indcl * 4).toFloat(),wc.at(indcl * 4 + 1).toFloat(),wc.at(indcl * 4 + 2).toFloat(),wc.at(indcl * 4 + 3).toFloat());
|
||||
}*/
|
||||
jj += nfcatt;
|
||||
|
||||
}
|
||||
|
||||
/*if (!wcsrc.isNull())
|
||||
{
|
||||
indcl = face.at(jj + offcl).toInt();
|
||||
assert(indcl * 4 < wc.size());
|
||||
m.face[ff].WC(1) = vcg::Color4b(wc.at(indcl * 4).toFloat(),wc.at(indcl * 4 + 1).toFloat(),wc.at(indcl * 4 + 2).toFloat(),wc.at(indcl * 4 + 3).toFloat());
|
||||
}*/
|
||||
jj += nfcatt;
|
||||
|
||||
indvt = face.at(jj).toInt();
|
||||
assert(indvt + offset < m.vert.size());
|
||||
m.face[ff].V(2) = &(m.vert[indvt + offset]);
|
||||
if (!wnsrc.isNull())
|
||||
{
|
||||
indnm = face.at(jj + offnm).toInt();
|
||||
assert(indnm * 3 < wn.size());
|
||||
m.face[ff].WN(2) = vcg::Point3f(wn.at(indnm * 3).toFloat(),wn.at(indnm * 3 + 1).toFloat(),wn.at(indnm * 3 + 2).toFloat());
|
||||
}
|
||||
|
||||
if (!wtsrc.isNull())
|
||||
{
|
||||
indtx = face.at(jj + offtx).toInt();
|
||||
assert(indtx * 2 < wt.size());
|
||||
m.face[ff].WT(2) = vcg::TCoord2<float>();
|
||||
m.face[ff].WT(2).u() = wt.at(indtx * 2).toFloat();
|
||||
m.face[ff].WT(2).v() = wt.at(indtx * 2 + 1).toFloat();
|
||||
m.face[ff].WT(2).n() = 1;
|
||||
}
|
||||
|
||||
/*if (!wcsrc.isNull())
|
||||
{
|
||||
indcl = face.at(jj + offcl).toInt();
|
||||
assert(indcl * 4 < wc.size());
|
||||
m.face[ff].WC(2) = vcg::Color4b(wc.at(indcl * 4).toFloat(),wc.at(indcl * 4 + 1).toFloat(),wc.at(indcl * 4 + 2).toFloat(),wc.at(indcl * 4 + 3).toFloat());
|
||||
}*/
|
||||
jj += nfcatt;
|
||||
|
||||
}
|
||||
}
|
||||
return E_NOERROR;
|
||||
|
@ -254,7 +257,7 @@ namespace io {
|
|||
QDomNodeList nlst = txlst.at(img).toElement().elementsByTagName("init_from");
|
||||
if (nlst.size() > 0)
|
||||
{
|
||||
inf->dae->texturefile.push_back(nlst.at(0).firstChild().nodeValue());
|
||||
inf->texturefile.push_back(nlst.at(0).firstChild().nodeValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -264,12 +267,11 @@ namespace io {
|
|||
//merge all meshes in the collada's file in the templeted mesh m
|
||||
//I assume the mesh
|
||||
|
||||
static int Open(OpenMeshType& m,const char* filename,AdditionalInfo*& addinfo, CallBackPos *cb=0)
|
||||
static int Open(OpenMeshType& m,const char* filename,AdditionalInfo*& info, CallBackPos *cb=0)
|
||||
{
|
||||
AdditionalInfoDAE* inf = new AdditionalInfoDAE();
|
||||
inf->dae = new InfoDAE();
|
||||
InfoDAE* info = inf->dae;
|
||||
|
||||
|
||||
QDomDocument* doc = new QDomDocument(filename);
|
||||
QFile file(filename);
|
||||
if (!file.open(QIODevice::ReadOnly))
|
||||
|
@ -281,10 +283,10 @@ namespace io {
|
|||
}
|
||||
file.close();
|
||||
|
||||
info->doc = doc;
|
||||
inf->dae->doc = doc;
|
||||
//GetTexture(*(info->doc),inf);
|
||||
|
||||
QDomNodeList scenes = info->doc->elementsByTagName("scene");
|
||||
QDomNodeList scenes = inf->dae->doc->elementsByTagName("scene");
|
||||
int scn_size = scenes.size();
|
||||
if (scn_size == 0)
|
||||
return E_NO3DSCENE;
|
||||
|
@ -304,8 +306,8 @@ namespace io {
|
|||
{
|
||||
QString libscn_url;
|
||||
referenceToANodeAttribute(instscenes.at(instscn),"url",libscn_url);
|
||||
QDomNode nd = QDomNode(*(info->doc));
|
||||
QDomNode visscn = findNodeBySpecificAttributeValue(*(info->doc),"visual_scene","id",libscn_url);
|
||||
QDomNode nd = QDomNode(*(inf->dae->doc));
|
||||
QDomNode visscn = findNodeBySpecificAttributeValue(*(inf->dae->doc),"visual_scene","id",libscn_url);
|
||||
if(visscn.isNull())
|
||||
return E_UNREFERENCEBLEDCOLLADAATTRIBUTE;
|
||||
|
||||
|
@ -322,9 +324,8 @@ namespace io {
|
|||
{
|
||||
|
||||
geoinst_found |= true;
|
||||
QDomNodeList geolib = info->doc->elementsByTagName("library_geometries");
|
||||
int geolib_size = geolib.size();
|
||||
assert(geolib_size == 1);
|
||||
QDomNodeList geolib = inf->dae->doc->elementsByTagName("library_geometries");
|
||||
assert(geolib.size() == 1);
|
||||
//!!!!!!!!!!!!!!!!!here will be the code for geometry transformations!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
for(int geoinst_ind = 0;geoinst_ind < geoinst_size;++geoinst_ind)
|
||||
|
@ -338,7 +339,7 @@ namespace io {
|
|||
vcg::Matrix44f tr;
|
||||
tr.SetIdentity();
|
||||
TransfMatrix(visscn,geoinst.at(geoinst_ind),tr);
|
||||
problem |= LoadMesh(m,info,geo,tr);
|
||||
problem |= LoadMesh(m,inf,geo,tr);
|
||||
if (problem) return problem;
|
||||
}
|
||||
}
|
||||
|
@ -348,9 +349,8 @@ namespace io {
|
|||
|
||||
if (!geoinst_found)
|
||||
{
|
||||
QDomNodeList geolib = info->doc->elementsByTagName("library_geometries");
|
||||
int geolib_size = geolib.size();
|
||||
assert(geolib_size == 1);
|
||||
QDomNodeList geolib = inf->dae->doc->elementsByTagName("library_geometries");
|
||||
assert(geolib.size() == 1);
|
||||
QDomNodeList geochild = geolib.at(0).childNodes();
|
||||
int geochild_size = geochild.size();
|
||||
int problem = 0;
|
||||
|
@ -358,11 +358,11 @@ namespace io {
|
|||
{
|
||||
vcg::Matrix44f tmp;
|
||||
tmp.SetIdentity();
|
||||
problem |= LoadMesh(m,info,geochild.at(chd),tmp);
|
||||
problem |= LoadMesh(m,inf,geochild.at(chd),tmp);
|
||||
if (problem) return problem;
|
||||
}
|
||||
}
|
||||
addinfo = inf;
|
||||
info = inf;
|
||||
return E_NOERROR;
|
||||
}
|
||||
|
||||
|
@ -375,9 +375,9 @@ namespace io {
|
|||
bool bHasPerVertexNormal = false;
|
||||
bool bHasPerVertexText = false;
|
||||
|
||||
AdditionalInfoDAE* inf = new AdditionalInfoDAE();
|
||||
inf->dae = new InfoDAE();
|
||||
InfoDAE* info = inf->dae;
|
||||
AdditionalInfoDAE* info = new AdditionalInfoDAE();
|
||||
info->dae = new InfoDAE();
|
||||
|
||||
|
||||
QDomDocument* doc = new QDomDocument(filename);
|
||||
QFile file(filename);
|
||||
|
@ -391,9 +391,9 @@ namespace io {
|
|||
file.close();
|
||||
|
||||
|
||||
info->doc = doc;
|
||||
GetTexture(*(info->doc),inf);
|
||||
QDomNodeList scenes = info->doc->elementsByTagName("scene");
|
||||
info->dae->doc = doc;
|
||||
GetTexture(*(info->dae->doc),info);
|
||||
QDomNodeList scenes = info->dae->doc->elementsByTagName("scene");
|
||||
int scn_size = scenes.size();
|
||||
|
||||
|
||||
|
@ -412,8 +412,8 @@ namespace io {
|
|||
{
|
||||
QString libscn_url;
|
||||
referenceToANodeAttribute(instscenes.at(instscn),"url",libscn_url);
|
||||
QDomNode nd = QDomNode(*(info->doc));
|
||||
QDomNode visscn = findNodeBySpecificAttributeValue(*(info->doc),"visual_scene","id",libscn_url);
|
||||
QDomNode nd = QDomNode(*(info->dae->doc));
|
||||
QDomNode visscn = findNodeBySpecificAttributeValue(*(info->dae->doc),"visual_scene","id",libscn_url);
|
||||
if(visscn.isNull())
|
||||
return false;
|
||||
|
||||
|
@ -422,7 +422,6 @@ namespace io {
|
|||
QDomNodeList visscn_child = visscn.childNodes();
|
||||
|
||||
//for each direct child of a libscn_url visual scene find if there is some geometry instance
|
||||
int problem = 0;
|
||||
for(int chdind = 0; chdind < visscn_child.size();++chdind)
|
||||
{
|
||||
//QDomNodeList& geoinst = visscn_child.at(chdind).toElement().elementsByTagName("instance_geometry");
|
||||
|
@ -432,9 +431,8 @@ namespace io {
|
|||
{
|
||||
|
||||
geoinst_found |= true;
|
||||
QDomNodeList geolib = info->doc->elementsByTagName("library_geometries");
|
||||
int geolib_size = geolib.size();
|
||||
assert(geolib_size == 1);
|
||||
QDomNodeList geolib = info->dae->doc->elementsByTagName("library_geometries");
|
||||
assert(geolib.size() == 1);
|
||||
//!!!!!!!!!!!!!!!!!here will be the code for geometry transformations!!!!!!!!!!!!!!!!!!!!!!
|
||||
info->numvert = 0;
|
||||
info->numface = 0;
|
||||
|
@ -490,9 +488,8 @@ namespace io {
|
|||
|
||||
if (!geoinst_found)
|
||||
{
|
||||
QDomNodeList geolib = info->doc->elementsByTagName("library_geometries");
|
||||
int geolib_size = geolib.size();
|
||||
assert(geolib_size == 1);
|
||||
QDomNodeList geolib = info->dae->doc->elementsByTagName("library_geometries");
|
||||
assert(geolib.size() == 1);
|
||||
QDomNodeList geochild = geolib.at(0).toElement().elementsByTagName("geometry");
|
||||
//!!!!!!!!!!!!!!!!!here will be the code for geometry transformations!!!!!!!!!!!!!!!!!!!!!!
|
||||
info->numvert = 0;
|
||||
|
@ -554,8 +551,9 @@ namespace io {
|
|||
|
||||
|
||||
|
||||
delete (info->doc);
|
||||
addinfo = inf;
|
||||
delete (info->dae->doc);
|
||||
info->dae->doc = NULL;
|
||||
addinfo = info;
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -19,41 +19,41 @@
|
|||
namespace vcg {
|
||||
namespace tri {
|
||||
namespace io {
|
||||
class InfoDAE : public AdditionalInfo
|
||||
class InfoDAE
|
||||
{
|
||||
public:
|
||||
|
||||
InfoDAE()
|
||||
{
|
||||
mask = 0;
|
||||
numvert = 0;
|
||||
numface = 0;
|
||||
doc = NULL;
|
||||
}
|
||||
|
||||
~InfoDAE()
|
||||
{
|
||||
delete doc;
|
||||
texturefile.clear();
|
||||
}
|
||||
|
||||
QDomDocument* doc;
|
||||
std::vector<QString> texturefile;
|
||||
};
|
||||
|
||||
class AdditionalInfoDAE : public AdditionalInfo
|
||||
{
|
||||
public:
|
||||
vcg::tri::io::InfoDAE* dae;
|
||||
std::vector<QString> texturefile;
|
||||
|
||||
AdditionalInfoDAE()
|
||||
:AdditionalInfo()
|
||||
{
|
||||
mask = 0;
|
||||
numvert = 0;
|
||||
numface = 0;
|
||||
}
|
||||
|
||||
~AdditionalInfoDAE()
|
||||
{
|
||||
delete dae;
|
||||
texturefile.clear();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -94,7 +94,7 @@ namespace io {
|
|||
else return dae_error_msg[error];
|
||||
};
|
||||
protected:
|
||||
inline static void referenceToANodeAttribute(const QDomNode& n,const QString& attr,QString& url_st)
|
||||
inline static void referenceToANodeAttribute(const QDomNode n,const QString& attr,QString& url_st)
|
||||
{
|
||||
url_st = n.toElement().attribute(attr);
|
||||
int sz = url_st.size() - 1;
|
||||
|
@ -116,12 +116,12 @@ namespace io {
|
|||
return QDomNode();
|
||||
}
|
||||
|
||||
inline static QDomNode findNodeBySpecificAttributeValue(const QDomNode& n,const QString& tag,const QString& attrname,const QString& attrvalue)
|
||||
inline static QDomNode findNodeBySpecificAttributeValue(const QDomNode n,const QString& tag,const QString& attrname,const QString& attrvalue)
|
||||
{
|
||||
return findNodeBySpecificAttributeValue(n.toElement().elementsByTagName(tag),attrname,attrvalue);
|
||||
}
|
||||
|
||||
inline static QDomNode findNodeBySpecificAttributeValue(const QDomDocument& n,const QString& tag,const QString& attrname,const QString& attrvalue)
|
||||
inline static QDomNode findNodeBySpecificAttributeValue(const QDomDocument n,const QString& tag,const QString& attrname,const QString& attrvalue)
|
||||
{
|
||||
return findNodeBySpecificAttributeValue(n.elementsByTagName(tag),attrname,attrvalue);
|
||||
}
|
||||
|
@ -131,18 +131,18 @@ namespace io {
|
|||
return ((list.size() > 0) ? true : false);
|
||||
}
|
||||
|
||||
inline static bool isThereTag(const QDomNode& n,const QString& tagname)
|
||||
inline static bool isThereTag(const QDomNode n,const QString& tagname)
|
||||
{
|
||||
return isThereTag(n.toElement().elementsByTagName(tagname));
|
||||
}
|
||||
|
||||
inline static bool isThereTag(const QDomDocument& n,const QString& tagname)
|
||||
inline static bool isThereTag(const QDomDocument n,const QString& tagname)
|
||||
{
|
||||
return isThereTag(n.elementsByTagName(tagname));
|
||||
}
|
||||
|
||||
|
||||
inline static QDomNode attributeSourcePerSimplex(const QDomNode& n,const QDomDocument& startpoint,const QString& sem)
|
||||
inline static QDomNode attributeSourcePerSimplex(const QDomNode n,const QDomDocument startpoint,const QString& sem)
|
||||
{
|
||||
QDomNodeList vertattr = n.toElement().elementsByTagName("input");
|
||||
for(int ind = 0;ind < vertattr.size();++ind)
|
||||
|
@ -157,11 +157,10 @@ namespace io {
|
|||
return QDomNode();
|
||||
}
|
||||
|
||||
inline static void valueStringList(QStringList& res,const QDomNode& srcnode,const QString& tag)
|
||||
inline static void valueStringList(QStringList& res,const QDomNode srcnode,const QString& tag)
|
||||
{
|
||||
QDomNodeList list = srcnode.toElement().elementsByTagName(tag);
|
||||
int list_size = list.size();
|
||||
assert(list_size == 1);
|
||||
assert(list.size() == 1);
|
||||
QString nd = list.at(0).firstChild().nodeValue();
|
||||
res = nd.split(" ");
|
||||
if (res.last() == "")
|
||||
|
@ -175,13 +174,13 @@ namespace io {
|
|||
{
|
||||
for(int jj = 0;jj < nodelst.size();++jj)
|
||||
{
|
||||
removeChildNode(nodelst.at(jj),tag,attribname,attribvalue);
|
||||
removeChildNode(nodelst.at(jj),tag,attribname,attribvalue);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
inline static bool removeChildNode(QDomNode& node,const QString& tag = "", const QString& attribname = "", const QString& attribvalue = "")
|
||||
inline static bool removeChildNode(QDomNode node,const QString& tag = "", const QString& attribname = "", const QString& attribvalue = "")
|
||||
{
|
||||
QDomNodeList clst = node.childNodes();
|
||||
for(int ii = 0;ii < clst.size();++ii)
|
||||
|
@ -208,55 +207,6 @@ namespace io {
|
|||
return true;
|
||||
}
|
||||
|
||||
//inline static bool removeChildNode(QDomDocument& node,const QString& tag = "", const QString& attribname = "", const QString& attribvalue = "")
|
||||
////inline static bool removeChildNode(QDomNode node,const QString& tag = "", const QString& attribname = "", const QString& attribvalue = "")
|
||||
//{
|
||||
// QDomNodeList clst = node.childNodes();
|
||||
// for(int ii = 0;ii < clst.size();++ii)
|
||||
// {
|
||||
// QDomNode oldchild = node.childNodes().at(ii);
|
||||
// if (tag != "")
|
||||
// {
|
||||
// if ((attribname != "") && (attribvalue != ""))
|
||||
// {
|
||||
// if (clst.at(ii).toElement().attribute(attribname) == attribvalue)
|
||||
// node.removeChild(oldchild);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// QString nm = clst.at(ii).nodeName();
|
||||
// if (clst.at(ii).nodeName() == tag)
|
||||
// {
|
||||
// node.removeChild(oldchild);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// else node.removeChild(oldchild);
|
||||
// }
|
||||
// return true;
|
||||
//}
|
||||
|
||||
/*inline static bool removeChildNode(QDomDocument node,const QString& tag = "", const QString& attribname = "", const QString& attribvalue = "")
|
||||
{
|
||||
QDomNodeList clst = node.childNodes();
|
||||
for(int ii = 0;ii < clst.size();++ii)
|
||||
{
|
||||
QDomNode oldchild = node.childNodes().at(ii);
|
||||
if (tag != "")
|
||||
{
|
||||
if ((attribname != "") && (attribvalue != ""))
|
||||
{
|
||||
if (clst.at(ii).toElement().attribute(attribname) == attribvalue)
|
||||
node.removeChild(oldchild);
|
||||
}
|
||||
else if (clst.at(ii).nodeName() == tag)
|
||||
node.removeChild(oldchild);
|
||||
}
|
||||
else node.removeChild(oldchild);
|
||||
}
|
||||
return true;
|
||||
}*/
|
||||
|
||||
static void ParseRotationMatrix(vcg::Matrix44f& m,const std::vector<QDomNode>& t)
|
||||
{
|
||||
vcg::Matrix44f tmp;
|
||||
|
@ -273,7 +223,7 @@ namespace io {
|
|||
m = m * tmp;
|
||||
}
|
||||
|
||||
static void AddTranslation(vcg::Matrix44f& m,const QDomNode& t)
|
||||
static void AddTranslation(vcg::Matrix44f& m,const QDomNode t)
|
||||
{
|
||||
QDomNode tr = t.firstChild();
|
||||
QString coord = tr.nodeValue();
|
||||
|
@ -290,7 +240,7 @@ namespace io {
|
|||
m[2][3] = coordlist.at(2).toFloat();
|
||||
}
|
||||
|
||||
static void TransfMatrix(const QDomNode& parentnode,const QDomNode& presentnode,vcg::Matrix44f& m)
|
||||
static void TransfMatrix(const QDomNode parentnode,const QDomNode presentnode,vcg::Matrix44f& m)
|
||||
{
|
||||
if (presentnode == parentnode) return;
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue