87 _TL(
"attribute sorting"))
93 Parameters.
Add_Bool (
"NODE_COLORS" ,
"NODATA_SHOW" ,
_TL(
"Show No-Data" ),
_TL(
""),
true);
100 Parameters.
Add_Font (
"LABEL_FIELD" ,
"LABEL_FIELD_FONT" ,
_TL(
"Font" ),
_TL(
""));
120 Parameters.
Add_Int (
"LABEL_FIELD_EFFECT",
"LABEL_FIELD_EFFECT_SIZE" ,
_TL(
"Size" ),
_TL(
""), 1, 1,
true);
124 SG_T(
"0|0.1|0.12|0.123|0.1234|0.12345|0.1234567|0.12345678|0.123456789|0.1234567890|0.12345678901|0.123456789012|0.1234567890123|0.12345678901234|0.123456789012345|0.1234567890123456|0.12345678901234567|0.123456789012345678|0.1234567890123456789|0.12345678901234567890")), 0
134 Parameters.
Add_Double(
"LABEL_FIELD_SIZEBY",
"LABEL_FIELD_SIZE" ,
_TL(
"Default Size" ),
_TL(
""), 100., 0.,
true);
139 Parameters.
Add_Bool (
"NODE_CHART",
"CHART_SHOW" ,
_TL(
"Show" ),
_TL(
""),
false);
176 if( ID.
Find(
"FIELD_") == 0 )
178 ID.
Replace(
"FIELD_",
"COLOR_");
212 bool Value = Parameters[
"LABEL_FIELD_SIZE_TYPE"].asInt() != 0 ||
Get_Fields_Choice(Parameters[
"LABEL_FIELD_SIZEBY"]) >= 0;
314 case 1:
m_Label.Precision = -99;
break;
315 default:
m_Label.Precision -= 2;
break;
392 if(
m_Parameters[
"CHART_SHOW"].asBool() && m_Chart.is_Valid() )
407 double dSize =
m_Parameters[
"LABEL_FIELD_SIZE_TYPE"].asInt() == 1
413 if( iSize >= 0 && iSize < m_pObject->asShapes()->Get_Field_Count() )
427 int Size =
m_Parameters[
"LABEL_FIELD_SIZE_TYPE"].asInt() == 1 ? (int)(0.5 + dSize) : dc_Map.
Get_DC().GetFont().GetPointSize();
451 if( Limit < 1 || m_pObject->asShapes()->Get_Count() <= Limit )
460 double d =
m_pObject->asShapes()->Get_Count() / (double)Limit;
462 for(
double i=0; (
sLong)i<
m_pObject->asShapes()->Get_Count(); i+=d)
478 wxPen oldPen (dc_Map.
Get_DC().GetPen ()); dc_Map.
SetPen (*wxBLACK_PEN );
479 wxBrush oldBrush(dc_Map.
Get_DC().GetBrush()); dc_Map.
SetBrush(*wxWHITE_BRUSH);
511 if( !Label.IsEmpty() )
513 if( PointSize > 0 && PointSize != dc_Map.
Get_DC().GetFont().GetPointSize() )
515 wxFont Font(dc_Map.
Get_DC().GetFont());
517 Font.SetPointSize(PointSize);
535 return( Parameters.
Add_Choice(ParentID, Identifier, Name, Description,
539 _TL(
"Backward Diagonal"),
540 _TL(
"Cross Diagonal" ),
541 _TL(
"Forward Diagonal" ),
554 default:
return( wxBRUSHSTYLE_SOLID );
555 case 1:
return( wxBRUSHSTYLE_TRANSPARENT );
556 case 2:
return( wxBRUSHSTYLE_BDIAGONAL_HATCH );
557 case 3:
return( wxBRUSHSTYLE_CROSSDIAG_HATCH );
558 case 4:
return( wxBRUSHSTYLE_FDIAGONAL_HATCH );
559 case 5:
return( wxBRUSHSTYLE_CROSS_HATCH );
560 case 6:
return( wxBRUSHSTYLE_HORIZONTAL_HATCH);
561 case 7:
return( wxBRUSHSTYLE_VERTICAL_HATCH );
568 return( Parameters.
Add_Choice(ParentID, Identifier, Name, Description,
572 _TL(
"Long dashed style"),
573 _TL(
"Short dashed style"),
574 _TL(
"Dot and dash style"),
575 _TL(
"Backward diagonal hatch"),
576 _TL(
"Cross-diagonal hatch"),
577 _TL(
"Forward diagonal hatch"),
579 _TL(
"Horizontal hatch"),
580 _TL(
"Vertical hatch")
593 default:
return( wxPENSTYLE_SOLID );
594 case 1:
return( wxPENSTYLE_DOT );
595 case 2:
return( wxPENSTYLE_LONG_DASH );
596 case 3:
return( wxPENSTYLE_SHORT_DASH );
597 case 4:
return( wxPENSTYLE_DOT_DASH );
598 case 5:
return( wxPENSTYLE_BDIAGONAL_HATCH );
599 case 6:
return( wxPENSTYLE_CROSSDIAG_HATCH );
600 case 7:
return( wxPENSTYLE_FDIAGONAL_HATCH );
601 case 8:
return( wxPENSTYLE_CROSS_HATCH );
602 case 9:
return( wxPENSTYLE_HORIZONTAL_HATCH );
603 case 10:
return( wxPENSTYLE_VERTICAL_HATCH );
640 &&
m_pSymbology->Get_Class_Color_byValue(Value, Color) )
684 Parameters.
Add_Bool (
"TYPE" ,
"OUTLINE" ,
_TL(
"Outline" ),
_TL(
""),
false );
687 Parameters.
Add_Range (
"SIZE_FIELD",
"SIZE_RANGE" ,
_TL(
"Size Range" ),
_TL(
""), 5., 25., 0.,
true);
688 Parameters.
Add_Double(
"SIZE_FIELD",
"SIZE_DEFAULT",
_TL(
"Default Size" ),
_TL(
""), 15., 0.,
true);
693 CSG_String Choices; CSG_Colors Colors((
int)Fields.
Get_Size());
695 for(
int i=0; i<(int)Fields.
Get_Size(); i++)
699 CSG_String ID; ID.
Printf(
"FIELD_%d", Fields[i]);
707 Parameters[
"SIZE_FIELD"].asChoice()->Set_Items(Choices);
708 Parameters[
"SIZE_FIELD"].Set_Value((
int)Fields.
Get_Size());
716bool CSG_Map_Shapes::CChart::Get_Options(
const CSG_Shapes *pShapes,
const CSG_Parameters &Parameters)
718 m_Fields.Clear(); m_Size.Field = -1;
720 if( Parameters(
"FIELDS") )
730 m_Fields.Add(i, pParameter->
asColor());
735 switch( Parameters[
"TYPE"].asInt() )
737 default:
m_Type = Parameters[
"OUTLINE"].asBool() ? 0 : 1;
break;
738 case 1:
m_Type = Parameters[
"OUTLINE"].asBool() ? 2 : 3;
break;
742 m_Size.Size = m_Size.Field < 0
743 ? Parameters[
"SIZE_DEFAULT" ].asDouble()
744 : Parameters[
"SIZE_RANGE.MIN"].asDouble();
745 m_Size.Range = Parameters[
"SIZE_RANGE.MAX"].asDouble() - m_Size.Size;
746 m_Size.Type = Parameters[
"SIZE_TYPE" ].asInt ();
755void CSG_Map_Shapes::CChart::Draw(CSG_Map_DC &dc_Map, CSG_Shape *pShape)
761 if( m_Size.Field >= 0 )
771 int size = (int)(scale * (m_Size.Type == 1 ? dc_Map.
World2DC() : dc_Map.
Scale()));
779 dc_Map.
SetPen(*wxBLACK_PEN);
783 default: _Draw_Bar(dc_Map, pShape,
true, point.
x, point.
y, (
int)(0.8 * size), size);
break;
784 case 1: _Draw_Bar(dc_Map, pShape,
false, point.
x, point.
y, (
int)(0.8 * size), size);
break;
785 case 2: _Draw_Pie(dc_Map, pShape,
true, point.
x, point.
y, (
int)(1.0 * size) );
break;
786 case 3: _Draw_Pie(dc_Map, pShape,
false, point.
x, point.
y, (
int)(1.0 * size) );
break;
792void CSG_Map_Shapes::CChart::_Draw_Pie(CSG_Map_DC &dc_Map, CSG_Table_Record *pRecord,
bool bOutline,
int x,
int y,
int size)
796 for(
int i=0; i<m_Fields.Get_Count(); i++)
798 sum += fabs(pRecord->
asDouble(m_Fields[i].x));
803 sum =
M_PI_360 / sum;
double d = 0.;
805 for(
int i=0, jx=x, jy=y-size; i<m_Fields.Get_Count(); i++)
814 d += sum * fabs(pRecord->
asDouble(m_Fields[i].x));
816 int ix = jx; jx = x - (int)(size * sin(-d));
817 int iy = jy; jy = y - (int)(size * cos(-d));
819 dc_Map.
DrawArc(jx, jy, ix, iy, x, y);
825void CSG_Map_Shapes::CChart::_Draw_Bar(CSG_Map_DC &dc_Map, CSG_Table_Record *pRecord,
bool bOutline,
int x,
int y,
int sx,
int sy)
827 double max = fabs(pRecord->
asDouble(m_Fields[0].x));
829 for(
int i=1; i<m_Fields.Get_Count(); i++)
831 double d = fabs(pRecord->
asDouble(m_Fields[i].x));
841 y += sy / 2; max = sy / max;
double dx = sx / (double)m_Fields.Get_Count(), ix = x - sx / 2.;
843 for(
int i=0; i<m_Fields.Get_Count(); i++, ix+=dx)
852 double dy = -pRecord->
asDouble(m_Fields[i].x) * max;
859 dc_Map.
SetPen(*wxBLACK_PEN); dc_Map.
DrawLine(x - sx / 2, y, x + sx / 2, y);
bool SG_Data_Type_is_Numeric(TSG_Data_Type Type)
#define SG_COLOR_GREY_LIGHT
sLong Get_Size(void) const
class CSG_Shapes * asShapes(bool bPolymorph=false) const
void SetBrush(const wxBrush &Brush)
bool Draw_Layer_Begin(void)
void SetPen(const wxPen &Pen)
void DrawArc(int xStart, int yStart, int xEnd, int yEnd, int xc, int yc)
void DrawCircle(int x, int y, int radius)
const CSG_Rect & rWorld(void) const
bool Draw_Layer_End(double Transparency=0.)
void DrawLine(int x1, int y1, int x2, int y2)
wxMemoryDC & Get_DC(void)
const double & Scale(void) const
const double & World2DC(void) const
void SetFont(const wxFont &Font)
void DrawText(int Align, int x, int y, const wxString &Text)
void DrawRectangle(int x1, int y1, int width, int height)
virtual bool Parameters_Changed(void)
bool Set_Fields_Choice(CSG_Parameter &Choice, bool bNumeric, bool bAddNone, bool bSelectNone=false)
bool Get_Field_Value(sLong Index, int Field, int Normalize, double Scale, wxString &Value) const
static int Get_Fields_Choice(CSG_Parameter &Choice)
virtual bool DataObject_Changed(void)
TSG_Data_Object_Type m_Type
virtual bool Parameter_Changed(CSG_Parameters &Parameters, CSG_Parameter &Parameter, int Flags)
CSG_Data_Object * m_pObject
bool Set_Stretch(CSG_Parameters &Parameters, CSG_Data_Object *pObject=NULL, const CSG_String &Suffix="")
CSG_Rect Get_Extent(void) const
CSG_Parameters m_Parameters
class CSG_Map_Symbology * m_pSymbology
virtual bool Add_Parameters(CSG_Parameters &Parameters)
virtual bool Add_Parameters(CSG_Parameters &Parameters)
CSG_Parameter * BrushList_Add(CSG_Parameters &Parameters, const CSG_String &ParentID, const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description) const
virtual bool Parameter_Changed(CSG_Parameters &Parameters, CSG_Parameter &Parameter, int Flags)
virtual void On_Draw(CSG_Map_DC &dc_Map, int Flags)
virtual void Draw_Shape(CSG_Map_DC &dc_Map, CSG_Shape *pShape, int Flags=0)
wxBrushStyle BrushList_Get_Style(const CSG_String &Identifier)
bool Get_Class_Color(CSG_Shape *pShape, int &Color)
CSG_Shape * Get_Shape(sLong i)
class CSG_Map_Shapes::CLabel m_Label
virtual void Draw_Initialize(CSG_Map_DC &dc_Map, int Flags)
class CSG_Map_Shapes::CStretch m_Stretch
int PenList_Get_Style(const CSG_String &Identifier)
CSG_Parameter * PenList_Add(CSG_Parameters &Parameters, const CSG_String &ParentID, const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description) const
virtual void Draw_Label(CSG_Map_DC &dc_Map, CSG_Shape *pShape, const wxString &Label)
virtual bool Parameters_Changed(void)
virtual bool DataObject_Changed(void)
virtual void Draw_Thumbnails(CSG_Map_DC &dc_Map, int Limit)
const SG_Char * Get_Identifier(void) const
bool Set_Children_Enabled(bool bEnabled=true)
bool Cmp_Identifier(const CSG_String &Identifier) const
bool Set_Callback(bool bActive=true)
CSG_Parameter * Add_Choice(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &Items, int Default=0)
void Set_Enabled(bool bEnabled=true)
bool Del_Parameters(void)
CSG_Parameter * Add_Double(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Value=0.0, double Minimum=0.0, bool bMinimum=false, double Maximum=0.0, bool bMaximum=false)
CSG_Parameter * Add_Parameters(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
CSG_Parameter * Add_Int(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Value=0, int Minimum=0, bool bMinimum=false, int Maximum=0, bool bMaximum=false)
CSG_Parameter * Add_Node(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool bCollapsed=false)
CSG_Parameter * Add_Color(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Value=0)
CSG_Parameter * Add_Font(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const SG_Char *pInit=NULL)
CSG_Parameter * Add_Bool(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool Value=false)
bool Cmp_Identifier(const CSG_String &Identifier) const
CSG_Parameter * Add_Range(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Range_Min=0.0, double Range_Max=0.0, double Minimum=0.0, bool bMinimum=false, double Maximum=0.0, bool bMaximum=false)
TSG_Intersection Intersects(const CSG_Rect &Rect) const
CSG_Point Get_Center(void) const
virtual int Get_Point_Count(void) const =0
TSG_Shape_Type Get_Type(void) const
virtual int Get_Part_Count(void) const =0
virtual TSG_Point Get_Point(int iPoint=0) const =0
virtual const CSG_Rect & Get_Extent(void)=0
size_t Replace(const CSG_String &Old, const CSG_String &New, bool bReplaceAll=true)
static CSG_String Format(const char *Format,...)
int Find(char Character, bool fromEnd=false) const
int Printf(const char *Format,...)
sLong Get_Index(void) const
double asDouble(int Field) const
class CSG_Table * Get_Table(void)
const SG_Char * asString(int Field, int Decimals=-99) const
const SG_Char * Get_Field_Name(int Field) const
double Get_Minimum(int Field) const
int Get_Field_Count(void) const
double Get_Range(int Field) const
TSG_Data_Type Get_Field_Type(int Field) const
@ SG_DATAOBJECT_TYPE_Shapes
wxColour SG_System_Get_Color_Foreground(int Mode)
wxColour SG_System_Get_Color_Background(int Mode)
wxColour SG_Get_wxColor(int Color)
int SG_Get_Color(const wxColour &Color)
wxFont SG_Get_wxFont(CSG_Parameter *pFont)
#define SG_DC_TEXTEFFECT_TOPRIGHT
#define SG_DC_TEXTEFFECT_LEFT
#define SG_DC_TEXTEFFECT_BOTTOM
#define SG_DC_TEXTEFFECT_NONE
#define SG_DC_TEXTEFFECT_BOTTOMRIGHT
#define SG_DC_TEXTEFFECT_TOPLEFT
#define SG_DC_TEXTEFFECT_BOTTOMLEFT
#define SG_DC_TEXTALIGN_TOPLEFT
#define SG_DC_TEXTEFFECT_RIGHT
#define SG_DC_TEXTEFFECT_TOP
#define SG_DC_TEXTEFFECT_FRAME
#define LAYER_DRAW_FLAG_THUMBNAIL
#define LAYER_DRAW_FLAG_NOLABELS
#define LAYER_DRAW_FLAG_NOEDITS
#define LAYER_DRAW_FLAG_SELECTION
#define PARAMETER_CHECK_ENABLE
#define PARAMETER_CHECK_VALUES