All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OutsideModelObservable.h
Go to the documentation of this file.
1 /* Copyright (C) 2001-2014 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 OutsideModelObservable.h
22 
23  \brief
24 
25  \ingroup layout
26 */
27 
28 #ifndef __TERRALIB_LAYOUT_INTERNAL_OUTSIDE_MODEL_H
29 #define __TERRALIB_LAYOUT_INTERNAL_OUTSIDE_MODEL_H
30 
31 // TerraLib
32 #include "Observable.h"
33 #include "Properties.h"
34 #include "ContextItem.h"
35 #include "../../../../../geometry/Envelope.h"
36 #include "../../../../../geometry/Coord2D.h"
37 
38 // STL
39 #include <set>
40 
41 namespace te
42 {
43  namespace layout
44  {
45  class Observer;
46 
48  {
49  public:
50 
52  virtual ~OutsideModelObservable();
53 
54  virtual bool addObserver(Observer* o);
55  virtual bool removeObserver(Observer* o);
56  virtual te::gm::Envelope getBox();
57  virtual void setBox(te::gm::Envelope box);
58  virtual int getColor();
59  virtual void setColor(int color);
60 
61  virtual void setPosition(const double& x, const double& y);
63  virtual void setType(LayoutAbstractObjectType type);
64 
65  virtual std::string getName();
66 
67  virtual int getZValue();
68  virtual void setZValue(int zValue);
69 
70  virtual void updateProperties(te::layout::Properties* properties);
71 
72  virtual Properties* getProperties() const;
73 
74  virtual int getId();
75 
76  virtual void setId( int id );
77 
78  protected:
79 
80  virtual void notifyAll(ContextItem context);
81 
82  protected:
83  std::set<Observer*> m_observers;
86  int m_color;
89  int m_zValue;
90  int m_id;
91 
92  private:
93  std::string m_name;
94  };
95  }
96 }
97 
98 #endif
virtual void updateProperties(te::layout::Properties *properties)
An utility struct for representing 2D coordinates.
Definition: Coord2D.h:40
virtual LayoutAbstractObjectType getType()
virtual Properties * getProperties() const
virtual void setType(LayoutAbstractObjectType type)
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
virtual void setPosition(const double &x, const double &y)
virtual void setBox(te::gm::Envelope box)
LayoutAbstractObjectType
Enum TdkAbstractComponentType. This is the enumeration of the components types.
Definition: AbstractType.h:38
virtual void notifyAll(ContextItem context)