#4683 clang-format on all files in ApplicationCode

This commit is contained in:
Magne Sjaastad
2019-09-06 10:40:57 +02:00
parent 3a317504bb
commit fe9e567825
2092 changed files with 117952 additions and 111846 deletions

View File

@@ -48,54 +48,56 @@
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Riv3dWellLogPlanePartMgr::Riv3dWellLogPlanePartMgr(RimWellPath* wellPath, RimGridView* gridView)
: m_wellPath(wellPath)
, m_gridView(gridView)
Riv3dWellLogPlanePartMgr::Riv3dWellLogPlanePartMgr( RimWellPath* wellPath, RimGridView* gridView )
: m_wellPath( wellPath )
, m_gridView( gridView )
{
CVF_ASSERT(m_wellPath.notNull());
CVF_ASSERT( m_wellPath.notNull() );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Riv3dWellLogPlanePartMgr::appendPlaneToModel(cvf::ModelBasicList* model,
const caf::DisplayCoordTransform* displayCoordTransform,
const cvf::BoundingBox& wellPathClipBoundingBox,
bool isStaticResult)
void Riv3dWellLogPlanePartMgr::appendPlaneToModel( cvf::ModelBasicList* model,
const caf::DisplayCoordTransform* displayCoordTransform,
const cvf::BoundingBox& wellPathClipBoundingBox,
bool isStaticResult )
{
if (m_wellPath.isNull()) return;
if ( m_wellPath.isNull() ) return;
if (!m_wellPath->rim3dWellLogCurveCollection()) return;
if ( !m_wellPath->rim3dWellLogCurveCollection() ) return;
if (!m_wellPath->rim3dWellLogCurveCollection()->isShowingPlot()) return;
if ( !m_wellPath->rim3dWellLogCurveCollection()->isShowingPlot() ) return;
if (m_wellPath->rim3dWellLogCurveCollection()->vectorOf3dWellLogCurves().empty()) return;
if ( m_wellPath->rim3dWellLogCurveCollection()->vectorOf3dWellLogCurves().empty() ) return;
if (isStaticResult)
if ( isStaticResult )
{
std::set<Rim3dWellLogCurve::DrawPlane> drawPlanes;
for (Rim3dWellLogCurve* rim3dWellLogCurve : m_wellPath->rim3dWellLogCurveCollection()->vectorOf3dWellLogCurves())
for ( Rim3dWellLogCurve* rim3dWellLogCurve : m_wellPath->rim3dWellLogCurveCollection()->vectorOf3dWellLogCurves() )
{
if (rim3dWellLogCurve->showInView(m_gridView))
if ( rim3dWellLogCurve->showInView( m_gridView ) )
{
drawPlanes.insert(rim3dWellLogCurve->drawPlane());
drawPlanes.insert( rim3dWellLogCurve->drawPlane() );
}
}
for (Rim3dWellLogCurve::DrawPlane drawPlane : drawPlanes)
for ( Rim3dWellLogCurve::DrawPlane drawPlane : drawPlanes )
{
m_3dWellLogDrawSurfaceGeometryGenerators[drawPlane] = new Riv3dWellLogDrawSurfaceGenerator(m_wellPath.p());
appendDrawSurfaceToModel(model, displayCoordTransform, wellPathClipBoundingBox, drawPlane, planeWidth());
m_3dWellLogDrawSurfaceGeometryGenerators[drawPlane] = new Riv3dWellLogDrawSurfaceGenerator( m_wellPath.p() );
appendDrawSurfaceToModel( model, displayCoordTransform, wellPathClipBoundingBox, drawPlane, planeWidth() );
}
}
for (Rim3dWellLogCurve* rim3dWellLogCurve : m_wellPath->rim3dWellLogCurveCollection()->vectorOf3dWellLogCurves())
for ( Rim3dWellLogCurve* rim3dWellLogCurve : m_wellPath->rim3dWellLogCurveCollection()->vectorOf3dWellLogCurves() )
{
if (rim3dWellLogCurve->showInView(m_gridView) && rim3dWellLogCurve->isShowingTimeDependentResult() != isStaticResult)
if ( rim3dWellLogCurve->showInView( m_gridView ) &&
rim3dWellLogCurve->isShowingTimeDependentResult() != isStaticResult )
{
append3dWellLogCurveToModel(model,
displayCoordTransform,
wellPathClipBoundingBox,
rim3dWellLogCurve,
m_3dWellLogDrawSurfaceGeometryGenerators[rim3dWellLogCurve->drawPlane()]->vertices());
append3dWellLogCurveToModel( model,
displayCoordTransform,
wellPathClipBoundingBox,
rim3dWellLogCurve,
m_3dWellLogDrawSurfaceGeometryGenerators[rim3dWellLogCurve->drawPlane()]
->vertices() );
}
}
}
@@ -103,57 +105,57 @@ void Riv3dWellLogPlanePartMgr::appendPlaneToModel(cvf::ModelBasicList*
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Riv3dWellLogPlanePartMgr::append3dWellLogCurveToModel(cvf::ModelBasicList* model,
const caf::DisplayCoordTransform* displayCoordTransform,
const cvf::BoundingBox& wellPathClipBoundingBox,
Rim3dWellLogCurve* rim3dWellLogCurve,
const std::vector<cvf::Vec3d>& drawSurfaceVertices)
void Riv3dWellLogPlanePartMgr::append3dWellLogCurveToModel( cvf::ModelBasicList* model,
const caf::DisplayCoordTransform* displayCoordTransform,
const cvf::BoundingBox& wellPathClipBoundingBox,
Rim3dWellLogCurve* rim3dWellLogCurve,
const std::vector<cvf::Vec3d>& drawSurfaceVertices )
{
CVF_ASSERT(rim3dWellLogCurve);
CVF_ASSERT( rim3dWellLogCurve );
cvf::ref<Riv3dWellLogCurveGeometryGenerator> generator = rim3dWellLogCurve->geometryGenerator();
if (generator.isNull())
if ( generator.isNull() )
{
generator = new Riv3dWellLogCurveGeometryGenerator(m_wellPath.p());
rim3dWellLogCurve->setGeometryGenerator(generator.p());
generator = new Riv3dWellLogCurveGeometryGenerator( m_wellPath.p() );
rim3dWellLogCurve->setGeometryGenerator( generator.p() );
}
generator->createCurveDrawables(displayCoordTransform,
wellPathClipBoundingBox,
rim3dWellLogCurve,
wellPathCenterToPlotStartOffset(rim3dWellLogCurve->drawPlane()),
planeWidth(),
drawSurfaceVertices,
m_gridView->currentTimeStep());
generator->createCurveDrawables( displayCoordTransform,
wellPathClipBoundingBox,
rim3dWellLogCurve,
wellPathCenterToPlotStartOffset( rim3dWellLogCurve->drawPlane() ),
planeWidth(),
drawSurfaceVertices,
m_gridView->currentTimeStep() );
cvf::ref<cvf::DrawableGeo> curveDrawable = generator->curveDrawable();
if (curveDrawable.notNull() && curveDrawable->boundingBox().isValid())
if ( curveDrawable.notNull() && curveDrawable->boundingBox().isValid() )
{
caf::MeshEffectGenerator meshEffectGen(rim3dWellLogCurve->color());
meshEffectGen.setLineWidth(3.0f);
caf::MeshEffectGenerator meshEffectGen( rim3dWellLogCurve->color() );
meshEffectGen.setLineWidth( 3.0f );
cvf::ref<cvf::Effect> effect = meshEffectGen.generateCachedEffect();
cvf::ref<cvf::Part> part = new cvf::Part;
part->setDrawable(curveDrawable.p());
part->setEffect(effect.p());
part->setDrawable( curveDrawable.p() );
part->setEffect( effect.p() );
part->setSourceInfo(new RivMeshLinesSourceInfo(rim3dWellLogCurve));
part->setSourceInfo( new RivMeshLinesSourceInfo( rim3dWellLogCurve ) );
model->addPart(part.p());
model->addPart( part.p() );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::ref<cvf::Part> Riv3dWellLogPlanePartMgr::createPart(cvf::Drawable* drawable, cvf::Effect* effect)
cvf::ref<cvf::Part> Riv3dWellLogPlanePartMgr::createPart( cvf::Drawable* drawable, cvf::Effect* effect )
{
cvf::ref<cvf::Part> part = new cvf::Part;
if (drawable && drawable->boundingBox().isValid())
if ( drawable && drawable->boundingBox().isValid() )
{
part->setDrawable(drawable);
part->setEffect(effect);
part->setDrawable( drawable );
part->setEffect( effect );
}
return part;
@@ -162,17 +164,17 @@ cvf::ref<cvf::Part> Riv3dWellLogPlanePartMgr::createPart(cvf::Drawable* drawable
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double Riv3dWellLogPlanePartMgr::wellPathCenterToPlotStartOffset(Rim3dWellLogCurve::DrawPlane drawPlane) const
double Riv3dWellLogPlanePartMgr::wellPathCenterToPlotStartOffset( Rim3dWellLogCurve::DrawPlane drawPlane ) const
{
if (drawPlane == Rim3dWellLogCurve::HORIZONTAL_CENTER || drawPlane == Rim3dWellLogCurve::VERTICAL_CENTER)
if ( drawPlane == Rim3dWellLogCurve::HORIZONTAL_CENTER || drawPlane == Rim3dWellLogCurve::VERTICAL_CENTER )
{
return -0.5 * planeWidth();
}
else
{
double cellSize = m_gridView->ownerCase()->characteristicCellSize();
double wellPathOffset = std::min(m_wellPath->wellPathRadius(cellSize), 0.1 * planeWidth());
return m_wellPath->wellPathRadius(cellSize) + wellPathOffset;
double wellPathOffset = std::min( m_wellPath->wellPathRadius( cellSize ), 0.1 * planeWidth() );
return m_wellPath->wellPathRadius( cellSize ) + wellPathOffset;
}
}
@@ -181,7 +183,7 @@ double Riv3dWellLogPlanePartMgr::wellPathCenterToPlotStartOffset(Rim3dWellLogCur
//--------------------------------------------------------------------------------------------------
double Riv3dWellLogPlanePartMgr::planeWidth() const
{
if (!m_gridView) return 0;
if ( !m_gridView ) return 0;
double cellSize = m_gridView->ownerCase()->characteristicCellSize();
const Rim3dWellLogCurveCollection* curveCollection = m_wellPath->rim3dWellLogCurveCollection();
@@ -191,40 +193,40 @@ double Riv3dWellLogPlanePartMgr::planeWidth() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Riv3dWellLogPlanePartMgr::appendDrawSurfaceToModel(cvf::ModelBasicList* model,
const caf::DisplayCoordTransform* displayCoordTransform,
const cvf::BoundingBox& wellPathClipBoundingBox,
Rim3dWellLogCurve::DrawPlane drawPlane,
double samplingInterval)
void Riv3dWellLogPlanePartMgr::appendDrawSurfaceToModel( cvf::ModelBasicList* model,
const caf::DisplayCoordTransform* displayCoordTransform,
const cvf::BoundingBox& wellPathClipBoundingBox,
Rim3dWellLogCurve::DrawPlane drawPlane,
double samplingInterval )
{
Rim3dWellLogCurveCollection* curveCollection = m_wellPath->rim3dWellLogCurveCollection();
cvf::ref<RivObjectSourceInfo> sourceInfo = new RivObjectSourceInfo(curveCollection);
cvf::ref<RivObjectSourceInfo> sourceInfo = new RivObjectSourceInfo( curveCollection );
bool showCoordinateSystemMesh = curveCollection->isShowingGrid();
bool showBackground = curveCollection->isShowingBackground();
cvf::Color3f borderColor(0.4f, 0.4f, 0.4f);
caf::SurfaceEffectGenerator backgroundEffectGen(cvf::Color4f(1.0, 1.0, 1.0, 1.0), caf::PO_2);
caf::MeshEffectGenerator borderEffectGen(borderColor);
cvf::Color3f borderColor( 0.4f, 0.4f, 0.4f );
caf::SurfaceEffectGenerator backgroundEffectGen( cvf::Color4f( 1.0, 1.0, 1.0, 1.0 ), caf::PO_2 );
caf::MeshEffectGenerator borderEffectGen( borderColor );
caf::VectorEffectGenerator curveNormalsEffectGen;
backgroundEffectGen.enableLighting(false);
backgroundEffectGen.enableLighting( false );
if (!showBackground)
if ( !showBackground )
{
// Make the background invisible but still present for picking.
backgroundEffectGen.enableColorMask(false);
backgroundEffectGen.enableDepthTest(false);
backgroundEffectGen.enableDepthWrite(false);
backgroundEffectGen.enableColorMask( false );
backgroundEffectGen.enableDepthTest( false );
backgroundEffectGen.enableDepthWrite( false );
}
bool drawSurfaceCreated =
m_3dWellLogDrawSurfaceGeometryGenerators[drawPlane]->createDrawSurface(displayCoordTransform,
wellPathClipBoundingBox,
Rim3dWellLogCurve::drawPlaneAngle(drawPlane),
wellPathCenterToPlotStartOffset(drawPlane),
planeWidth(),
samplingInterval);
if (!drawSurfaceCreated) return;
bool drawSurfaceCreated = m_3dWellLogDrawSurfaceGeometryGenerators[drawPlane]
->createDrawSurface( displayCoordTransform,
wellPathClipBoundingBox,
Rim3dWellLogCurve::drawPlaneAngle( drawPlane ),
wellPathCenterToPlotStartOffset( drawPlane ),
planeWidth(),
samplingInterval );
if ( !drawSurfaceCreated ) return;
cvf::ref<cvf::Effect> backgroundEffect = backgroundEffectGen.generateCachedEffect();
cvf::ref<cvf::Effect> borderEffect = borderEffectGen.generateCachedEffect();
@@ -232,42 +234,42 @@ void Riv3dWellLogPlanePartMgr::appendDrawSurfaceToModel(cvf::ModelBasicList*
cvf::ref<cvf::DrawableGeo> background = m_3dWellLogDrawSurfaceGeometryGenerators[drawPlane]->background();
if (background.notNull())
if ( background.notNull() )
{
cvf::ref<cvf::Part> part = createPart(background.p(), backgroundEffect.p());
if (part.notNull())
cvf::ref<cvf::Part> part = createPart( background.p(), backgroundEffect.p() );
if ( part.notNull() )
{
model->addPart(part.p());
part->setSourceInfo(sourceInfo.p());
model->addPart( part.p() );
part->setSourceInfo( sourceInfo.p() );
}
}
if (showCoordinateSystemMesh)
if ( showCoordinateSystemMesh )
{
cvf::ref<cvf::DrawableGeo> border = m_3dWellLogDrawSurfaceGeometryGenerators[drawPlane]->border();
if (border.notNull())
if ( border.notNull() )
{
cvf::ref<cvf::Part> part = createPart(border.p(), borderEffect.p());
if (part.notNull())
cvf::ref<cvf::Part> part = createPart( border.p(), borderEffect.p() );
if ( part.notNull() )
{
model->addPart(part.p());
model->addPart( part.p() );
}
}
cvf::ref<cvf::DrawableVectors> normals = m_3dWellLogDrawSurfaceGeometryGenerators[drawPlane]->curveNormalVectors();
if (normals.notNull())
if ( normals.notNull() )
{
normals->setSingleColor(borderColor);
if (RiaGuiApplication::instance()->useShaders())
normals->setSingleColor( borderColor );
if ( RiaGuiApplication::instance()->useShaders() )
{
normals->setUniformNames("u_transformationMatrix", "u_color");
normals->setUniformNames( "u_transformationMatrix", "u_color" );
}
cvf::ref<cvf::Part> part = createPart(normals.p(), curveNormalsEffect.p());
if (part.notNull())
cvf::ref<cvf::Part> part = createPart( normals.p(), curveNormalsEffect.p() );
if ( part.notNull() )
{
model->addPart(part.p());
part->setSourceInfo(sourceInfo.p());
model->addPart( part.p() );
part->setSourceInfo( sourceInfo.p() );
}
}
}