mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-16 18:32:10 -05:00
Use polygon as data source for intersection
- Use polygon as data source for intersection - Add padlock icon - Show padlock icon on read only polygons - Add Fwk function appendMenuItems() to make it possible to define context menu content in a PdmObject - Context menu "Create Polygon Intersection" - Updates to make visualization consistent with object and object collection enabled state
This commit is contained in:
1 parent
09151ec6af
commit
28d281e1d6
45 files changed
+632
-125
No files matched your search
@@ -44,11 +44,37 @@ RigPolyLinesData::~RigPolyLinesData()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<std::vector<cvf::Vec3d>>& RigPolyLinesData::polyLines() const
|
||||
const std::vector<std::vector<cvf::Vec3d>>& RigPolyLinesData::rawPolyLines() const
|
||||
{
|
||||
return m_polylines;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Returns the polylines with the last point equal to the first point if the polyline is closed
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<std::vector<cvf::Vec3d>> RigPolyLinesData::completePolyLines() const
|
||||
{
|
||||
if ( !m_closePolyline ) return m_polylines;
|
||||
|
||||
std::vector<std::vector<cvf::Vec3d>> completeLines;
|
||||
for ( const auto& polyline : m_polylines )
|
||||
{
|
||||
auto completePolyline = polyline;
|
||||
if ( !polyline.empty() )
|
||||
{
|
||||
const double epsilon = 1e-6;
|
||||
|
||||
if ( polyline.front().pointDistance( polyline.back() ) > epsilon )
|
||||
{
|
||||
completePolyline.push_back( polyline.front() );
|
||||
}
|
||||
}
|
||||
completeLines.push_back( completePolyline );
|
||||
}
|
||||
|
||||
return completeLines;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -34,7 +34,8 @@ public:
|
||||
RigPolyLinesData();
|
||||
~RigPolyLinesData() override;
|
||||
|
||||
const std::vector<std::vector<cvf::Vec3d>>& polyLines() const;
|
||||
const std::vector<std::vector<cvf::Vec3d>>& rawPolyLines() const;
|
||||
const std::vector<std::vector<cvf::Vec3d>> completePolyLines() const;
|
||||
|
||||
void setPolyLines( const std::vector<std::vector<cvf::Vec3d>>& polyLines );
|
||||
void setPolyLine( const std::vector<cvf::Vec3d>& polyline );
|
||||
|
||||
Reference in new issue
Block a user