#3876 Implement rotated labels on contour maps

This commit is contained in:
Gaute Lindkvist
2019-01-03 17:07:55 +01:00
parent 71cacc550f
commit 7a275be335
14 changed files with 593 additions and 208 deletions

View File

@@ -18,6 +18,8 @@
#pragma once
#include "RimContourMapProjection.h"
#include "cafPdmPointer.h"
#include "cafDisplayCoordTransform.h"
@@ -26,29 +28,37 @@
#include "cvfDrawableText.h"
#include "cvfModelBasicList.h"
#include "cvfObject.h"
#include "cvfVector4.h"
class RimContourMapView;
class RimContourMapProjection;
class RivContourMapProjectionPartMgr : public cvf::Object
{
public:
RivContourMapProjectionPartMgr(RimContourMapProjection* contourMapProjection, RimContourMapView* contourMap);
void createProjectionGeometry();
void appendProjectionToModel(cvf::ModelBasicList* model,
const caf::DisplayCoordTransform* displayCoordTransform) const;
void appendContourLinesToModel(const cvf::Camera* camera, cvf::ModelBasicList* model, const caf::DisplayCoordTransform* displayCoordTransform) const;
void appendPickPointVisToModel(cvf::ModelBasicList* model,
const caf::DisplayCoordTransform* displayCoordTransform) const;
cvf::ref<cvf::Vec2fArray> createTextureCoords(const std::vector<double>& values) const;
private:
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::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;
private:
caf::PdmPointer<RimContourMapProjection> m_contourMapProjection;
caf::PdmPointer<RimContourMapView> m_parentContourMap;
std::vector<RimContourMapProjection::ContourPolygons> m_contourLinePolygons;
std::vector<cvf::Vec4d> m_contourMapTriangles;
std::vector<std::vector<cvf::BoundingBox>> m_labelBoundingBoxes;
};