2018-10-16 02:53:30 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2018- Equinor ASA
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2018-10-16 02:53:30 -05:00
|
|
|
// 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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2018-10-16 02:53:30 -05:00
|
|
|
// 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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2018-10-16 02:53:30 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2024-10-17 02:19:52 -05:00
|
|
|
#include "RimContourMapProjection.h"
|
2019-01-03 10:07:55 -06:00
|
|
|
|
2018-10-16 02:53:30 -05:00
|
|
|
#include "cafDisplayCoordTransform.h"
|
2019-09-06 03:40:57 -05:00
|
|
|
#include "cafPdmPointer.h"
|
2019-09-05 02:43:17 -05:00
|
|
|
|
2018-10-16 02:53:30 -05:00
|
|
|
#include "cvfDrawableGeo.h"
|
2018-12-21 01:44:30 -06:00
|
|
|
#include "cvfDrawableText.h"
|
2018-10-16 02:53:30 -05:00
|
|
|
#include "cvfModelBasicList.h"
|
|
|
|
#include "cvfObject.h"
|
2019-01-03 10:07:55 -06:00
|
|
|
#include "cvfVector4.h"
|
2018-10-16 02:53:30 -05:00
|
|
|
|
2019-01-11 06:56:35 -06:00
|
|
|
class RimEclipseContourMapView;
|
2018-10-16 02:53:30 -05:00
|
|
|
|
2019-01-09 02:08:46 -06:00
|
|
|
namespace cvf
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
class Effect;
|
2019-01-09 02:08:46 -06:00
|
|
|
}
|
|
|
|
|
2018-11-09 02:04:40 -06:00
|
|
|
class RivContourMapProjectionPartMgr : public cvf::Object
|
2018-10-16 02:53:30 -05:00
|
|
|
{
|
|
|
|
public:
|
2019-09-06 03:40:57 -05:00
|
|
|
RivContourMapProjectionPartMgr( RimContourMapProjection* contourMapProjection, RimGridView* contourMap );
|
2018-10-16 02:53:30 -05:00
|
|
|
|
2019-01-03 10:07:55 -06:00
|
|
|
void createProjectionGeometry();
|
2020-02-12 04:43:15 -06:00
|
|
|
void appendProjectionToModel( cvf::ModelBasicList* model, const caf::DisplayCoordTransform* displayCoordTransform ) const;
|
2019-09-06 03:40:57 -05:00
|
|
|
void appendContourLinesToModel( const cvf::Camera* camera,
|
|
|
|
cvf::ModelBasicList* model,
|
|
|
|
const caf::DisplayCoordTransform* displayCoordTransform );
|
2023-02-26 03:48:40 -06:00
|
|
|
void appendPickPointVisToModel( cvf::ModelBasicList* model, const caf::DisplayCoordTransform* displayCoordTransform ) const;
|
2018-10-16 02:53:30 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
cvf::ref<cvf::Vec2fArray> createTextureCoords( const std::vector<double>& values ) const;
|
2019-01-03 10:07:55 -06:00
|
|
|
|
2018-10-16 02:53:30 -05:00
|
|
|
private:
|
2020-02-12 04:43:15 -06:00
|
|
|
static cvf::ref<cvf::DrawableText> createTextLabel( const cvf::Color3f& textColor, const cvf::Color3f& backgroundColor );
|
2023-02-26 03:48:40 -06:00
|
|
|
cvf::ref<cvf::Part> createProjectionMapPart( const caf::DisplayCoordTransform* displayCoordTransform ) const;
|
|
|
|
std::vector<std::vector<cvf::ref<cvf::Drawable>>> createContourPolygons( const caf::DisplayCoordTransform* displayCoordTransform,
|
|
|
|
const std::vector<std::vector<cvf::BoundingBox>>& labelBBoxes ) const;
|
|
|
|
std::vector<cvf::ref<cvf::Drawable>> createContourLabels( const cvf::Camera* camera,
|
|
|
|
const caf::DisplayCoordTransform* displayCoordTransform,
|
|
|
|
std::vector<std::vector<cvf::BoundingBox>>* labelBBoxes ) const;
|
2019-09-06 03:40:57 -05:00
|
|
|
cvf::ref<cvf::DrawableGeo> createPickPointVisDrawable( const caf::DisplayCoordTransform* displayCoordTransform ) const;
|
2024-10-17 02:19:52 -05:00
|
|
|
static bool lineOverlapsWithPreviousContourLevel( const cvf::Vec3d& lineCenter,
|
|
|
|
const RimContourMapProjection::ContourPolygons& previousLevel,
|
|
|
|
double tolerance );
|
2019-01-17 12:27:49 -06:00
|
|
|
|
2018-10-16 02:53:30 -05:00
|
|
|
private:
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmPointer<RimContourMapProjection> m_contourMapProjection;
|
|
|
|
caf::PdmPointer<RimGridView> m_parentContourMap;
|
2019-01-03 10:07:55 -06:00
|
|
|
|
2019-01-16 03:51:43 -06:00
|
|
|
std::vector<RimContourMapProjection::ContourPolygons> m_contourLinePolygons;
|
2019-01-03 10:07:55 -06:00
|
|
|
std::vector<cvf::Vec4d> m_contourMapTriangles;
|
|
|
|
std::vector<std::vector<cvf::BoundingBox>> m_labelBoundingBoxes;
|
2019-01-09 02:08:46 -06:00
|
|
|
cvf::ref<cvf::Effect> m_labelEffect;
|
2018-10-16 02:53:30 -05:00
|
|
|
};
|