View.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 "CeeCore/RefCountedObject.h"
17 #include "CeeCore/BoundingBox.h"
18 #include "CeeVisualization/Background.h"
19 #include "CeeVisualization/TransparencyMode.h"
20 #include "CeeVisualization/Model.h"
21 
22 namespace cee {
23 class Image;
24 
25 namespace vis {
26 
27 class Viewer;
28 class Model;
29 class Camera;
30 class InputManager;
31 class PerformanceInfo;
32 class Overlay;
33 class Clipping;
34 
35 //==================================================================================================
36 //
37 //
38 //
39 //==================================================================================================
40 class CEE_VIS_EXPORT View : public RefCountedObject
41 {
42 public:
43  View();
44  virtual ~View();
45 
46  const Viewer* attachedViewer() const;
47  void attachToViewer(Viewer* viewer);
48  void detachFromViewer();
49 
50  size_t modelCount() const;
51  size_t modelIndex(const Model* model) const;
52  Model* model(size_t modelIndex);
53  void addModel(Model* model);
54  void removeAllModels();
55  void removeModel(Model* model);
56  void setModelOpenGLCapabilitiesFromView(Model* model) const;
57 
58  void addSecondPassModel(Model* model);
59 
60  const Overlay& overlay() const;
61  Overlay& overlay();
62 
63  const Clipping& clipping() const;
64  Clipping& clipping();
65 
66  const Camera& camera() const;
67  Camera& camera();
68  BoundingBox boundingBox();
69 
70  Background background() const;
71  void setBackground(const Background& background);
72 
73  Color3f haloColor() const;
74  void setHaloColor(const Color3f& color);
75 
76  bool isDropShadowEnabled() const;
77  bool enableDropShadow(bool enable);
78 
79  TransparencyMode transparencyMode() const;
80  void setTransparencyMode(const TransparencyMode& transparency);
81 
82  bool renderToImage(unsigned int width, unsigned int height, Image* image);
83  bool renderToImage(Image* image);
84 
85  void renderViewInAttachedViewer();
86  void lastRenderingPerformanceInfo(PerformanceInfo* info) const;
87 
88  void requestRedraw();
89  void requestImmediateRedraw();
90 
91  bool regionClosestVertex(int x, int y, unsigned int width, unsigned int height, Vec3d* vertex);
92 
93  void* framebufferData();
94 
95 private:
96  void internal_handleNotificationFromModel(Model::NotifyAction notifyAction);
97 
98 private:
99  CEE_BASE_F(Camera);
100  CEE_BASE_F(Model);
101  CEE_PRIVATE_IMPL(View);
102  CEE_DISALLOW_COPY_AND_ASSIGN(View);
103 };
104 
105 } // namespace vis
106 } // namespace cee
Stores an RGBA image with 8 bits per pixel.
Definition: Image.h:25
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppComponent.cpp:26
The camera configuration of a view.
Definition: Camera.h:33
Clipping planes are used to clip parts of the geometry in the scene to be able to look inside...
Definition: Clipping.h:30
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
Class for storing an RGB color triplet.
Definition: Color3f.h:25
Thin wrapper class for integrating Ceetron Desktop Components with a UI toolkit.
Definition: Viewer.h:30
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
Vector class for a 3D double vector.
Definition: Vec3d.h:26
Controlling the technique used for transparency in the view.
Definition: TransparencyMode.h:26
Overlay items are visual item presented overlaying the models in the View, for instance a color legen...
Definition: Overlay.h:28
Small class for the view background settings.
Definition: Background.h:27
Class for storing performance info stats.
Definition: PerformanceInfo.h:26