Use read/write functions of the stream to increase performance

p4#: 21698
This commit is contained in:
Magne Sjaastad 2013-05-23 11:29:34 +02:00
parent d5fd09f658
commit 511ea74d4e
2 changed files with 7 additions and 12 deletions

View File

@ -523,30 +523,25 @@ public:
std::vector<double> cellCornerValues(doubleValueCount);
cvf::Vec3d cornerVerts[8];
quint64 coordCount = 0;
for (size_t localGridCellIdx = 0; localGridCellIdx < rigGrid->cellCount(); localGridCellIdx++)
{
rigGrid->cellCornerVertices(localGridCellIdx, cornerVerts);
for (size_t j = 0; j < 8; j++)
{
/*
cellCornerValues[localGridCellIdx * 3 + 0] = cornerVerts[j].x();
cellCornerValues[localGridCellIdx * 3 + 1] = cornerVerts[j].y();
cellCornerValues[localGridCellIdx * 3 + 2] = cornerVerts[j].z();
*/
cellCornerValues[coordCount * 3 + 0] = cornerVerts[j].x();
cellCornerValues[coordCount * 3 + 1] = cornerVerts[j].y();
cellCornerValues[coordCount * 3 + 2] = cornerVerts[j].z();
socketStream << cornerVerts[j].x();
socketStream << cornerVerts[j].y();
socketStream << cornerVerts[j].z();
coordCount++;
}
}
//server->currentClient()->write((const char *)cellCornerValues.data(), byteCount);
server->currentClient()->write((const char *)cellCornerValues.data(), byteCount);
return true;
}
};
static bool RiaGetCellCorners_init = RiaSocketCommandFactory::instance()->registerCreator<RiaGetCellCorners>(RiaGetCellCorners::commandName());

View File

@ -98,7 +98,7 @@ void getCellCorners(NDArray& cellCornerValues, const QString &hostName, quint16
double* internalMatrixData = cellCornerValues.fortran_vec();
#if 1
#if 0
double val;
for (octave_idx_type i = 0; i < valueCount; i++)
{