2018-10-16 02:53:30 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2018- Equinor ASA
|
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2019-01-11 06:03:46 -06:00
|
|
|
#include "RimEclipseContourMapProjection.h"
|
2019-01-03 10:07:55 -06:00
|
|
|
|
2018-10-16 02:53:30 -05:00
|
|
|
#include "cafPdmPointer.h"
|
|
|
|
#include "cafDisplayCoordTransform.h"
|
|
|
|
|
|
|
|
#include "cvfBase.h"
|
|
|
|
#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
|
|
|
|
{
|
|
|
|
class Effect;
|
|
|
|
}
|
|
|
|
|
2018-11-09 02:04:40 -06:00
|
|
|
class RivContourMapProjectionPartMgr : public cvf::Object
|
2018-10-16 02:53:30 -05:00
|
|
|
{
|
|
|
|
public:
|
2019-01-16 03:51:43 -06:00
|
|
|
RivContourMapProjectionPartMgr(RimContourMapProjection* contourMapProjection, RimGridView* contourMap);
|
2018-10-16 02:53:30 -05:00
|
|
|
|
2019-01-03 10:07:55 -06:00
|
|
|
void createProjectionGeometry();
|
2018-10-16 02:53:30 -05:00
|
|
|
void appendProjectionToModel(cvf::ModelBasicList* model,
|
|
|
|
const caf::DisplayCoordTransform* displayCoordTransform) const;
|
2019-01-09 02:08:46 -06:00
|
|
|
void appendContourLinesToModel(const cvf::Camera* camera, cvf::ModelBasicList* model, const caf::DisplayCoordTransform* displayCoordTransform);
|
2018-11-15 14:40:10 -06:00
|
|
|
void appendPickPointVisToModel(cvf::ModelBasicList* model,
|
|
|
|
const caf::DisplayCoordTransform* displayCoordTransform) const;
|
2018-10-16 02:53:30 -05:00
|
|
|
|
2019-01-02 08:53:13 -06:00
|
|
|
cvf::ref<cvf::Vec2fArray> createTextureCoords(const std::vector<double>& values) const;
|
2018-10-16 02:53:30 -05:00
|
|
|
|
2019-01-03 10:07:55 -06:00
|
|
|
|
2018-10-16 02:53:30 -05:00
|
|
|
private:
|
2019-01-18 01:55:13 -06:00
|
|
|
static cvf::ref<cvf::DrawableText> createTextLabel(const cvf::Color3f& textColor, const cvf::Color3f& backgroundColor);
|
|
|
|
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;
|
|
|
|
cvf::ref<cvf::DrawableGeo> createPickPointVisDrawable(const caf::DisplayCoordTransform* displayCoordTransform) const;
|
|
|
|
bool lineOverlapsWithPreviousContourLevel(const cvf::Vec3d& lineCenter,
|
|
|
|
const RimContourMapProjection::ContourPolygons* previousLevel) const;
|
2019-01-17 12:27:49 -06:00
|
|
|
|
2018-10-16 02:53:30 -05:00
|
|
|
private:
|
2019-01-16 03:51:43 -06: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
|
|
|
};
|
|
|
|
|