31 #include "../core/property/Property.h"
32 #include "../core/property/Properties.h"
33 #include "../core/property/SharedProperties.h"
34 #include "../../geometry/Polygon.h"
35 #include "../core/enum/Enums.h"
65 delete m_enumScaleType;
77 pro_widthGap.
setName(
"scale_width_rect_gap");
79 m_properties->addProperty(pro_widthGap);
82 pro_heightGap.
setName(
"scale_height_rect_gap");
84 m_properties->addProperty(pro_heightGap);
87 pro_mapName.
setName(m_sharedProps->getMapName());
92 m_properties->addProperty(pro_mapName);
94 Property pro_scaleName = scaleProperty();
95 if(!pro_scaleName.
isNull())
97 m_properties->addProperty(pro_scaleName);
118 if(!pro_widthGap.
isNull())
125 if(!pro_heightGap.
isNull())
132 if(!pro_scaleName.
isNull())
135 EnumType* enumType = m_enumScaleType->searchLabel(label);
138 m_currentScaleType = enumType;
182 return m_enumScaleType;
189 if(!m_currentScaleType)
190 return pro_scaleName;
195 return pro_scaleName;
197 pro_scaleName.
setName(
"scale_type");
198 pro_scaleName.
setLabel(
"graphic type");
206 for(
int i = 0 ; i < m_enumScaleType->size() ; ++i)
208 EnumType* enumType = m_enumScaleType->getEnum(i);
210 if(enumType == m_enumScaleType->getNoneType() || enumType == m_currentScaleType)
218 return pro_scaleName;
223 return m_currentScaleType;
virtual double getScaleGapX()
Class responsible for maintaining the drawing context of a MVC component. It is always used by the "M...
virtual double getScale()
virtual void setScaleGapY(double y)
Variant getValue()
Returns stored value.
virtual EnumDataType * getEnumDataType()
Returns data type enumeration.
void addOption(Variant variant)
std::string getLabel()
Returns label.
virtual ~ScaleModel()
Destructor.
virtual EnumType * getDataTypeDouble() const
Returns value that represents type double belonging to enumeration.
bool isNull()
Returns true if no value has been set, false otherwise.
bool m_border
true if should be drawn border, false otherwise
virtual void updateProperties(te::layout::Properties *properties)
Reimplemented from Observable.
Variant getOptionByCurrentChoice()
The Properties class represents a persistent set of properties. The Properties can be saved to a file...
EnumType * m_type
type of the MVC component
virtual void setScaleGapX(double x)
virtual void updateProperties(te::layout::Properties *properties)
Reimplemented from Observable.
static Enums & getInstance()
It returns a reference to the singleton instance.
An Envelope defines a 2D rectangular region.
virtual EnumType * getDoubleAlternatingScaleBarType() const
Returns value that represents double alternating scale bar type belonging to enumeration.
Class to represent a data type enumeration. Ex.: int, double, bool, te::color::RGBAColor (color)...
te::gm::Envelope m_box
bounding rectangle
Class that represents a "Model" part of Map MVC component. Its coordinate system is the same of scene...
Class acts like a union for some C++/TerraLib5 data types. Responsible for storing the value...
virtual void visitDependent(ContextItem context)
visit and if necessary redraw
virtual double getMapScale()
virtual EnumScaleType * getEnumScaleType()
double toDouble()
Returns the value of double type. (The setValue method received a double)
Class that represents a "Model" part of Map MVC component. Its coordinate system is the same of scene...
Class to represent a scale type enumeration. Ex.: hollow scale bar, etc.
Class that represents a "Model" part of Scale MVC component. Its coordinate system is the same of sce...
virtual Properties * getProperties() const
Reimplemented from Observable.
void setValue(ValueType value, EnumType *type)
Stores a copy of value.
Class that represents the value of an enumeration. An enumeration is made of "1..n" objects EnumType...
virtual EnumType * getDataTypeStringList() const
Returns value that represents type StringList (string) belonging to enumeration.
std::string toString()
Returns the value of string type. (The setValue method received a string)
virtual double getScaleGapY()
virtual Properties * getProperties() const
Reimplemented from Observable.
void setName(std::string name)
Sets the name of this property.
virtual Property scaleProperty() const
virtual EnumType * getDataTypeString() const
Returns value that represents type string belonging to enumeration.
virtual EnumType * getCurrentScaleType()
virtual void setLabel(std::string label)
Sets the label of this property.
EnumScaleType * m_enumScaleType
void setOptionChoice(Variant variant)
virtual bool contains(Property property)
Checks if the property is contained within the set of properties.
A property acts like a attribute member of a object and stores the state of this attribute. A set of properties stores the state of an object. Any data type, not included in the convertValue method in the class te::layout::Variant, it will be by default "std::string" value.
EnumType * m_currentScaleType
void setValue(ValueType value, EnumType *type)
Stores a copy of value.