mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
clang-format: Set column width to 140
* Set column width to 140 * Use c++20 * Remove redundant virtual
This commit is contained in:
@@ -90,9 +90,7 @@ void VdeVizDataExtractor::extractViewContents( QString* modelMetaJson
|
||||
const float* floatArr = reinterpret_cast<const float*>( mesh->vertexArr->ptr() );
|
||||
const size_t arrElementCount = 3 * mesh->vertexArr->size();
|
||||
arrayIdsThisMesh.vertexArrId =
|
||||
m_cachingIdFactory->getOrCreateIdForFloatArr( VdeCachingHashedIdFactory::VertexArr,
|
||||
floatArr,
|
||||
arrElementCount );
|
||||
m_cachingIdFactory->getOrCreateIdForFloatArr( VdeCachingHashedIdFactory::VertexArr, floatArr, arrElementCount );
|
||||
|
||||
if ( !packetDirectory->lookupPacket( arrayIdsThisMesh.vertexArrId ) )
|
||||
{
|
||||
@@ -135,9 +133,7 @@ void VdeVizDataExtractor::extractViewContents( QString* modelMetaJson
|
||||
const float* floatArr = reinterpret_cast<const float*>( mesh->texCoordArr->ptr() );
|
||||
const size_t arrElementCount = 2 * mesh->texCoordArr->size();
|
||||
arrayIdsThisMesh.texCoordsArrId =
|
||||
m_cachingIdFactory->getOrCreateIdForFloatArr( VdeCachingHashedIdFactory::TexCoordsArr,
|
||||
floatArr,
|
||||
arrElementCount );
|
||||
m_cachingIdFactory->getOrCreateIdForFloatArr( VdeCachingHashedIdFactory::TexCoordsArr, floatArr, arrElementCount );
|
||||
|
||||
if ( !packetDirectory->lookupPacket( arrayIdsThisMesh.texCoordsArrId ) )
|
||||
{
|
||||
@@ -156,19 +152,16 @@ void VdeVizDataExtractor::extractViewContents( QString* modelMetaJson
|
||||
{
|
||||
cvf::ref<cvf::UByteArray> byteArr = mesh->texImage->toRgb();
|
||||
arrayIdsThisMesh.texImageArrId =
|
||||
m_cachingIdFactory->getOrCreateIdForUint8Arr( VdeCachingHashedIdFactory::TexImage,
|
||||
byteArr->ptr(),
|
||||
byteArr->size() );
|
||||
m_cachingIdFactory->getOrCreateIdForUint8Arr( VdeCachingHashedIdFactory::TexImage, byteArr->ptr(), byteArr->size() );
|
||||
|
||||
if ( !packetDirectory->lookupPacket( arrayIdsThisMesh.texImageArrId ) )
|
||||
{
|
||||
cvf::Trace::show( " generating texture image, arrayId=%d", arrayIdsThisMesh.texImageArrId );
|
||||
std::unique_ptr<VdeArrayDataPacket> dataPacket =
|
||||
VdeArrayDataPacket::fromUint8ImageRGBArr( arrayIdsThisMesh.texImageArrId,
|
||||
mesh->texImage->width(),
|
||||
mesh->texImage->height(),
|
||||
byteArr->ptr(),
|
||||
byteArr->size() );
|
||||
std::unique_ptr<VdeArrayDataPacket> dataPacket = VdeArrayDataPacket::fromUint8ImageRGBArr( arrayIdsThisMesh.texImageArrId,
|
||||
mesh->texImage->width(),
|
||||
mesh->texImage->height(),
|
||||
byteArr->ptr(),
|
||||
byteArr->size() );
|
||||
|
||||
// Debug testing of decoding
|
||||
// debugComparePackets(*dataPacket,
|
||||
@@ -186,8 +179,7 @@ void VdeVizDataExtractor::extractViewContents( QString* modelMetaJson
|
||||
const int fillPacketDir_ms = static_cast<int>( tim.lapTime() * 1000 );
|
||||
|
||||
// Extract any exportable labels present in the view
|
||||
const std::vector<std::pair<cvf::Vec3f, cvf::String>> labelAndPositionsArr =
|
||||
RicHoloLensExportImpl::labelsForExport( m_view );
|
||||
const std::vector<std::pair<cvf::Vec3f, cvf::String>> labelAndPositionsArr = RicHoloLensExportImpl::labelsForExport( m_view );
|
||||
|
||||
// Actually create the JSON containing model meta data
|
||||
*modelMetaJsonStr = createModelMetaJsonString( meshArr, allMeshesArrayIdsArr, labelAndPositionsArr );
|
||||
@@ -265,8 +257,7 @@ std::unique_ptr<VdeMesh> VdeVizDataExtractor::createMeshFromExportPart( const Vd
|
||||
const cvf::PrimitiveType primType = primSet->primitiveType();
|
||||
if ( primType != cvf::PT_TRIANGLES && primType != cvf::PT_LINES )
|
||||
{
|
||||
RiaLogging::debug(
|
||||
QString( "Currently only triangle and line primitive sets are supported (saw primitive type: %1)" ).arg( primType ) );
|
||||
RiaLogging::debug( QString( "Currently only triangle and line primitive sets are supported (saw primitive type: %1)" ).arg( primType ) );
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -358,8 +349,8 @@ std::unique_ptr<VdeMesh> VdeVizDataExtractor::createMeshFromExportPart( const Vd
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString VdeVizDataExtractor::createModelMetaJsonString( const std::vector<std::unique_ptr<VdeMesh>>& meshArr,
|
||||
const std::vector<VdeMeshArrayIds>& meshContentIdsArr,
|
||||
QString VdeVizDataExtractor::createModelMetaJsonString( const std::vector<std::unique_ptr<VdeMesh>>& meshArr,
|
||||
const std::vector<VdeMeshArrayIds>& meshContentIdsArr,
|
||||
const std::vector<std::pair<cvf::Vec3f, cvf::String>>& labelAndPositionsArr )
|
||||
{
|
||||
QVariantList jsonMeshMetaList;
|
||||
|
||||
Reference in New Issue
Block a user