ContourMap: Add texture-based rendering as default rendering mode

Extract and clean up prototype from contour-map-01 branch:
- RivContourMapProjectionPartMgr: add appendProjectionAsTexturedQuad(),
  createSingleTexturedQuadPart(), createXYPlaneQuadGeoWithTexCoords(),
  and createTexture() — renders the map as a single GPU-textured quad
  with transparency (alpha=0) for undefined/infinity cells
- RimContourMapProjection: add m_showTextureImage (default true) and
  m_showTrianglesWithColor (default false) PDM fields; guard triangle
  mesh generation when showTrianglesWithColor() is false
- RimEclipseContourMapView, RimGeoMechContourMapView: branch
  appendContourMapProjectionToModel() to use texture or triangle path
  based on the new flags; Statistics view inherits Eclipse path

Prototype dead code (debug file save, SurfaceEffectGenerator fallback,
redundant createImage()) not carried forward.
This commit is contained in:
Magne Sjaastad committed 2026-03-12 14:40:26 +01:00
1 parent 5ea450494a
commit 87ef7a01b9
6 files changed
+250 -19

No files matched your search

@@ -32,6 +32,7 @@
#include "cvfVector4.h"
class RigContourMapGrid;
class RigContourMapProjection;
namespace cvf
{
@@ -40,6 +41,7 @@ class ScalarMapper;
class Color3f;
class ModelBasicList;
class Part;
class TextureImage;
} // namespace cvf
class RivContourMapProjectionPartMgr : public cvf::Object
@@ -70,6 +72,12 @@ public:
const cvf::Vec2d& pickPoint,
const RigContourMapGrid& contourMapGrid ) const;
void appendProjectionAsTexturedQuad( cvf::ModelBasicList* model,
const caf::DisplayCoordTransform* displayCoordTransform,
cvf::ScalarMapper* mapper,
const RigContourMapProjection& contourMapProjection,
const RigContourMapGrid& contourMapGrid );
cvf::ref<cvf::Vec2fArray> createTextureCoords( const std::vector<double>& values, cvf::ScalarMapper* scalarMapper ) const;
private:
@@ -104,9 +112,15 @@ private:
const RigContourPolygonsTools::ContourPolygons& previousLevel,
double tolerance );
cvf::ref<cvf::Part> createSingleTexturedQuadPart( const cvf::Vec3dArray& cornerPoints, cvf::ref<cvf::TextureImage> image, bool transparent );
static cvf::ref<cvf::DrawableGeo> createXYPlaneQuadGeoWithTexCoords( const cvf::Vec3dArray& cornerPoints );
static cvf::TextureImage* createTexture( const RigContourMapProjection* contourMapProjection, cvf::ScalarMapper* scalarMapper );
private:
caf::PdmPointer<caf::PdmObject> m_pdmObject;
std::vector<std::vector<cvf::BoundingBox>> m_labelBoundingBoxes;
cvf::ref<cvf::Effect> m_labelEffect;
cvf::ref<cvf::ShaderProgram> m_textureShaderProg;
};