Model.h
1 //##################################################################################################
2 //
3 // Ceetron Desktop Components
4 // Component: Visualization
5 //
6 // --------------------------------------------------------------------------------------------
7 // Copyright (C) 2011, 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 "CeeVisualization/Base.h"
16 #include "CeeVisualization/Camera.h"
17 #include "CeeCore/RefCountedObject.h"
18 #include "CeeCore/BoundingBox.h"
19 #include "CeeCore/Str.h"
20 
21 #include <vector>
22 
23 namespace cvf {
24 class Model;
25 class OpenGLCapabilities;
26 class ClipPlaneSet;
27 class Plane;
28 class OpenGLContext;
29 class Camera;
30 }
31 
32 namespace cee {
33 namespace vis {
34 
35 class OverlayItem;
36 class View;
37 
38 //==================================================================================================
39 //
40 //
41 //
42 //==================================================================================================
43 class CEE_VIS_EXPORT Model : public RefCountedObject
44 {
45 public:
46  Model();
47  virtual ~Model();
48 
49  Str name() const;
50  void setName(const Str& name);
51 
52  bool use2dPixelProjection() const;
53  void setUse2dPixelProjection(bool use2dMode);
54 
55  virtual BoundingBox boundingBox() = 0;
56  virtual Str modelInfo() const;
57 
58 protected:
60  {
62  MODEL_CHANGED
63  };
64 
65  void notifyObservingViews(NotifyAction notifyAction, const View* exceptView);
66  bool hasAnyObservingViewsWithClipping(bool* outExplicitViewClippingIsActive = NULL, bool* outDropShadowClippingIsActive = NULL) const;
67 
68 private:
69  void internal_addView(View* view);
70  void internal_removeView(View* view);
71  virtual cvf::Model* internal_cvfModel() = 0;
72  virtual cvf::Model* internal_cvfModelForOverlayParts();
73  virtual cvf::Model* internal_cvfModelForOverlayDetectVisibleParts();
74  virtual std::vector<OverlayItem*> internal_overlayItems();
75  virtual void internal_setViewCapabilities(const cvf::OpenGLCapabilities& capabilities, bool viewDoesHighlighting);
76  virtual bool internal_canAddToViewWithCapabilities(const cvf::OpenGLCapabilities& viewCapabilities) const;
77  virtual NotifyAction internal_detectAndConfigureViewClippingInModel(const View& triggeringView, cvf::OpenGLContext* cvfContext) = 0;
78  virtual void internal_applyViewClippingPlanesBeforeRendering(const cvf::ClipPlaneSet* viewClipPlaneSet, const cvf::Plane* dropShadowClipPlane) = 0;
79  virtual void internal_applyCameraTransformationToClippingPlanes(const cvf::Camera& camera) = 0;
80  virtual NotifyAction internal_preRenderUpdateModel(const View& triggeringView, cvf::OpenGLContext* cvfContext);
81 
82 private:
83  CEE_BASE_F(View);
84  CEE_PRIVATE_F(View);
85  CEE_PRIVATE_F(Overlay);
86  CEE_PRIVATE_IMPL(Model);
87  CEE_DISALLOW_COPY_AND_ASSIGN(Model);
88 };
89 
90 } // namespace vis
91 } // namespace cee
Definition: LogEvent.h:19
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppComponent.cpp:26
A general unicode based string class.
Definition: Str.h:28
Model holds information which is to be gathered to constitute a view.
Definition: Model.h:43
Base class for all reference counted objects with built-in support for intrusive reference counting...
Definition: RefCountedObject.h:34
Axis-aligned bounding box.
Definition: BoundingBox.h:27
Provides a render area in the user control/widget to enable visualization of the current model data a...
Definition: View.h:40
NotifyAction
Notification sent to the view.
Definition: Model.h:59
No update needed. The viewer are not update.
Definition: Model.h:61
Overlay items are visual item presented overlaying the models in the View, for instance a color legen...
Definition: Overlay.h:28