Janitor : Add name to all parts to be able to find the source code producing the part

This commit is contained in:
Magne Sjaastad 2021-09-02 16:00:48 +02:00
parent 640c59d682
commit ea6e734a55
12 changed files with 29 additions and 2 deletions

View File

@ -141,6 +141,7 @@ void Riv3dWellLogPlanePartMgr::append3dWellLogCurveToModel( cvf::ModelBasicList*
cvf::ref<cvf::Effect> effect = meshEffectGen.generateCachedEffect();
cvf::ref<cvf::Part> part = new cvf::Part;
part->setName( "append3dWellLogCurveToModel" );
part->setDrawable( curveDrawable.p() );
part->setEffect( effect.p() );
@ -244,6 +245,7 @@ void Riv3dWellLogPlanePartMgr::appendDrawSurfaceToModel( cvf::ModelBasicList*
cvf::ref<cvf::Part> part = createPart( background.p(), backgroundEffect.p() );
if ( part.notNull() )
{
part->setName( "Riv3dWellLogPlanePartMgr::background" );
model->addPart( part.p() );
part->setSourceInfo( sourceInfo.p() );
}
@ -257,6 +259,7 @@ void Riv3dWellLogPlanePartMgr::appendDrawSurfaceToModel( cvf::ModelBasicList*
cvf::ref<cvf::Part> part = createPart( border.p(), borderEffect.p() );
if ( part.notNull() )
{
part->setName( "Riv3dWellLogPlanePartMgr::border" );
model->addPart( part.p() );
}
}
@ -273,6 +276,7 @@ void Riv3dWellLogPlanePartMgr::appendDrawSurfaceToModel( cvf::ModelBasicList*
cvf::ref<cvf::Part> part = createPart( normals.p(), curveNormalsEffect.p() );
if ( part.notNull() )
{
part->setName( "Riv3dWellLogPlanePartMgr::normals" );
model->addPart( part.p() );
part->setSourceInfo( sourceInfo.p() );
}

View File

@ -82,6 +82,7 @@ void RivContourMapProjectionPartMgr::appendPickPointVisToModel( cvf::ModelBasicL
cvf::ref<cvf::Effect> effect = meshEffectGen.generateCachedEffect();
cvf::ref<cvf::Part> part = new cvf::Part;
part->setName( "RivContourMapProjectionPartMgr::appendPickPointVisToModel" );
part->setDrawable( drawable.p() );
part->setEffect( effect.p() );
part->setSourceInfo( new RivMeshLinesSourceInfo( m_contourMapProjection.p() ) );
@ -158,6 +159,7 @@ void RivContourMapProjectionPartMgr::appendContourLinesToModel( const cvf::Camer
cvf::ref<cvf::Effect> effect = meshEffectGen.generateCachedEffect();
cvf::ref<cvf::Part> part = new cvf::Part;
part->setName( "RivContourMapProjectionPartMgr::contourDrawable_mesh" );
part->setDrawable( contourDrawable.p() );
part->setEffect( effect.p() );
part->setPriority( RivPartPriority::MeshLines );
@ -173,6 +175,7 @@ void RivContourMapProjectionPartMgr::appendContourLinesToModel( const cvf::Camer
for ( auto labelDrawableRef : labelDrawables )
{
cvf::ref<cvf::Part> part = new cvf::Part;
part->setName( "RivContourMapProjectionPartMgr::labelDrawableRef" );
part->setDrawable( labelDrawableRef.p() );
part->setEffect( m_labelEffect.p() );
part->setPriority( RivPartPriority::Text );
@ -237,6 +240,7 @@ cvf::ref<cvf::Part>
geo->setVertexArray( vertexArray.p() );
cvf::ref<cvf::Part> part = new cvf::Part;
part->setName( "RivContourMapProjectionPartMgr::createProjectionMapPart" );
part->setDrawable( geo.p() );
cvf::ScalarMapper* mapper = m_contourMapProjection->legendConfig()->scalarMapper();

View File

@ -372,6 +372,8 @@ cvf::ref<cvf::Part>
drawable->setTextureCoordArray( lineTexCoords.p() );
cvf::ref<cvf::Part> part = new cvf::Part;
part->setName( "RivElementVectorResultPartMgr::createPart" );
part->setDrawable( drawable.p() );
part->setEffect( effect.p() );

View File

@ -801,6 +801,7 @@ void RivPipeGeometryGenerator::cylinderWithCenterLineParts( cvf::Collection<cvf:
if ( surfaceGeo.notNull() )
{
cvf::Part* part = new cvf::Part;
part->setName( "RivPipeGeometryGenerator::surface" );
part->setDrawable( surfaceGeo.p() );
caf::SurfaceEffectGenerator surfaceGen( cvf::Color4f( color ), caf::PO_1 );
@ -815,6 +816,7 @@ void RivPipeGeometryGenerator::cylinderWithCenterLineParts( cvf::Collection<cvf:
if ( centerLineGeo.notNull() )
{
cvf::Part* part = new cvf::Part;
part->setName( "RivPipeGeometryGenerator::centerLineGeo" );
part->setDrawable( centerLineGeo.p() );
caf::SurfaceEffectGenerator surfaceGen( cvf::Color4f( color ), caf::PO_1 );
@ -844,6 +846,7 @@ void RivPipeGeometryGenerator::tubeWithCenterLinePartsAndVariableWidth( cvf::Col
if ( surfaceGeo.notNull() )
{
cvf::Part* part = new cvf::Part;
part->setName( "tubeWithCenterLinePartsAndVariableWidth::surface" );
part->setDrawable( surfaceGeo.p() );
caf::SurfaceEffectGenerator surfaceGen( cvf::Color4f( color ), caf::PO_1 );
@ -858,6 +861,7 @@ void RivPipeGeometryGenerator::tubeWithCenterLinePartsAndVariableWidth( cvf::Col
if ( centerLineGeo.notNull() )
{
cvf::Part* part = new cvf::Part;
part->setName( "tubeWithCenterLinePartsAndVariableWidth::centerLineGeo" );
part->setDrawable( centerLineGeo.p() );
caf::SurfaceEffectGenerator surfaceGen( cvf::Color4f( color ), caf::PO_1 );

View File

@ -82,6 +82,7 @@ void RivReachCircleAnnotationPartMgr::buildParts( const caf::DisplayCoordTransfo
cvf::ref<cvf::DrawableGeo> drawableGeo = RivPolylineGenerator::createLineAlongPolylineDrawable( points );
cvf::ref<cvf::Part> part = new cvf::Part;
part->setName( "RivReachCircleAnnotationPartMgr" );
part->setDrawable( drawableGeo.p() );
caf::MeshEffectGenerator effgen( lineColor );
@ -111,6 +112,7 @@ void RivReachCircleAnnotationPartMgr::buildParts( const caf::DisplayCoordTransfo
cvf::ref<cvf::DrawableGeo> drawableGeo = RivPolylineGenerator::createLineAlongPolylineDrawable( symbol );
cvf::ref<cvf::Part> part = new cvf::Part;
part->setName( "RivReachCircleAnnotationPartMgr" );
part->setDrawable( drawableGeo.p() );
caf::MeshEffectGenerator effgen( lineColor );

View File

@ -373,6 +373,7 @@ cvf::ref<cvf::Part> RivTensorResultPartMgr::createPart( const std::vector<Tensor
drawable->setTextureCoordArray( lineTexCoords.p() );
cvf::ref<cvf::Part> part = new cvf::Part;
part->setName( "RivTensorResultPartMgr" );
part->setDrawable( drawable.p() );
part->setEffect( scalarMapperMeshEffect.p() );

View File

@ -103,6 +103,7 @@ void RivTextAnnotationPartMgr::buildParts( const caf::DisplayCoordTransform* dis
cvf::ref<cvf::DrawableGeo> drawableGeo = RivPolylineGenerator::createLineAlongPolylineDrawable( points );
cvf::ref<cvf::Part> part = new cvf::Part;
part->setName( "RivTextAnnotationPartMgr" );
part->setDrawable( drawableGeo.p() );
caf::MeshEffectGenerator colorEffgen( anchorLineColor );

View File

@ -57,6 +57,7 @@ cvf::ref<cvf::Part> RivWellConnectionFactorGeometryGenerator::createSurfacePart(
if ( drawable.notNull() )
{
cvf::ref<cvf::Part> part = new cvf::Part;
part->setName( "RivWellConnectionFactorGeometryGenerator" );
part->setDrawable( drawable.p() );
// Compute texture coords

View File

@ -238,8 +238,10 @@ cvf::ref<cvf::Part> RivWellConnectionsPartMgr::createArrowPart( const cvf::Vec3f
const cvf::Color4f& arrowColor,
bool enableLighting )
{
cvf::ref<cvf::Part> part = new cvf::Part;
cvf::ref<cvf::DrawableGeo> geo = createArrowGeometry( startPoint, endPoint, width, isProducer );
cvf::ref<cvf::Part> part = new cvf::Part;
part->setName( "RivWellConnectionsPartMgr::createArrowPart" );
cvf::ref<cvf::DrawableGeo> geo = createArrowGeometry( startPoint, endPoint, width, isProducer );
part->setDrawable( geo.p() );
caf::SurfaceEffectGenerator surfaceGen( arrowColor, caf::PO_1 );

View File

@ -697,6 +697,7 @@ void RivWellPathPartMgr::buildWellPathParts( const caf::DisplayCoordTransform* d
if ( m_surfaceDrawable.notNull() )
{
m_surfacePart = new cvf::Part;
m_surfacePart->setName( "RivWellPathPartMgr::surface" );
m_surfacePart->setDrawable( m_surfaceDrawable.p() );
RivWellPathSourceInfo* sourceInfo = new RivWellPathSourceInfo( m_rimWellPath, m_pipeGeomGenerator.p() );
@ -711,6 +712,7 @@ void RivWellPathPartMgr::buildWellPathParts( const caf::DisplayCoordTransform* d
if ( m_centerLineDrawable.notNull() )
{
m_centerLinePart = new cvf::Part;
m_centerLinePart->setName( "RivWellPathPartMgr::centerLinePart" );
m_centerLinePart->setDrawable( m_centerLineDrawable.p() );
caf::MeshEffectGenerator gen( m_rimWellPath->wellPathColor() );

View File

@ -167,6 +167,8 @@ cvf::ref<cvf::Part> RivWellSpheresPartMgr::createPart( std::vector<std::pair<cvf
vectorDrawable->setGlyph( builder.trianglesUShort().p(), builder.vertices().p() );
cvf::ref<cvf::Part> part = new cvf::Part;
part->setName( "RivWellSpheresPartMgr" );
part->setDrawable( vectorDrawable.p() );
cvf::ref<cvf::Effect> eff = new cvf::Effect;

View File

@ -218,6 +218,8 @@ cvf::ref<cvf::Part> RivStreamlinesPartMgr::createPart( const RimStreamlineInView
drawable->setTextureCoordArray( lineTexCoords.p() );
cvf::ref<cvf::Part> part = new cvf::Part;
part->setName( "RivStreamlinesPartMgr" );
part->setDrawable( drawable.p() );
part->setEffect( effect.p() );
part->updateBoundingBox();