Skip to content

Commit

Permalink
Converter: corr. ecriture bintp v4, docs: minor
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit128 committed Jun 18, 2024
1 parent b970460 commit 3d58b2a
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 83 deletions.
12 changes: 6 additions & 6 deletions Cassiopee/CPlot/CPlot/Shaders/panorama.frag
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ void main(void)
scale = -1.0 / x;
px.x = ( z*scale + 1.0) / 2.0;
px.y = ( y*scale + 1.0) / 2.0;
color = texture(cube_left, px);
color = texture2D(cube_left, px);
}
else
{
scale = 1.0 / x;
px.x = (-z*scale + 1.0) / 2.0;
px.y = ( y*scale + 1.0) / 2.0;
color = texture(cube_right, px);
color = texture2D(cube_right, px);
}
}
else if (abs(y) >= abs(z))
Expand All @@ -49,14 +49,14 @@ void main(void)
scale = -1.0 / y;
px.x = (-x*scale + 1.0) / 2.0; // a shifter a droite
px.y = ( z*scale + 1.0) / 2.0;
color = texture(cube_top, px); // inverse
color = texture2D(cube_top, px); // inverse
}
else
{
scale = 1.0 / y;
px.x = (-x*scale + 1.0) / 2.0;
px.y = (-z*scale + 1.0) / 2.0;
color = texture(cube_bottom, px);
color = texture2D(cube_bottom, px);
}
}
else
Expand All @@ -66,14 +66,14 @@ void main(void)
scale = -1.0 / z;
px.x = (-x*scale + 1.0) / 2.0;
px.y = ( y*scale + 1.0) / 2.0;
color = texture(cube_back, px);
color = texture2D(cube_back, px);
}
else
{
scale = 1.0 / z;
px.x = ( x*scale + 1.0) / 2.0;
px.y = ( y*scale + 1.0) / 2.0;
color = texture(cube_front, px);
color = texture2D(cube_front, px);
}
}
gl_FragColor = color;
Expand Down
153 changes: 80 additions & 73 deletions Cassiopee/Converter/Converter/IO/GenIO_bintp108.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -703,34 +703,34 @@ E_Int K_IO::GenIO::readData108(E_Int version, FILE* ptrFile,
if (passive[n] == 0)
{
if (varType[n] == 1)
{
fread(buf1, sizeof(float), size, ptrFile);
for (i = 0; i < size; i++) fp[i] = buf1[i];
delete [] buf1;
{
fread(buf1, sizeof(float), size, ptrFile);
for (i = 0; i < size; i++) fp[i] = buf1[i];
delete [] buf1;
}
else if (varType[n] == 2)
{
fread(buf2, sizeof(double), size, ptrFile);
for (i = 0; i < size; i++) fp[i] = buf2[i];
delete [] buf2;
fread(buf2, sizeof(double), size, ptrFile);
for (i = 0; i < size; i++) fp[i] = buf2[i];
delete [] buf2;
}
else if (varType[n] == 3)
{
fread(buf3, sizeof(int64_t), size, ptrFile);
for (i = 0; i < size; i++) fp[i] = buf3[i];
delete [] buf3;
fread(buf3, sizeof(int64_t), size, ptrFile);
for (i = 0; i < size; i++) fp[i] = buf3[i];
delete [] buf3;
}
else if (varType[n] == 4)
{
fread(buf4, sizeof(int32_t), size, ptrFile);
for (i = 0; i < size; i++) fp[i] = buf4[i];
delete [] buf4;
fread(buf4, sizeof(int32_t), size, ptrFile);
for (i = 0; i < size; i++) fp[i] = buf4[i];
delete [] buf4;
}
else if (varType[n] == 5)
{
fread(buf5, sizeof(int8_t), size, ptrFile);
for (i = 0; i < size; i++) fp[i] = buf5[i];
delete [] buf5;
fread(buf5, sizeof(int8_t), size, ptrFile);
for (i = 0; i < size; i++) fp[i] = buf5[i];
delete [] buf5;
}
}
else
Expand All @@ -750,58 +750,58 @@ E_Int K_IO::GenIO::readData108(E_Int version, FILE* ptrFile,
vector<int> pos(nfield+1); // pos of non passive field in buffer
for (i = 0; i < nfield; i++)
{
if (passive[i] == 0)
{
if (varType[i] == 1) { pos[nfieldLoc] = bsize; bsize += 4; }
else if (varType[i] == 2) { pos[nfieldLoc] = bsize; bsize += 8; }
else if (varType[i] == 3) { pos[nfieldLoc] = bsize; bsize += 8; }
else if (varType[i] == 4) { pos[nfieldLoc] = bsize; bsize += 4; }
else if (varType[i] == 5) { pos[nfieldLoc] = bsize; bsize += 1; }
index[nfieldLoc] = i; nfieldLoc += 1;
}
if (passive[i] == 0)
{
if (varType[i] == 1) { pos[nfieldLoc] = bsize; bsize += 4; }
else if (varType[i] == 2) { pos[nfieldLoc] = bsize; bsize += 8; }
else if (varType[i] == 3) { pos[nfieldLoc] = bsize; bsize += 8; }
else if (varType[i] == 4) { pos[nfieldLoc] = bsize; bsize += 4; }
else if (varType[i] == 5) { pos[nfieldLoc] = bsize; bsize += 1; }
index[nfieldLoc] = i; nfieldLoc += 1;
}
}
char* buf = new char[bsize];

for (n = 0; n < npts; n++)
{
for (i = 0; i < nfield; i++) fp(n, i+1) = 0.;
fread(buf, sizeof(char), bsize, ptrFile);
for (i = 0; i < nfieldLoc; i++)
{
switch (varType[index[i]])
{
case 1:
{
float* ptr = (float*)&buf[pos[i]];
fp(n, index[i]+1) = ptr[0];
}
break;
case 2:
{
double* ptr = (double*)&buf[pos[i]];
fp(n, index[i]+1) = ptr[0];
}
break;
case 3:
{
int64_t* ptr = (int64_t*)&buf[pos[i]];
fp(n, index[i]+1) = ptr[0];
}
break;
case 4:
{
int32_t* ptr = (int32_t*)&buf[pos[i]];
fp(n, index[i]+1) = ptr[0];
}
break;
case 5:
{
int8_t* ptr = (int8_t*)&buf[pos[i]];
fp(n, index[i]+1) = ptr[0];
}
break;
}
}
for (i = 0; i < nfield; i++) fp(n, i+1) = 0.;
fread(buf, sizeof(char), bsize, ptrFile);
for (i = 0; i < nfieldLoc; i++)
{
switch (varType[index[i]])
{
case 1:
{
float* ptr = (float*)&buf[pos[i]];
fp(n, index[i]+1) = ptr[0];
}
break;
case 2:
{
double* ptr = (double*)&buf[pos[i]];
fp(n, index[i]+1) = ptr[0];
}
break;
case 3:
{
int64_t* ptr = (int64_t*)&buf[pos[i]];
fp(n, index[i]+1) = ptr[0];
}
break;
case 4:
{
int32_t* ptr = (int32_t*)&buf[pos[i]];
fp(n, index[i]+1) = ptr[0];
}
break;
case 5:
{
int8_t* ptr = (int8_t*)&buf[pos[i]];
fp(n, index[i]+1) = ptr[0];
}
break;
}
}
}
delete [] buf;
}
Expand All @@ -811,8 +811,8 @@ E_Int K_IO::GenIO::readData108(E_Int version, FILE* ptrFile,
FldArrayF& fp = *f;
for (n = 0; n < npts; n++)
{
fread(buf, sizeof(float), nfield, ptrFile);
for (i = 0; i < nfield; i++) fp(n, i+1) = buf[i];
fread(buf, sizeof(float), nfield, ptrFile);
for (i = 0; i < nfield; i++) fp(n, i+1) = buf[i];
}
delete [] buf;
}
Expand All @@ -822,8 +822,8 @@ E_Int K_IO::GenIO::readData108(E_Int version, FILE* ptrFile,
double* buf = new double[nfield];
for (n = 0; n < npts; n++)
{
fread(buf, sizeof(E_Float), nfield, ptrFile);
for (i = 0; i < nfield; i++) fp(n, i+1) = buf[i];
fread(buf, sizeof(E_Float), nfield, ptrFile);
for (i = 0; i < nfield; i++) fp(n, i+1) = buf[i];
}
delete [] buf;
}
Expand Down Expand Up @@ -2394,7 +2394,9 @@ E_Int K_IO::GenIO::tecwrite108(
case 8: // NGON
{
E_Int* ngon = connect[nol]->getNGon();
if (ngon[0] > 2) ib = 7; // polyhedron
E_Int* indPG = connect[nol]->getIndPG();
E_Int nf; connect[nol]->getFace(0, nf, ngon, indPG);
if (nf > 2) ib = 7; // polyhedron
else ib = 6; // polygon
}
break;
Expand Down Expand Up @@ -2455,7 +2457,10 @@ E_Int K_IO::GenIO::tecwrite108(
// num faces
ib = connect[nol]->getNFaces(); fwrite(&ib, si, 1, ptrFile);
// numFacesNodes
ib = connect[nol]->getSizeNGon()-ib; fwrite(&ib, si, 1, ptrFile);
E_Int isNGon = connect[nol]->isNGon();
E_Int size = connect[nol]->getSizeNGon();
if (isNGon != 3) size -= connect[nol]->getNFaces();
ib = size; fwrite(&ib, si, 1, ptrFile);
// Boundary faces
ib = 0; fwrite(&ib, si, 1, ptrFile);
// Boundary connections
Expand Down Expand Up @@ -2631,13 +2636,16 @@ E_Int K_IO::GenIO::tecwrite108(
E_Int* ngon = c.getNGon();
E_Int* indPG = c.getIndPG();
E_Int numFaces = c.getNFaces();
E_Int isNGon = c.isNGon();
E_Int size = c.getSizeNGon();
E_Int nf = ngon[0];
nv = 1;
if (isNGon == 3) size += numFaces;
E_Int nf; c.getFace(0, nf, ngon, indPG);
if (nf > 2) nt = numFaces+1 + (size-numFaces) + 2*numFaces;
else nt = (size-numFaces) + 2*numFaces;

bufferi = new int[nt];

nv = 1;

// face offset
int* ptri = bufferi;
if (nf > 2) // only for volumic
Expand Down Expand Up @@ -2666,7 +2674,6 @@ E_Int K_IO::GenIO::tecwrite108(

// left
for (E_Int i = 0; i < numFaces; i++) ptri[i] = cFE1[i]-1;

ptri += numFaces;
// right
for (E_Int i = 0; i < numFaces; i++) ptri[i] = cFE2[i]-1;
Expand Down
4 changes: 2 additions & 2 deletions docs/Authors.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ <h1>Cassiopée team</h1>
</header>

<br>
<p><strong> Current developers: </strong> Francesca Basile, Christophe Benoit, Luis Bernardos, Sébastien Bourasseau, Benjamin Constant, Alexis Dorange, Antoine Jost, Xavier Juvigny, Ivan Mary, Bruno Maugars, Bertrand Michel, Stéphanie Péron, Thomas Renaud, Matthieu Soismier, Alexandre Suss, Simon Verley.</p>
<p><strong> Current contributors: </strong> Francesca Basile, Christophe Benoit, Luis Bernardos, Sébastien Bourasseau, Benjamin Constant, Alexis Dorange, Antoine Jost, Xavier Juvigny, Ivan Mary, Bruno Maugars, Bertrand Michel, Stéphanie Péron, Thomas Renaud, Matthieu Soismier, Alexandre Suss, Simon Verley.</p>

<p><strong> Former developers: </strong> Clément Benazet, Gaelle Jeanfaivre, Sâm Landier, Baptiste Méral, Benoit Rodriguez, Christelle Wervaecke.</p><br>
<p><strong> Former contributors: </strong> Clément Benazet, Gaelle Jeanfaivre, Sâm Landier, Baptiste Méral, Benoit Rodriguez, Christelle Wervaecke.</p><br>

<hr>

Expand Down
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@
<strong>Any questions?</strong> <a href="https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!forum/cassiopee-community">News, Question and Answer Forum</a>.<br>
</TEXTcenter>

<img src="Images/icon0_new.png" class="icon"></a>
<!-- <img src="Images/icon0_new.png" class="icon"></a>
<TEXTcenter>
<strong>Miss the old theme?</strong> <button onclick="switchTheme()" id="fancyButton">Add some yellow</button><br>
</TEXTcenter>
</TEXTcenter> -->
</td>
</tr>
</table>
Expand Down

0 comments on commit 3d58b2a

Please sign in to comment.