mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#678) Show context menu commands on intersection
Added hide intersection
This commit is contained in:
@@ -18,21 +18,26 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RivCrossSectionGeometryGenerator.h"
|
||||
#include "cvfBoundingBox.h"
|
||||
|
||||
#include "RigMainGrid.h"
|
||||
#include "cvfDrawableGeo.h"
|
||||
#include "RigResultAccessor.h"
|
||||
#include "cvfScalarMapper.h"
|
||||
|
||||
#include "RimCrossSection.h"
|
||||
|
||||
#include "cvfDrawableGeo.h"
|
||||
#include "cvfPrimitiveSetDirect.h"
|
||||
#include "cvfScalarMapper.h"
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivCrossSectionGeometryGenerator::RivCrossSectionGeometryGenerator(const std::vector<std::vector<cvf::Vec3d> > &polylines,
|
||||
const cvf::Vec3d& extrusionDirection,
|
||||
const RivCrossSectionHexGridIntf* grid)
|
||||
: m_polyLines(polylines),
|
||||
RivCrossSectionGeometryGenerator::RivCrossSectionGeometryGenerator(const RimCrossSection* crossSection,
|
||||
std::vector<std::vector<cvf::Vec3d> > &polylines,
|
||||
const cvf::Vec3d& extrusionDirection,
|
||||
const RivCrossSectionHexGridIntf* grid)
|
||||
: m_crossSection(crossSection),
|
||||
m_polyLines(polylines),
|
||||
m_extrusionDirection(extrusionDirection),
|
||||
m_hexGrid(grid)
|
||||
{
|
||||
@@ -1185,6 +1190,13 @@ const std::vector<RivVertexWeights>& RivCrossSectionGeometryGenerator::triangleV
|
||||
return m_triVxToCellCornerWeights;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RimCrossSection* RivCrossSectionGeometryGenerator::crossSection() const
|
||||
{
|
||||
return m_crossSection;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
|
||||
@@ -18,15 +18,20 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
#include "cvfArray.h"
|
||||
#include "cvfBase.h"
|
||||
#include "cvfBoundingBox.h"
|
||||
#include "cvfObject.h"
|
||||
#include "cvfVector3.h"
|
||||
#include "cvfArray.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
class RigMainGrid;
|
||||
class RigResultAccessor;
|
||||
class RimCrossSection;
|
||||
|
||||
namespace cvf
|
||||
{
|
||||
@@ -34,7 +39,6 @@ namespace cvf
|
||||
class DrawableGeo;
|
||||
}
|
||||
|
||||
#include "cvfBoundingBox.h"
|
||||
|
||||
|
||||
class RivCrossSectionHexGridIntf : public cvf::Object
|
||||
@@ -124,7 +128,8 @@ private:
|
||||
class RivCrossSectionGeometryGenerator : public cvf::Object
|
||||
{
|
||||
public:
|
||||
RivCrossSectionGeometryGenerator(const std::vector<std::vector<cvf::Vec3d> > &polylines,
|
||||
RivCrossSectionGeometryGenerator(const RimCrossSection* crossSection,
|
||||
std::vector<std::vector<cvf::Vec3d> > &polylines,
|
||||
const cvf::Vec3d& extrusionDirection,
|
||||
const RivCrossSectionHexGridIntf* grid );
|
||||
|
||||
@@ -138,6 +143,8 @@ public:
|
||||
const std::vector<size_t>& triangleToCellIndex() const;
|
||||
const std::vector<RivVertexWeights>& triangleVxToCellCornerInterpolationWeights() const;
|
||||
|
||||
const RimCrossSection* crossSection() const;
|
||||
|
||||
private:
|
||||
void calculateArrays();
|
||||
static void adjustPolyline(const std::vector<cvf::Vec3d>& polyLine,
|
||||
@@ -153,5 +160,7 @@ private:
|
||||
cvf::ref<cvf::Vec3fArray> m_cellBorderLineVxes;
|
||||
std::vector<size_t> m_triangleToCellIdxMap;
|
||||
std::vector<RivVertexWeights> m_triVxToCellCornerWeights;
|
||||
|
||||
const RimCrossSection* m_crossSection;
|
||||
};
|
||||
|
||||
|
||||
@@ -417,7 +417,7 @@ void RivCrossSectionPartMgr::computeData()
|
||||
{
|
||||
cvf::Vec3d direction = extrusionDirection(polyLines[0]);
|
||||
cvf::ref<RivCrossSectionHexGridIntf> hexGrid = createHexGridInterface();
|
||||
m_crossSectionGenerator = new RivCrossSectionGeometryGenerator(polyLines, direction, hexGrid.p());
|
||||
m_crossSectionGenerator = new RivCrossSectionGeometryGenerator(m_rimCrossSection, polyLines, direction, hexGrid.p());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,3 +40,11 @@ const std::vector<size_t>& RivCrossSectionSourceInfo::triangleToCellIndex() cons
|
||||
|
||||
return m_crossSectionGeometryGenerator->triangleToCellIndex();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RimCrossSection* RivCrossSectionSourceInfo::crossSection() const
|
||||
{
|
||||
return m_crossSectionGeometryGenerator->crossSection();
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "cvfArray.h"
|
||||
|
||||
class RivCrossSectionGeometryGenerator;
|
||||
class RimCrossSection;
|
||||
|
||||
class RivCrossSectionSourceInfo : public cvf::Object
|
||||
{
|
||||
@@ -32,6 +33,8 @@ public:
|
||||
|
||||
const std::vector<size_t>& triangleToCellIndex() const;
|
||||
|
||||
const RimCrossSection* crossSection() const;
|
||||
|
||||
private:
|
||||
cvf::cref<RivCrossSectionGeometryGenerator> m_crossSectionGeometryGenerator;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user