mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4683 Fix line endings and execute clang-format
This commit is contained in:
@@ -3,17 +3,17 @@
|
||||
// Copyright (C) 2011- Statoil ASA
|
||||
// Copyright (C) 2013- Ceetron Solutions AS
|
||||
// Copyright (C) 2011-2012 Ceetron AS
|
||||
//
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -24,8 +24,6 @@
|
||||
|
||||
class RivTernaryScalarMapper;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Thoughts on organizing the texture coords generation a bit.
|
||||
|
||||
@@ -38,8 +36,8 @@ class RivTernaryScalarMapper;
|
||||
When evaluating, we normally use the geometry as starting point, as that often is
|
||||
a subset of the total results/geometry domain.
|
||||
|
||||
To make this efficient, a minimum of internal storage should be used, so we want
|
||||
to make the mappings as a set of functions called for each (or a few) texture
|
||||
To make this efficient, a minimum of internal storage should be used, so we want
|
||||
to make the mappings as a set of functions called for each (or a few) texture
|
||||
coordinate positions
|
||||
|
||||
The mapping is then actually accessed in the opposite way of the above, while calculated in the 1-3 order
|
||||
@@ -50,22 +48,23 @@ class RivTernaryScalarMapper;
|
||||
ResultValue->ResultPointValue->GeometryPointValue->Texture/ColorValue
|
||||
|
||||
In ResInsight (for now)
|
||||
the ResultPointValue will be the same for all the corresponding GeometryPoints,
|
||||
the ResultPointValue will be the same for all the corresponding GeometryPoints,
|
||||
which means each quadvertex has the same texcoord for all corners.
|
||||
|
||||
|
||||
|
||||
Proposal:
|
||||
----------
|
||||
Let the FaceValue to Face vertex texture coordinate mapping be the same for all.
|
||||
Extract that from the code floating around.
|
||||
|
||||
Create a PrimitiveFaceIdx to CellIdx with Face mapper class that handles the lookup,
|
||||
Create a PrimitiveFaceIdx to CellIdx with Face mapper class that handles the lookup,
|
||||
created by the geometry generation
|
||||
|
||||
Create separate calculators/mappers/Strategies to create FaceValues from results.
|
||||
|
||||
Test Code
|
||||
-----------
|
||||
// Example code
|
||||
// Example code
|
||||
// 1. CellCenterToCellFace
|
||||
// 2. CellFace to Quad Corners
|
||||
// 3. Quad Corner Values to tex coords
|
||||
@@ -80,11 +79,12 @@ class RivTernaryScalarMapper;
|
||||
texCoords[i*4 + 2] = texCoord;
|
||||
texCoords[i*4 + 3] = texCoord;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Texturing needs in ResInsight:
|
||||
* ScalarMapper
|
||||
* Handle HugeVal/nan
|
||||
* PipeCellTransparency
|
||||
* PipeCellTransparency
|
||||
- includes geometry point to cell mapping
|
||||
* Modify the Scalarmapper Texture
|
||||
* The domain values to convert pr geometry point
|
||||
@@ -101,23 +101,38 @@ class RivTernaryScalarMapper;
|
||||
class CellEdgeEffectGenerator : public caf::EffectGenerator
|
||||
{
|
||||
public:
|
||||
explicit CellEdgeEffectGenerator(const cvf::ScalarMapper* edgeScalarMapper);
|
||||
explicit CellEdgeEffectGenerator( const cvf::ScalarMapper* edgeScalarMapper );
|
||||
|
||||
void setScalarMapper(const cvf::ScalarMapper* cellScalarMapper);
|
||||
void setTernaryScalarMapper(const RivTernaryScalarMapper* ternaryScalarMapper);
|
||||
void setScalarMapper( const cvf::ScalarMapper* cellScalarMapper );
|
||||
void setTernaryScalarMapper( const RivTernaryScalarMapper* ternaryScalarMapper );
|
||||
|
||||
void setOpacityLevel(float opacity) { m_opacityLevel = cvf::Math::clamp(opacity, 0.0f , 1.0f ); }
|
||||
void setUndefinedColor(cvf::Color3f color) { m_undefinedColor = color; }
|
||||
void setFaceCulling(caf::FaceCulling faceCulling) { m_cullBackfaces = faceCulling; }
|
||||
void setDefaultCellColor(cvf::Color3f color) { m_defaultCellColor = color; }
|
||||
void disableLighting(bool disable) { m_disableLighting = disable; }
|
||||
void setOpacityLevel( float opacity )
|
||||
{
|
||||
m_opacityLevel = cvf::Math::clamp( opacity, 0.0f, 1.0f );
|
||||
}
|
||||
void setUndefinedColor( cvf::Color3f color )
|
||||
{
|
||||
m_undefinedColor = color;
|
||||
}
|
||||
void setFaceCulling( caf::FaceCulling faceCulling )
|
||||
{
|
||||
m_cullBackfaces = faceCulling;
|
||||
}
|
||||
void setDefaultCellColor( cvf::Color3f color )
|
||||
{
|
||||
m_defaultCellColor = color;
|
||||
}
|
||||
void disableLighting( bool disable )
|
||||
{
|
||||
m_disableLighting = disable;
|
||||
}
|
||||
|
||||
protected:
|
||||
bool isEqual( const EffectGenerator* other ) const override;
|
||||
EffectGenerator* copy() const override;
|
||||
bool isEqual( const EffectGenerator* other ) const override;
|
||||
EffectGenerator* copy() const override;
|
||||
|
||||
void updateForShaderBasedRendering(cvf::Effect* effect) const override;
|
||||
void updateForFixedFunctionRendering(cvf::Effect* effect) const override;
|
||||
void updateForShaderBasedRendering( cvf::Effect* effect ) const override;
|
||||
void updateForFixedFunctionRendering( cvf::Effect* effect ) const override;
|
||||
|
||||
private:
|
||||
cvf::cref<cvf::ScalarMapper> m_edgeScalarMapper;
|
||||
@@ -125,12 +140,11 @@ private:
|
||||
cvf::cref<cvf::ScalarMapper> m_cellScalarMapper;
|
||||
mutable cvf::ref<cvf::TextureImage> m_cellTextureImage;
|
||||
|
||||
cvf::cref<RivTernaryScalarMapper> m_ternaryCellScalarMapper;
|
||||
cvf::cref<RivTernaryScalarMapper> m_ternaryCellScalarMapper;
|
||||
|
||||
float m_opacityLevel;
|
||||
caf::FaceCulling m_cullBackfaces;
|
||||
cvf::Color3f m_undefinedColor;
|
||||
cvf::Color3f m_defaultCellColor;
|
||||
bool m_disableLighting;
|
||||
float m_opacityLevel;
|
||||
caf::FaceCulling m_cullBackfaces;
|
||||
cvf::Color3f m_undefinedColor;
|
||||
cvf::Color3f m_defaultCellColor;
|
||||
bool m_disableLighting;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user