ACF $AcfVersion:0$
CViewProviderGuiComp.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ACF-Commercial
2#pragma once
3
4
5// ACF includes
10#include <iqt2d/IViewProvider.h>
12#include <iview/IColorSchema.h>
13#include <iview/CConsoleGui.h>
16
17
18namespace iqt2d
19{
20
21
22
23class CViewProviderGuiCompAttr: public iqtgui::TGuiComponentBase<iview::CConsoleGui>
24{
25public:
27
53
54 I_BEGIN_COMPONENT(CViewProviderGuiCompAttr);
55 I_ASSIGN(m_viewIdAttrPtr, "ViewId", "ID allowing identifying this view", true, 0);
56 I_ASSIGN(m_useAntialiasingAttrPtr, "UseAntialiasing", "Enables using of antialiasing", false, false);
57 I_ASSIGN(m_infoTextEnabledAttrPtr, "InfoTextEnabled", "Draws InfoText as overlay", true, false);
58 I_ASSIGN(m_zoomToFitEnabledAttrPtr, "ZoomToFitEnabled", "If true, the shapes will be fit to the view according to the defined fitting mode", false, false);
59 I_ASSIGN(m_useShapeEditCommandsAttrPtr, "UseShapeEditCommands", "If true, the commands for shape editing are available", false, false);
60 I_ASSIGN(m_useGridCommandsAttrPtr, "UseGridCommands", "If true, the commands for grid management are available", false, false);
61 I_ASSIGN(m_useScollBarCommandsAttrPtr, "UseScrollBarCommands", "If true, the commands for scroll bar management are available", false, false);
62 I_ASSIGN(m_fitModeAttrPtr, "FitMode", "Select fitting mode for the view. 0 - No fitting\n1 - Fit contents to view\n2 - Horizontal fit\n3 - Vertical fit\n4 - Both axes scaled separately\n5 - Scale both axes proportional to display smallest AOI, which fully covers display", false, 0);
63 I_ASSIGN(m_backgroundModeAttrPtr, "BackgroundMode", "Mode of background drawing:\n 0 - standard window background\n 1 - color used from color scheme \n 2 - checkerboard\n 3 - dot grid\n", true, BM_NORMAL);
64 I_ASSIGN(m_fullScreenModeSupportedAttrPtr, "FullScreenModeSupported", "If enabled, the view will be switched into full screen mode on mouse double click", true, true);
65 I_END_COMPONENT;
66
67protected:
68 I_ATTR(int, m_viewIdAttrPtr);
69 I_ATTR(bool, m_useAntialiasingAttrPtr);
70 I_ATTR(bool, m_infoTextEnabledAttrPtr);
71 I_ATTR(bool, m_useShapeEditCommandsAttrPtr);
72 I_ATTR(bool, m_useGridCommandsAttrPtr);
73 I_ATTR(bool, m_useScollBarCommandsAttrPtr);
74 I_ATTR(bool, m_useStatusBarCommandsAttrPtr);
75 I_ATTR(bool, m_zoomToFitEnabledAttrPtr);
76 I_ATTR(int, m_fitModeAttrPtr);
77 I_ATTR(int, m_backgroundModeAttrPtr);
78 I_ATTR(bool, m_fullScreenModeSupportedAttrPtr);
79};
80
81
88 virtual public ibase::ICommandsProvider,
89 virtual public IViewProvider,
90 virtual public i2d::ICalibrationProvider,
91 virtual public ibase::ICommandsDisplayer,
93{
94public:
97
98 I_BEGIN_COMPONENT(CViewProviderGuiComp);
99 I_REGISTER_INTERFACE(ibase::ICommandsProvider);
100 I_REGISTER_INTERFACE(ibase::ICommandsDisplayer);
101 I_REGISTER_INTERFACE(IViewProvider);
102 I_REGISTER_INTERFACE(i2d::ICalibrationProvider);
103 I_ASSIGN(m_shapeStatusInfoCompPtr, "ShapeStatusInfo", "Shape status info consumer", false, "ShapeStatusInfo");
104 I_ASSIGN(m_calibrationProviderCompPtr, "CalibrationProvider", "Provider of 2D-calibration for the entire view", false, "CalibrationProvider");
105 I_ASSIGN_TO(m_calibrationProviderModelCompPtr, m_calibrationProviderCompPtr, false);
106 I_ASSIGN(m_colorSchemaCompPtr, "ColorSchema", "Color schema used for console", false, "ColorSchema");
107 I_ASSIGN(m_calibrationShapeCompPtr, "CalibrationShape", "Calibration shape displaying calibration grid, if not choosen default affine calibration shape will be used", false, "CalibrationShape");
108 I_ASSIGN(m_distanceMeasureShapeCompPtr, "DistanceMeasureShape", "Distance measurement shape", false, "DistanceMeasureShape");
109 I_ASSIGN(m_pointMeasureShapeCompPtr, "PointMeasureShape", "Point measurement shape", false, "PointMeasureShape");
110 I_ASSIGN_MULTI_0(m_viewActivationHandlerCompPtr, "ViewActivationHandler", "Handler for observation the visual status of the view provider", false);
111 I_ASSIGN(m_screenTransformationProvider, "ScreenTransformationProvider", "Gets object which contains current screen transformation", false, "ScreenTransformationProvider");
112 I_END_COMPONENT;
113
114 // reimplemented (ibase::ICommandsProvider)
115 virtual const ibase::IHierarchicalCommand* GetCommands() const override;
116
117 // reimplemented (ibase::ICommandsDisplayer)
118 virtual void ShowCommands(const ibase::ICommandsProvider* commandsProvider) override;
119
120 // reimplemented (iqt2d::IViewProvider)
121 virtual int GetViewId() const override;
122 virtual iview::IShapeView* GetView() const override;
123
124 // reimplemented (i2d::ICalibrationProvider)
125 virtual const i2d::ICalibration2d* GetCalibration() const override;
126
127protected:
128 virtual void SetupBackground();
129
130 // reimplemented (CGuiComponentBase)
131 virtual void OnGuiCreated() override;
132 virtual void OnGuiDestroyed() override;
133 virtual void OnGuiRetranslate() override;
134 virtual void OnGuiShown() override;
135 virtual void OnGuiHidden() override;
136 virtual void OnGuiDesignChanged() override;
137
138 // reimplemented (imod::CMultiModelDispatcherBase)
139 void OnModelChanged(int modelId, const istd::IChangeable::ChangeSet& changeSet) override;
140
141 // reimplemented (icomp::CComponentBase)
142 virtual void OnComponentCreated() override;
143 virtual void OnComponentDestroyed() override;
144
145private:
146 I_REF(iview::IShapeStatusInfo, m_shapeStatusInfoCompPtr);
147 I_REF(i2d::ICalibrationProvider, m_calibrationProviderCompPtr);
148 I_REF(imod::IModel, m_calibrationProviderModelCompPtr);
149 I_REF(iview::IColorSchema, m_colorSchemaCompPtr);
150 I_REF(iview::IShape, m_calibrationShapeCompPtr);
151 I_REF(iview::IShape, m_distanceMeasureShapeCompPtr);
152 I_REF(iview::IShape, m_pointMeasureShapeCompPtr);
153 I_MULTIREF(IViewActivationHandler, m_viewActivationHandlerCompPtr);
154 I_REF(iview::IScreenTransformationProvider, m_screenTransformationProvider);
155};
156
157
158} // namespace iqt2d
159
160
Interface for 2D calibration and coordinate transformation with unit information.
Common interface for an object, which delivers a 2D-calibration.
Interface for a displayer of the hierarchical commands.
Interface for a provider of the heriarchical commands.
Generic implementation of a data model changes notifier.
Common interface for model objects, that supports Model/Observer design pattern.
Definition IModel.h:25
iqtgui::TGuiComponentBase< iview::CConsoleGui > BaseClass
BackgroundMode
Background type for the 2D-view.
@ BM_CHECKERBOARD
Checkerboard pattern.
@ BM_COLOR_SCHEMA
Color from the given color scheme.
@ BM_NORMAL
Standard window background.
Standard 2D-View provider.
virtual iview::IShapeView * GetView() const override
Called when items should be removed from specified view.
virtual void OnGuiHidden() override
Called from widget event filter when slave widget is hidden.
void OnModelChanged(int modelId, const istd::IChangeable::ChangeSet &changeSet) override
Called when some model observed by dispatcher will be changed.
virtual void OnGuiRetranslate() override
Called from widget event filter when GUI should be retranslated.
virtual void OnGuiDesignChanged() override
virtual void OnComponentCreated() override
imod::CMultiModelDispatcherBase BaseClass2
virtual const i2d::ICalibration2d * GetCalibration() const override
Get access to transformation object, which transforms a local logical coordinate system to global one...
virtual void OnGuiCreated() override
Called just after GUI is initialized.
virtual void SetupBackground()
CViewProviderGuiCompAttr BaseClass
virtual void ShowCommands(const ibase::ICommandsProvider *commandsProvider) override
virtual int GetViewId() const override
Get ID indentifing this view.
virtual void OnGuiShown() override
Called from widget event filter when slave widget is shown.
virtual void OnGuiDestroyed() override
Called just before GUI is released.
virtual void OnComponentDestroyed() override
virtual const ibase::IHierarchicalCommand * GetCommands() const override
Get list of menu commands.
Interface for GUI objects managing view.
Base class for all Qt GUI componentes.
Set of change flags (its IDs).
Definition IChangeable.h:36
Common interface to define the hierarchical graph structures.
Defines set of standard pens, brushes and simple management of unions.
Common interface for all display console shapes.
Definition IShape.h:32
Interface for access local bitmap information.
Common interface for a general shape view implementations.
Definition IShapeView.h:30
This package contains Qt based implementations for 2D graphic objects.