28 I_ASSIGN(m_slaveExtenderCompPtr,
"SlaveSceneExtender",
"Scene extender will be used to provide background shapes",
false,
"SlaveSceneExtender");
29 I_ASSIGN(m_sceneExtenderModeAttrPtr,
"ViewExtenderMode",
"Control how the view extender works:\n\t0 - combine slave with current shapes\n\t1 - use slave by direct calls only\n\t2 - use slave always and current shapes indirect only\n\t3 - use slave by direct calls only and current shapes indirect only",
true, 0);
30 I_ASSIGN_MULTI_0(m_idFiltersAttrPtr,
"SceneIdFilters",
"Optional scene ID filters allowing to ignore some scene providers",
false);
71 I_ATTR(
int, m_sceneExtenderModeAttrPtr);
72 I_MULTIATTR(
int, m_idFiltersAttrPtr);
80: m_isSlaveShown(false)
90 Q_ASSERT(providerPtr !=
NULL);
95 bool showOwnShapes =
true;
96 bool showSlaveShapes =
true;
98 switch (*m_sceneExtenderModeAttrPtr){
99 case EM_SLAVE_DIRECT_ONLY:
100 showSlaveShapes = ((flags & SF_DIRECT) != 0);
103 case EM_OWN_SHAPES_INDIRECT:
104 showOwnShapes = ((flags & SF_DIRECT) == 0);
107 case EM_SLAVE_DIRECT_ONLY_OWN_SHAPES_INDIRECT:
108 showOwnShapes = ((flags & SF_DIRECT) == 0);
109 showSlaveShapes = ((flags & SF_DIRECT) != 0);
117 if ( showOwnShapes &&
119 IsViewIdSupported(viewId) &&
120 (m_shapesMap.find(providerPtr) == m_shapesMap.end())){
121 Shapes& shapes = m_shapesMap[providerPtr];
123 bool isBackground = ((flags & SF_BACKGROUND) != 0);
124 CreateShapes(viewId, shapes);
126 int shapesCount = shapes.
GetCount();
127 for (
int i = 0; i < shapesCount; ++i){
129 if (shapePtr !=
NULL){
134 if (shapeImplPtr !=
NULL){
144 if (showSlaveShapes && m_slaveExtenderCompPtr.IsValid()){
145 m_slaveExtenderCompPtr->AddItemsToScene(providerPtr, (flags | SF_BACKGROUND) & ~SF_DIRECT);
147 m_isSlaveShown =
true;
150 m_isSlaveShown =
false;
158 Q_ASSERT(providerPtr !=
NULL);
161 Q_ASSERT(m_slaveExtenderCompPtr.IsValid());
163 m_slaveExtenderCompPtr->RemoveItemsFromScene(providerPtr);
166 ShapesMap::iterator iter = m_shapesMap.find(providerPtr);
167 if (iter != m_shapesMap.end()){
170 if (viewPtr !=
NULL){
171 Shapes& shapes = iter.value();
173 int shapesCount = shapes.
GetCount();
174 for (
int i = 0; i < shapesCount; ++i){
176 if (shapePtr !=
NULL){
182 m_shapesMap.erase(iter);
192 if (m_idFiltersAttrPtr.IsValid()){
193 int filtersCount = m_idFiltersAttrPtr.GetCount();
194 for (
int i = 0; i < filtersCount; ++i){
195 int filterId = m_idFiltersAttrPtr[i];
196 if (viewId == filterId){
218 for (ShapesMap::iterator index = m_shapesMap.begin(); index != m_shapesMap.end(); ++index){
220 Q_ASSERT(viewProvderPtr !=
NULL);
223 Q_ASSERT(viewPtr !=
NULL);
Interface for GUI objects presenting its results using extern view objects.
Interface for GUI objects managing view.
virtual iview::IShapeView * GetView() const =0
Called when items should be removed from specified view.
virtual int GetViewId() const =0
Get ID indentifing this view.
virtual void RemoveItemsFromScene(IViewProvider *providerPtr) override
Called when items should be removed from specified scene.
bool IsViewIdSupported(int viewId) const
void UpdateAllViews()
It calls Update for all used views.
istd::TPointerVector< iview::IShape > Shapes
virtual void CreateShapes(int viewId, Shapes &result)=0
Create shapes for the view.
QMap< IViewProvider *, Shapes > ShapesMap
@ EM_SLAVE_DIRECT_ONLY_OWN_SHAPES_INDIRECT
virtual void AddItemsToScene(IViewProvider *providerPtr, int flags) override
Called when items should be added to specified scene.
const ShapesMap & GetShapesMap() const
Implementation of a pointer container, which controls the live cycle of the pointer object.
Pointer * GetAt(int index) const
Get pointer at specified index.
int GetCount() const
Get number of stored elements.
virtual bool AssignToLayer(int layerType)
Assign this shape to same layer.
Common interface for all display console shapes.
virtual int GetLayerType() const =0
Get layer type of this shape object.
virtual bool DisconnectShape(IShape *shapePtr)=0
Disconnect shape object from view.
Common interface for a general shape view implementations.
virtual bool ConnectShape(IShape *shapePtr)=0
Connect shape object to view.
virtual void Update()=0
Updates all invalidates shapes.
@ LT_BACKGROUND
Background layer.
@ LT_INACTIVE
Layer with inactive shapes.
This package contains Qt based implementations for 2D graphic objects.