ElementHighlighter.h
1 //##################################################################################################
2 //
3 // Ceetron Desktop Components
4 // Component: UnstructGrid
5 //
6 // --------------------------------------------------------------------------------------------
7 // Copyright (C) 2014, Ceetron AS
8 // This is UNPUBLISHED PROPRIETARY SOURCE CODE of Ceetron AS. The contents of this file may
9 // not be disclosed to third parties, copied or duplicated in any form, in whole or in part,
10 // without the prior written permission of Ceetron AS.
11 //##################################################################################################
12 
13 #pragma once
14 
15 #include "CeeUnstructGrid/Base.h"
16 #include "CeeCore/Vec3d.h"
17 #include "CeeCore/Color3f.h"
18 
19 #include "CeeVisualization/MarkupPartLabels.h"
20 
21 #include <vector>
22 
23 namespace cee {
24 
25 namespace vis { class MarkupModel; }
26 
27 namespace ug {
28 class UnstructGridModel;
29 class HitItem;
30 class DataElements;
31 class DataNodes;
32 
33 //==================================================================================================
34 //
35 //
36 //
37 //==================================================================================================
38 class CEE_UG_EXPORT ElementHighlighter
39 {
40 public:
41  ElementHighlighter(const UnstructGridModel* model, vis::MarkupModel* markupModel);
43 
44  void addElementHighlight(const HitItem& item, const Color3f& surfaceColor);
45  void addElementHighlight(const HitItem& item, const Color3f& surfaceColor, const Color3f& lineColor);
46  void addElementLabel(const HitItem& item, vis::MarkupPartLabels::LabelDrawMode labelDrawMode = vis::MarkupPartLabels::DRAW_WITHOUT_ZBUFFER_TEST, cee::vis::Font* font = NULL);
47  void addElementNodeLabels(const HitItem& item, vis::MarkupPartLabels::LabelDrawMode labelDrawMode = vis::MarkupPartLabels::DRAW_WITHOUT_ZBUFFER_TEST, cee::vis::Font* font = NULL);
48 
49  void addElementSurfaceHighlight(const HitItem& item, const Color3f& surfaceColor);
50  void addElementSurfaceHighlight(const HitItem& item, const Color3f& surfaceColor, const Color3f& lineColor);
51  void addElementSurfaceLabel(const HitItem& item, vis::MarkupPartLabels::LabelDrawMode labelDrawMode, cee::vis::Font* font);
52  void addElementSurfaceNodeLabels(const HitItem& item, vis::MarkupPartLabels::LabelDrawMode labelDrawMode, cee::vis::Font* font);
53 
54 
55  Vec3d elementLabelPosition(const HitItem& item) const;
56  const ug::DataElements* elementsFromHitItem(const HitItem& item) const;
57  const ug::DataNodes* nodesFromHitItem(const HitItem& item) const;
58 
59 private:
60  CEE_PRIVATE_IMPL(ElementHighlighter);
61  CEE_DISALLOW_COPY_AND_ASSIGN(ElementHighlighter);
62 };
63 
64 } // namespace ug
65 } // namespace cee
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppComponent.cpp:26
Model used for drawing labels, arrows, lines, points, triangles and glyphs.
Definition: MarkupModel.h:31
Draw the label without z buffer test. The label will always be visible.
Definition: MarkupPartLabels.h:42
Helper class for annotating elements.
Definition: ElementHighlighter.h:38
LabelDrawMode
Enum specifying the way to draw the labels. Controls the visibility of the label. ...
Definition: MarkupPartLabels.h:38
Class for storing an RGB color triplet.
Definition: Color3f.h:25
Collection of coordinates (and optionally ids) of the element nodes in a part.
Definition: DataNodes.h:32
Vector class for a 3D double vector.
Definition: Vec3d.h:26
UnstructGridModel is a subclass of Model which adds specific model structure and functionality for re...
Definition: UnstructGridModel.h:72
Collection of elements in a part. Examples of element types are points, triangles or hexahedrons...
Definition: DataElements.h:31
A font used for text drawing.
Definition: Font.h:30
Small class containing the data for a hit of an intersection between a ray and a part in an UnstructG...
Definition: HitItem.h:26