Commit 751b9077 authored by Lionel Untereiner's avatar Lionel Untereiner

import mesh for mixed hex/tet meshes

parent 08553e53
...@@ -177,8 +177,8 @@ void MyQT::cb_Open() ...@@ -177,8 +177,8 @@ void MyQT::cb_Open()
// if (v>maxV) // if (v>maxV)
// maxV=v; // maxV=v;
if(myMap.isVolumeIncidentToBoundary(d)) //if(myMap.isVolumeIncidentToBoundary(d))
color[d] = PFP::VEC3(0,0,0); // color[d] = PFP::VEC3(0,0,0);
} }
// for (unsigned int i = color.begin(); i != color.end(); color.next(i)) // for (unsigned int i = color.begin(); i != color.end(); color.next(i))
// { // {
...@@ -422,8 +422,8 @@ int main(int argc, char **argv) ...@@ -422,8 +422,8 @@ int main(int argc, char **argv)
// if (v>maxV) // if (v>maxV)
// maxV=v; // maxV=v;
if(myMap.isVolumeIncidentToBoundary(d)) if(myMap.isVolumeIncidentToBoundary(d))
color[d] = PFP::VEC3(0,0,0); color[d] = PFP::VEC3(1,0.41,0.706);
//else //else
// color[d] = PFP::VEC3(1.0,0,0); // color[d] = PFP::VEC3(1.0,0,0);
} }
......
This diff is collapsed.
...@@ -190,6 +190,8 @@ bool MeshTablesVolume<PFP>::importTet(const std::string& filename, std::vector<s ...@@ -190,6 +190,8 @@ bool MeshTablesVolume<PFP>::importTet(const std::string& filename, std::vector<s
m_nbFaces.reserve(m_nbVolumes*4); m_nbFaces.reserve(m_nbVolumes*4);
m_emb.reserve(m_nbVolumes*12); m_emb.reserve(m_nbVolumes*12);
unsigned int nbc = 0;
for (unsigned int i = 0; i < m_nbVolumes ; ++i) for (unsigned int i = 0; i < m_nbVolumes ; ++i)
{ {
do do
...@@ -201,8 +203,35 @@ bool MeshTablesVolume<PFP>::importTet(const std::string& filename, std::vector<s ...@@ -201,8 +203,35 @@ bool MeshTablesVolume<PFP>::importTet(const std::string& filename, std::vector<s
int n; int n;
oss >> n; // type of volumes oss >> n; // type of volumes
if(!oss.good())
{
oss.clear();
char dummy;
oss >> dummy; // type of volumes
oss >> dummy;
if(dummy == 'C')// connector
{
++nbc;
m_nbFaces.push_back(3);
int s0,s1,s2,s3;
oss >> s0;
oss >> s1;
oss >> s2;
oss >> s3;
//std::cout << "connector " << s0 << " " << s1 << " " << s2 << " " << s3 << std::endl;
m_emb.push_back(verticesID[s0]);
m_emb.push_back(verticesID[s1]);
m_emb.push_back(verticesID[s2]);
m_emb.push_back(verticesID[s3]);
}
}
//tetrahedron //tetrahedron
if(n == 4) else if(n == 4)
{ {
m_nbFaces.push_back(4); m_nbFaces.push_back(4);
...@@ -218,7 +247,7 @@ bool MeshTablesVolume<PFP>::importTet(const std::string& filename, std::vector<s ...@@ -218,7 +247,7 @@ bool MeshTablesVolume<PFP>::importTet(const std::string& filename, std::vector<s
typename PFP::VEC3 B = position[verticesID[s2]]; typename PFP::VEC3 B = position[verticesID[s2]];
typename PFP::VEC3 C = position[verticesID[s3]]; typename PFP::VEC3 C = position[verticesID[s3]];
if (Geom::testOrientation3D<typename PFP::VEC3>(P,A,B,C) == Geom::UNDER) if (Geom::testOrientation3D<typename PFP::VEC3>(P,A,B,C) == Geom::OVER)
{ {
int ui = s1; int ui = s1;
s1 = s2; s1 = s2;
...@@ -334,33 +363,33 @@ bool MeshTablesVolume<PFP>::importTet(const std::string& filename, std::vector<s ...@@ -334,33 +363,33 @@ bool MeshTablesVolume<PFP>::importTet(const std::string& filename, std::vector<s
oss >> s6; oss >> s6;
oss >> s7; oss >> s7;
typename PFP::VEC3 P = position[verticesID[s4]]; typename PFP::VEC3 P = position[verticesID[s4]];
typename PFP::VEC3 A = position[verticesID[s0]]; typename PFP::VEC3 A = position[verticesID[s0]];
typename PFP::VEC3 B = position[verticesID[s1]]; typename PFP::VEC3 B = position[verticesID[s1]];
typename PFP::VEC3 C = position[verticesID[s2]]; typename PFP::VEC3 C = position[verticesID[s2]];
// 1 hexa ok avec cette partie // 1 hexa ok avec cette partie
if (Geom::testOrientation3D<typename PFP::VEC3>(P,A,B,C) == Geom::UNDER) if (Geom::testOrientation3D<typename PFP::VEC3>(P,A,B,C) == Geom::OVER)
{ {
unsigned int pt[8]; unsigned int pt[8];
pt[0] = s0; pt[0] = s0;
pt[1] = s1; pt[1] = s1;
pt[2] = s3; pt[2] = s3;
pt[3] = s2; pt[3] = s2;
pt[4] = s4; pt[4] = s4;
pt[5] = s5; pt[5] = s5;
pt[6] = s7; pt[6] = s7;
pt[7] = s6; pt[7] = s6;
s0 = pt[0]; s0 = pt[0];
s1 = pt[1]; s1 = pt[1];
s2 = pt[2]; s2 = pt[2];
s3 = pt[3]; s3 = pt[3];
s4 = pt[4]; s4 = pt[4];
s5 = pt[5]; s5 = pt[5];
s6 = pt[6]; s6 = pt[6];
s7 = pt[7]; s7 = pt[7];
} }
m_emb.push_back(verticesID[s0]); m_emb.push_back(verticesID[s0]);
m_emb.push_back(verticesID[s1]); m_emb.push_back(verticesID[s1]);
...@@ -371,9 +400,10 @@ bool MeshTablesVolume<PFP>::importTet(const std::string& filename, std::vector<s ...@@ -371,9 +400,10 @@ bool MeshTablesVolume<PFP>::importTet(const std::string& filename, std::vector<s
m_emb.push_back(verticesID[s6]); m_emb.push_back(verticesID[s6]);
m_emb.push_back(verticesID[s7]); m_emb.push_back(verticesID[s7]);
} }
} }
std::cout << "#connectors = " << nbc << std::endl;
fp.close(); fp.close();
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment