mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-06 06:03:23 -06:00
#2544 Well CF Visualization: Add support for no lighting
This commit is contained in:
parent
f55d029256
commit
eb6b7450eb
@ -144,7 +144,9 @@ void RivVirtualConnFactorPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBa
|
|||||||
|
|
||||||
auto scalarMapper = m_virtualPerforationResult->legendConfig()->scalarMapper();
|
auto scalarMapper = m_virtualPerforationResult->legendConfig()->scalarMapper();
|
||||||
|
|
||||||
cvf::ref<cvf::Part> part = RivVirtualConnFactorPartMgr::createPart(centerColorPairs, radius, scalarMapper);
|
bool disableLighting = eclView->isLightingDisabled();
|
||||||
|
cvf::ref<cvf::Part> part =
|
||||||
|
RivVirtualConnFactorPartMgr::createPart(centerColorPairs, radius, scalarMapper, disableLighting);
|
||||||
|
|
||||||
model->addPart(part.p());
|
model->addPart(part.p());
|
||||||
}
|
}
|
||||||
@ -155,7 +157,8 @@ void RivVirtualConnFactorPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBa
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
cvf::ref<cvf::Part> RivVirtualConnFactorPartMgr::createPart(std::vector<CompletionVizData>& vizDataItems,
|
cvf::ref<cvf::Part> RivVirtualConnFactorPartMgr::createPart(std::vector<CompletionVizData>& vizDataItems,
|
||||||
double radius,
|
double radius,
|
||||||
cvf::ScalarMapper* scalarMapper)
|
cvf::ScalarMapper* scalarMapper,
|
||||||
|
bool disableLighting)
|
||||||
{
|
{
|
||||||
std::vector<cvf::Vec3f> verticesForOneObject;
|
std::vector<cvf::Vec3f> verticesForOneObject;
|
||||||
std::vector<cvf::uint> indicesForOneObject;
|
std::vector<cvf::uint> indicesForOneObject;
|
||||||
@ -215,7 +218,6 @@ cvf::ref<cvf::Part> RivVirtualConnFactorPartMgr::createPart(std::vector<Completi
|
|||||||
|
|
||||||
caf::ScalarMapperEffectGenerator effGen(scalarMapper, caf::PO_1);
|
caf::ScalarMapperEffectGenerator effGen(scalarMapper, caf::PO_1);
|
||||||
|
|
||||||
bool disableLighting = true;
|
|
||||||
effGen.disableLighting(disableLighting);
|
effGen.disableLighting(disableLighting);
|
||||||
|
|
||||||
cvf::ref<cvf::Effect> eff = effGen.generateCachedEffect();
|
cvf::ref<cvf::Effect> eff = effGen.generateCachedEffect();
|
||||||
@ -340,9 +342,9 @@ cvf::Mat4f RivVirtualConnFactorPartMgr::rotationMatrixBetweenVectors(const cvf::
|
|||||||
rotAxis.normalize();
|
rotAxis.normalize();
|
||||||
|
|
||||||
// Guard acos against out-of-domain input
|
// Guard acos against out-of-domain input
|
||||||
const double dotProduct = Math::clamp(v1*v2, -1.0, 1.0);
|
const double dotProduct = Math::clamp(v1 * v2, -1.0, 1.0);
|
||||||
const double angle = Math::acos(dotProduct);
|
const double angle = Math::acos(dotProduct);
|
||||||
Mat4d rotMat = Mat4d::fromRotation(rotAxis, angle);
|
Mat4d rotMat = Mat4d::fromRotation(rotAxis, angle);
|
||||||
|
|
||||||
Mat4f myMat(rotMat);
|
Mat4f myMat(rotMat);
|
||||||
|
|
||||||
|
@ -73,7 +73,8 @@ public:
|
|||||||
private:
|
private:
|
||||||
static cvf::ref<cvf::Part> createPart(std::vector<CompletionVizData>& centerColorPairs,
|
static cvf::ref<cvf::Part> createPart(std::vector<CompletionVizData>& centerColorPairs,
|
||||||
double radius,
|
double radius,
|
||||||
cvf::ScalarMapper* scalarMapper);
|
cvf::ScalarMapper* scalarMapper,
|
||||||
|
bool disableLighting);
|
||||||
|
|
||||||
static void createStarGeometry(std::vector<cvf::Vec3f>* vertices, std::vector<cvf::uint>* indices, double radius, double thickness);
|
static void createStarGeometry(std::vector<cvf::Vec3f>* vertices, std::vector<cvf::uint>* indices, double radius, double thickness);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user