You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The z-value for the textured quad is computed as z = originZ + 0.3 * originZ, which scales with originZ and might be behind/above unintended geometry or vary per dataset. Consider a fixed offset in display space or deriving from grid thickness; verify ordering with other parts and transparency sorting.
double zValueForContourMap = contourMapGrid.origin3d().z();
zValueForContourMap += 0.3 * zValueForContourMap;
cvf::Vec3dArray displayCoords;
displayCoords.reserve( 4 );
for ( int i = 0; i < 4; i++ )
{
auto displayCoord = displayCoordTransform->transformToDisplayCoord( domainCoords[i] );
displayCoord.z() = zValueForContourMap;
displayCoords.add( displayCoord );
Textured rendering uses blending and marks the part as TransparentSeismic while also setting local 'transparent' flag always true. Verify alpha semantics in texture generation (infinite -> alpha 0) and ensure correct depth write/state to avoid halo/sorting artifacts; consider enabling/disabling depth writes or using pre-multiplied alpha consistently.
Both textured image and triangle rendering can be enabled simultaneously; confirm intended combined output and performance impact. If mutually exclusive is desired, enforce UI or logic to avoid duplicating the same data render.
Guard against out-of-range indices and non-finite values to prevent memory access and NaN color mapping issues. Skip or clamp invalid indices and treat non-finite values as fully transparent.
auto dataValues = contourMapProjection->aggregatedVertexResultsFiltered();
+const size_t valueCount = dataValues.size();
for ( int y = 0; y < height; ++y )
{
for ( int x = 0; x < width; ++x )
{
- size_t index = contourMapProjection->vertexIndex( x, y );-- double valueAtVertex = dataValues[index];- auto color = scalarMapper->mapToColor( valueAtVertex );-- int transparency = 0;- if ( valueAtVertex != std::numeric_limits<double>::infinity() )+ const size_t index = contourMapProjection->vertexIndex( x, y );+ if ( index >= valueCount )
{
- transparency = 255;+ textureImage->setPixel( x, y, cvf::Color4ub( 0, 0, 0, 0 ) );+ continue;
}
- textureImage->setPixel( x, y, cvf::Color4ub( color, transparency ) );+ const double valueAtVertex = dataValues[index];+ if ( !std::isfinite( valueAtVertex ) )+ {+ textureImage->setPixel( x, y, cvf::Color4ub( 0, 0, 0, 0 ) );+ continue;+ }++ const auto color = scalarMapper->mapToColor( valueAtVertex );+ textureImage->setPixel( x, y, cvf::Color4ub( color, 255 ) );
}
}
Apply / Chat
Suggestion importance[1-10]: 8
__
Why: The suggestion correctly points out that the existing code does not check for out-of-bounds access on dataValues or handle non-finite values, which could lead to crashes or undefined behavior.
Medium
Use stable Z offset
Avoid scaling Z by itself; if Z is near zero this collapses the offset, and if negative it may move the quad in the wrong direction. Use a fixed positive offset relative to grid thickness or a small epsilon to ensure consistent layering above the surface.
Why: The suggestion correctly identifies that scaling the z-offset by zValueForContourMap can lead to issues if the value is zero or negative, and proposes a more robust method to ensure a consistent positive offset.
Medium
General
Improve texture filtering
Enable proper minification filtering with mipmaps to avoid aliasing and shimmering when the quad is viewed at a distance. Generate mipmaps on the texture and use trilinear filtering for better visual quality.
Why: The suggestion correctly proposes using mipmapping to improve texture rendering quality and avoid aliasing, which is a good practice for visual fidelity, though not a critical bug fix.
Low
Add terminating newline
Ensure there is a terminating newline at the end of the file to comply with common tooling and POSIX expectations. This avoids diff noise and issues with license scanners.
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.+===============================================================================+ Notice for surfio+===============================================================================
Apply / Chat
Suggestion importance[1-10]: 2
__
Why: The suggestion to add a terminating newline is a valid convention, but its impact is minor, and the provided code snippets are incorrect and do not reflect the proposed change at the end of the file.
Low
More
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Type
Enhancement, Other
Description
Add texture-based rendering for contour maps
Migrate obsolete color fields to main color
Update version to 2025.09.0-RC_1
Add surfio license information
Diagram Walkthrough
File Walkthrough
6 files
Add texture-based quad rendering for contour mapsAdd UI controls for texture and triangle renderingImplement conditional rendering based on display optionsRemove underscores from ensemble short namesAdd texture rendering method declarationsAdd texture and triangle display option fields3 files
Migrate obsolete color field to main colorSet default filter mode for older projectsAdd obsolete color field for migration2 files
Update version to 2025.09.0-RC_1Add project file keywords for version 2025.091 files
Add MIT license information for surfio4 files