All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ObjectInspectorDock.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file ObjectInspectorOutside.cpp
22 
23  \brief
24 
25  \ingroup layout
26 */
27 
28 // TerraLib
29 #include "ObjectInspectorDock.h"
30 #include "../../../layout/qt/outside/ObjectInspectorOutside.h"
31 #include "../../../layout/core/pattern/singleton/Context.h"
32 #include "../../../layout/qt/core/BuildGraphicsOutside.h"
33 #include "../../../layout/core/enum/Enums.h"
34 
35 
36 te::qt::plugins::layout::ObjectInspectorDock::ObjectInspectorDock( QWidget * parent /*= 0*/, Qt::WindowFlags flags /*= 0*/ ) :
37  QDockWidget(parent, flags)
38 {
39  setWindowTitle("Object Inspector");
40  setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
41 
42  create();
43 
44  setWidget(m_inspector);
45 }
46 
48 {
49 
50 }
51 
53 {
54  te::layout::AbstractBuildGraphicsOutside* abstractBuildOutside = te::layout::Context::getInstance().getAbstractBuildGraphicsOutside();
55  if(!abstractBuildOutside)
56  {
57  return;
58  }
59 
60  te::layout::BuildGraphicsOutside* buildOutside = dynamic_cast<te::layout::BuildGraphicsOutside*>(abstractBuildOutside);
61  if(!buildOutside)
62  {
63  return;
64  }
65 
66  te::layout::EnumObjectType* objectType = te::layout::Enums::getInstance().getEnumObjectType();
67  if(!objectType)
68  {
69  return;
70  }
71 
72  QWidget* widget = buildOutside->createOuside(objectType->getObjectInspectorWindow());
73  if(!widget)
74  {
75  return;
76  }
77  m_inspector = dynamic_cast<te::layout::ObjectInspectorOutside*>(widget);
78 }
79 
81 {
82  return m_inspector;
83 }
84 
85 
86 
Class to represent a graphic object (MVC component) and widget object (MVC widget) type enumeration...
virtual EnumType * getObjectInspectorWindow() const
Returns value that represents object inspector widget (MVC widget) type belonging to enumeration...
QWidget * createOuside(te::layout::EnumType *type)
Method to create a widget from the type.
ObjectInspectorDock(QWidget *parent=0, Qt::WindowFlags flags=0)
Tree of names of all the items entered on the scene, MVC components, using Qt to present the name of ...
Abstract class for build MVC widgets.
static Context & getInstance()
It returns a reference to the singleton instance.
Class responsible for creating or building widgets. All objects are children of Qwidget and OutsideOb...
te::layout::ObjectInspectorOutside * m_inspector
te::layout::ObjectInspectorOutside * getObjectInspectorOutside()