mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
3D Well Log Curves (#2674): Show what the value axis direction is
This commit is contained in:
@@ -991,4 +991,58 @@ void TextEffectGenerator::updateForFixedFunctionRendering(cvf::Effect* effect) c
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
VectorEffectGenerator::VectorEffectGenerator()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool VectorEffectGenerator::isEqual(const EffectGenerator* other) const
|
||||
{
|
||||
const VectorEffectGenerator* otherSurfaceEffect = dynamic_cast<const VectorEffectGenerator*>(other);
|
||||
if (otherSurfaceEffect)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
EffectGenerator* VectorEffectGenerator::copy() const
|
||||
{
|
||||
VectorEffectGenerator* effGen = new VectorEffectGenerator;
|
||||
|
||||
return effGen;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void VectorEffectGenerator::updateForShaderBasedRendering(cvf::Effect* effect) const
|
||||
{
|
||||
cvf::ShaderProgramGenerator gen("VectorDrawerShaderProgram", cvf::ShaderSourceProvider::instance());
|
||||
gen.addVertexCode(cvf::ShaderSourceRepository::vs_VectorDrawer);
|
||||
gen.addFragmentCode(cvf::ShaderSourceRepository::fs_VectorDrawer);
|
||||
|
||||
cvf::ref<cvf::ShaderProgram> shaderProg = gen.generate();
|
||||
shaderProg->disableUniformTrackingForUniform("u_transformationMatrix");
|
||||
shaderProg->disableUniformTrackingForUniform("u_color");
|
||||
|
||||
cvf::ref<cvf::Effect> eff = effect;
|
||||
eff->setShaderProgram(shaderProg.p());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void VectorEffectGenerator::updateForFixedFunctionRendering(cvf::Effect* effect) const {}
|
||||
|
||||
} // End namespace caf
|
||||
|
||||
@@ -276,4 +276,21 @@ protected:
|
||||
};
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
// VectorEffectGenerator
|
||||
//
|
||||
//==================================================================================================
|
||||
class VectorEffectGenerator : public EffectGenerator
|
||||
{
|
||||
public:
|
||||
VectorEffectGenerator();
|
||||
|
||||
protected:
|
||||
virtual bool isEqual(const EffectGenerator* other) const;
|
||||
virtual EffectGenerator* copy() const;
|
||||
|
||||
virtual void updateForShaderBasedRendering(cvf::Effect* effect) const;
|
||||
virtual void updateForFixedFunctionRendering(cvf::Effect* effect) const;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -125,6 +125,12 @@ void DrawableVectors::setSingleColor(Color3f color)
|
||||
}
|
||||
|
||||
|
||||
void DrawableVectors::setUniformNames(String vectorMatrixUniformName, String colorUniformName)
|
||||
{
|
||||
m_vectorMatrixUniformName = vectorMatrixUniformName;
|
||||
m_colorUniformName = colorUniformName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -63,6 +63,7 @@ public:
|
||||
void setGlyph(UShortArray* triangles, Vec3fArray* vertices);
|
||||
void setSingleColor(Color3f color);
|
||||
|
||||
void setUniformNames(String vectorMatrixUniformName, String colorUniformName);
|
||||
void setVectors(Vec3fArray* vertexArray, Vec3fArray* vectorArray);
|
||||
void setColors(Color3fArray* vectorColorArray);
|
||||
size_t vectorCount() const;
|
||||
|
||||
Reference in New Issue
Block a user