73 Parameters.
Set_Name(
"Layer Setting Defaults");
76 Parameters.
Add_Range (
"",
"STRETCH_LINEAR" ,
_TL(
"Linear" ),
_TL(
""), 0., 100., 0.,
true, 100.,
true);
77 Parameters.
Add_Double(
"",
"STRETCH_STDDEV" ,
_TL(
"Standard Deviation"),
_TL(
""), 2., 0.,
true);
78 Parameters.
Add_Bool (
"",
"STRETCH_STDDEV_RANGE",
_TL(
"Keep in Range" ),
_TL(
""),
true);
79 Parameters.
Add_Range (
"",
"STRETCH_PERCENT" ,
_TL(
"Percent Clip" ),
_TL(
""), 1., 99., 0.,
true, 100.,
true);
94#define CLASSIFY_UNIQUE 0
95#define CLASSIFY_EQUAL 1
96#define CLASSIFY_DEFINED 2
97#define CLASSIFY_QUANTILE 3
98#define CLASSIFY_GEOMETRIC 4
99#define CLASSIFY_NATURAL 5
100#define CLASSIFY_STDDEV 6
101#define CLASSIFY_MANUAL 7
104#define DEF_LAYER_COLOUR_COUNT 10
194 if( !Parameters(
"NODE_DISPLAY") ) { Parameters.
Add_Node(
"",
"NODE_DISPLAY",
_TL(
"Display" ),
_TL(
"") ); }
195 if( !Parameters(
"NODE_LEGEND" ) ) { Parameters.
Add_Node(
"",
"NODE_LEGEND" ,
_TL(
"Legend" ),
_TL(
""),
true); }
196 if( !Parameters(
"NODE_DISPLAY") ) { Parameters.
Add_Node(
"",
"NODE_DISPLAY",
_TL(
"Display" ),
_TL(
"") ); }
197 if( !Parameters(
"NODE_COLORS" ) ) { Parameters.
Add_Node(
"",
"NODE_COLORS" ,
_TL(
"Colors" ),
_TL(
"") ); }
198 if( !Parameters(
"NODE_SIZE" ) ) { Parameters.
Add_Node(
"",
"NODE_SIZE" ,
_TL(
"Size" ),
_TL(
"") ); }
199 if( !Parameters(
"NODE_LABEL" ) ) { Parameters.
Add_Node(
"",
"NODE_LABEL" ,
_TL(
"Labels" ),
_TL(
"") ); }
200 if( !Parameters(
"NODE_CHART" ) ) { Parameters.
Add_Node(
"",
"NODE_CHART" ,
_TL(
"Charts" ),
_TL(
"") ); }
210 "TABLE_FLT_STYLE" ,
_TL(
"Floating Point Numbers"),
211 _TL(
"Specify floating point decimal precision in table and similar views."),
213 _TL(
"system default"),
215 _TL(
"fix number of decimals")
219 Parameters.
Add_Int(
"TABLE_FLT_STYLE",
220 "TABLE_FLT_DECIMALS",
_TL(
"Decimals"),
229 Parameters.
Add_Bool (
"NODE_LEGEND" ,
"LEGEND_SHOW" ,
_TL(
"Map Legends" ),
_TL(
"Include in map legends."),
true);
232 Parameters.
Add_String(
"LEGEND_TITLE",
"LEGEND_TITLE_TEXT" ,
_TL(
"User Defined"),
_TL(
""),
_TL(
"Title"));
239 Parameters.
Add_String(
"LEGEND_FIELD",
"LEGEND_FIELD_TEXT",
_TL(
"User Defined" ),
_TL(
""),
_TL(
"Label"));
245 Parameters.
Add_Bool (
"NODE_DISPLAY",
"SHOW_ALWAYS",
_TL(
"Show at all scales"),
_TL(
""),
true);
246 Parameters.
Add_Range (
"SHOW_ALWAYS" ,
"SHOW_RANGE" ,
_TL(
"Scale Range"),
247 _TL(
"only show within scale range; values are given as extent measured in map units"),
248 100., 1000., 0.,
true
256 Parameters.
Add_Double(Parameters(
"TRANSPARENCY_MODE") ?
"TRANSPARENCY_MODE" :
"NODE_DISPLAY",
257 "TRANSPARENCY",
_TL(
"Transparency"),
258 _TL(
"Transparency specified as percentage."),
259 0., 0.,
true, 100.,
true
269 _TL(
"Single Symbol" ),
270 _TL(
"Classification" ),
271 _TL(
"Discrete Colors" ),
272 _TL(
"Graduated Colors")
278 _TL(
"Single Symbol" ),
279 _TL(
"Classification" ),
280 _TL(
"Discrete Colors" ),
281 _TL(
"Graduated Colors"),
282 _TL(
"RGB Coded Values")
288 _TL(
"Single Symbol" ),
289 _TL(
"Classification" ),
290 _TL(
"Discrete Colors" ),
291 _TL(
"Graduated Colors"),
292 _TL(
"RGB Composite" ),
293 _TL(
"RGB Coded Values")
299 _TL(
"Single Symbol" ),
300 _TL(
"Classification" ),
301 _TL(
"Discrete Colors" ),
302 _TL(
"Graduated Colors"),
303 _TL(
"RGB Composite" )
308 Parameters.
Add_Choice(
"NODE_COLORS",
"COMPOSITE_R" ,
_TL(
"Red" ),
_TL(
""),
"");
309 Parameters.
Add_Choice(
"NODE_COLORS",
"COMPOSITE_G" ,
_TL(
"Green" ),
_TL(
""),
"");
310 Parameters.
Add_Choice(
"NODE_COLORS",
"COMPOSITE_B" ,
_TL(
"Blue" ),
_TL(
""),
"");
316 static BYTE s_Def_Layer_Colour = 0;
319 "NODE_SINGLE" ,
_TL(
"Single Symbol"),
324 "SINGLE_COLOR" ,
_TL(
"Color"),
332 Parameters.
Add_Node(
"NODE_COLORS",
"NODE_CLASSIFIED",
_TL(
"Classification"),
_TL(
""));
352 #define ADD_LUT_CLASS(name, desc, min, max) { CSG_Table_Record &r = *pLUT->Add_Record();\
353 r.Set_Value(0, SG_Color_Get_Random()); r.Set_Value(1, name); r.Set_Value(2, desc); r.Set_Value(3, min); r.Set_Value(4, max);\
371 "NODE_STRETCH",
_TL(
"Histogram Stretch"),
382 Parameters.
Add_Choice(
"STRETCH_NORMALIZE",
"STRETCH_NORMALIZE_FORMAT",
_TL(
"Labeling"),
_TL(
""),
389 Parameters.
Add_Range(
"NODE_STRETCH",
"STRETCH_RANGE_R",
_TL(
"Red" ),
_TL(
""));
390 Parameters.
Add_Range(
"NODE_STRETCH",
"STRETCH_RANGE_G",
_TL(
"Green"),
_TL(
""));
391 Parameters.
Add_Range(
"NODE_STRETCH",
"STRETCH_RANGE_B",
_TL(
"Blue" ),
_TL(
""));
396 "STRETCH_COLORS" ,
_TL(
"Colors"),
402 "STRETCH" ,
_TL(
"Stretch Type"),
403 _TL(
"Specify how to adjust histogram stretch."),
405 _TL(
"Minimum Maximum"),
406 _TL(
"Standard Deviation"),
414 "STRETCH_LINEAR" ,
_TL(
"Minimum Maximum"),
415 _TL(
"Apply the stretch between the minimum and maximum values specified as percentage of the full value range."),
421 "STRETCH_STDDEV" ,
_TL(
"Standard Deviation"),
422 _TL(
"Apply the stretch between a specified number of standard deviations."),
426 Parameters.
Add_Bool(
"STRETCH_STDDEV",
427 "STRETCH_STDDEV_RANGE" ,
_TL(
"Keep in Range"),
428 _TL(
"Prevents that minimum or maximum stretch values fall outside of the actual data value range."),
433 "STRETCH_PERCENT" ,
_TL(
"Percent Clip"),
434 _TL(
"Adjust the stretch to the percentiles specified here."),
441 "STRETCH_RANGE" ,
_TL(
"Range"),
446 "STRETCH_INTERVALS" ,
_TL(
"Scaling"),
449 _TL(
"linear intervals"),
450 _TL(
"increasing geometric intervals"),
451 _TL(
"decreasing geometric intervals"),
452 _TL(
"histogram equalize")
457 "STRETCH_INTERVALS_LOG" ,
_TL(
"Geometric Interval Factor"),
459 1., 0.,
true, 16.,
true
499 if( Parameters(
"STRETCH")->asInt() == 3 )
505 if( Parameters(
"COLOR_SYMBOLS")->asInt() == 2 || Parameters(
"COLOR_SYMBOLS")->asInt() == 3 )
513 int Field = Parameters(
"CLASSIFIED_FIELD")->asInt();
515 if( Field >= 0 && Field < m_pObject->asTable(
true)->Get_Field_Count() )
552 Parameters(
"LEGEND_SHOW")->asBool()
574 int Value = Parameter.
asInt();
728 if( Parameters[
"STRETCH"].asInt() == 3 )
732 Parameters[
"STRETCH"].Set_Value(0);
734 Parameters[
"STRETCH"].Set_Value(3);
751 int Field = -1;
CSG_Table *pTable = _Get_Field_Table(Field, Parameters);
753 if( pTable && Field < 0 )
760 int i = Parameters(
"BAND") ? Parameters[
"BAND"].asInt() : -1;
773 switch( Parameters[
"STRETCH"].asInt() )
791 if( Parameters[
"STRETCH_STDDEV_RANGE"].asBool() )
935 dc.DrawBitmap(Bitmap, 0, 0,
false);
936 dc.SelectObject(wxNullBitmap);
1002 return(
m_Parameters[
"STRETCH_COLORS"].asColors()->Create(Colors) );
1017 if( !pTable || Field_Value < 0 || Field_Normalize < 0 || Field_Value >= pTable->
Get_Field_Count() || Field_Normalize >= pTable->
Get_Field_Count() )
1026 double Value, Normalize;
1028 if( pTable->
Get_Value(i, Field_Normalize, Normalize) && Normalize != 0. && pTable->
Get_Value(i, Field_Value, Value) )
1030 m_Normalization.Add_Record()->Set_Value(0, Scale_Normalize * Value / Normalize);
1042 if( pTable && Parameters(
"STRETCH_FIELD") && Parameters(
"STRETCH_NORMALIZE") && Parameters(
"STRETCH_NORMALIZE_FORMAT") )
1069 case 1:
return(
m_Parameters[
"LEGEND_TITLE_TEXT"].asString());
1070 default:
return(
"" );
1079 if( pTable &&
m_Parameters[
"LEGEND_FIELD"].asInt() != 2 )
1087 int Value = -1, Normal = -1;
1127 if( pTable && Index >= 0 && Index < pTable->Get_Count() )
1131 Value.Printf(
"%s: %lld",
_TL(
"Index"), Index + 1);
1143 if( pTable->
Get_Value(Index, Field, s) )
1168 if( pTable->
Get_Value(Index, Field, d) )
1183 Value.Printf(
"%f", d);
1198 if( pTable && Index >= 0 && Index < pTable->Get_Count() && Field >= 0 && Field < pTable->Get_Field_Count() )
1200 if( pTable->
Get_Value(Index, Field, Value) )
1209 if( pTable->
Get_Value(Index, Normalize, Divisor) && Divisor != 0. )
1211 Value *= Scale / Divisor;
1261 if( bAddNone && bSelectNone )
1306 dc_Map.
SetPen (wxNullPen );
1344 int Classes_Max; Options.
Get_Content(
"CLASSES_MAX", Classes_Max = 1024);
1345 int Classes ; Options.
Get_Content(
"CLASSES" , Classes = 10);
1346 int Increasing ; Options.
Get_Content(
"INCREASING" , Increasing = 1);
1347 int Histogram ; Options.
Get_Content(
"HISTOGRAM" , Histogram = 1);
1348 double StdDev ; Options.
Get_Content(
"STDDEV" , StdDev = 0.5);
1349 double StdDev_Max ; Options.
Get_Content(
"STDDEV_MAX" , StdDev_Max = 4.0);
1350 double Interval ; Options.
Get_Content(
"INTERVAL" , Interval = 0.0);
1351 double Offset;
bool bOffset = Options.
Get_Content(
"OFFSET", Offset = 0.0);
1355 case 0:
Classify.Classify_Unique (Classes_Max );
break;
1356 case 1:
Classify.Classify_Equal (Classes );
break;
1357 case 2:
if( bOffset )
1358 {
Classify.Classify_Defined (Interval, Offset ); }
1359 else {
Classify.Classify_Defined (Interval ); }
break;
1360 case 3:
Classify.Classify_Quantile (Classes, Histogram == 1);
break;
1361 case 4:
Classify.Classify_Geometric(Classes, Increasing == 1);
break;
1362 case 5:
Classify.Classify_Natural (Classes );
break;
1363 case 6:
Classify.Classify_StdDev (StdDev, StdDev_Max );
break;
1367 int ColorsID = -1; Options.
Get_Content(
"COLORS", ColorsID);
1372 if(
m_Parameters[
"CLASSIFIED_LUT"].asTable()->Get_MetaData().Get_Child(
"SAGA_GUI_LUT_TYPE") == NULL )
bool SG_UI_Process_Set_Busy(bool bOn, const CSG_String &Message)
bool SG_Data_Type_is_Numeric(TSG_Data_Type Type)
#define SG_COLOR_BLUE_DARK
#define SG_COLOR_GREY_LIGHT
#define SG_COLOR_GREEN_DARK
#define SG_COLOR_BLUE_GREEN
#define SG_COLOR_RED_DARK
#define SG_COLOR_YELLOW_DARK
virtual bool is_Valid(void) const =0
CSG_MetaData & Get_MetaData(void) const
class CSG_Grids * asGrids(bool bPolymorph=false) const
virtual TSG_Data_Object_Type Get_ObjectType(void) const =0
Returns the object type as defined by TSG_Data_Object_Type. Used for run time type checking.
class CSG_Grid * asGrid(bool bPolymorph=false) const
class CSG_Table * asTable(bool bPolymorph=false) const
const CSG_Simple_Statistics & Get_Statistics(void)
const CSG_Histogram & Get_Histogram(size_t nClasses=0)
const CSG_Simple_Statistics & Get_Statistics(void)
CSG_Grid * Get_Grid_Ptr(int i) const
const CSG_Histogram & Get_Histogram(size_t nClasses=0)
double Get_Percentile(double Percentile) const
void SetBrush(const wxBrush &Brush)
void SetPen(const wxPen &Pen)
wxBitmap Get_Bitmap(void)
CSG_Table m_Normalization
bool Set_Normalization(int Field_Value, int Field_Normalize, double Scale_Normalize, sLong maxSamples=0)
bool Draw(CSG_Map_DC &dc_Map, int Flags=0, CSG_Data_Object *pObject=NULL)
virtual bool Parameters_Changed(void)
bool Set_Fields_Choice(CSG_Parameter &Choice, bool bNumeric, bool bAddNone, bool bSelectNone=false)
class CSG_Map_Legend * m_pLegend
bool Get_Field_Value(sLong Index, int Field, int Normalize, double Scale, wxString &Value) const
bool Classify(const CSG_MetaData &Options)
static int Get_Fields_Choice(CSG_Parameter &Choice)
CSG_Table & Get_LUT(void)
virtual bool DataObject_Changed(void)
TSG_Data_Object_Type m_Type
virtual ~CSG_Map_Layer(void)
bool Set_Colors(const CSG_Colors &Colors)
virtual bool Parameter_Changed(CSG_Parameters &Parameters, CSG_Parameter &Parameter, int Flags)
CSG_Data_Object * m_pObject
wxString Get_Legend_Subtitle(void) const
static CSG_Parameters & Get_Defaults(void)
bool Set_Stretch_FullRange(void)
const TSG_Data_Object_Type & Get_ObjectType(void) const
class wxBitmap * m_pThumbnail
virtual void On_Draw(CSG_Map_DC &dc_Map, int Flags)
wxString Get_Legend_Title(void) const
bool Set_Parameters(const CSG_Parameters &Parameters)
bool Set_Stretch(CSG_Parameters &Parameters, CSG_Data_Object *pObject=NULL, const CSG_String &Suffix="")
double Get_Stretch_Minimum(void) const
bool Sync_Back(CSG_Parameters &Target) const
double Get_Stretch_Range(void) const
bool Set_Stretch_Range(double Minimum, double Maximum)
bool Sync_Forward(const CSG_Parameters &Source)
bool Set_Object(CSG_Data_Object *pObject)
CSG_Rect Get_Extent(void) const
double Get_Stretch_Maximum(void) const
CSG_Parameters m_Parameters
class CSG_Map_Symbology * m_pSymbology
CSG_Colors & Get_Colors(void)
virtual bool Add_Parameters(CSG_Parameters &Parameters)
const class wxBitmap * Get_Thumbnail(int dx, int dy)
bool Set_Items(const SG_Char *String)
CSG_String Get_Data(void) const
int Get_Count(void) const
bool Assign(CSG_Parameter *pSource)
bool Set_Collapsed(bool bOn=true)
bool Set_Children_Enabled(bool bEnabled=true)
class CSG_Parameter_Choice * asChoice(void) const
virtual TSG_Parameter_Type Get_Type(void) const =0
virtual bool Set_Value(int Value)
bool Cmp_Identifier(const CSG_String &Identifier) const
CSG_Table * asTable(void) const
void Set_Name(const CSG_String &Name)
bool Set_Callback(bool bActive=true)
CSG_Parameter * Add_Grid_Resampling(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Grid_Resampling Methods=CSG_Grid_Resampling::Interpolations, CSG_Grid_Resampling Default=CSG_Grid_Resampling::Bicubic_2)
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)
int Get_Count(void) const
void Set_Enabled(bool bEnabled=true)
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_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_FixedTable(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Table *pInit=NULL)
bool Set_Parameter(const CSG_String &ID, CSG_Parameter *pValue)
CSG_Parameter * Add_Bool(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool Value=false)
CSG_Parameter * Add_String(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &String, bool bLongText=false, bool bPassword=false)
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)
CSG_Parameter * Add_Colors(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Palette=0, int nColors=11, bool bRevert=false)
static CSG_String Format(const char *Format,...)
const SG_Char * c_str(void) const
bool is_Empty(void) const
const SG_Char * Get_Field_Name(int Field) const
sLong Get_Count(void) const
double Get_Minimum(int Field) const
virtual bool Get_Value(sLong Index, int Field, CSG_String &Value) const
const CSG_Histogram & Get_Histogram(int Field, size_t nClasses=0) const
int Get_Field_Count(void) const
virtual bool Add_Field(const CSG_String &Name, TSG_Data_Type Type, int Position=-1)
const CSG_Simple_Statistics & Get_Statistics(int Field) const
TSG_Data_Type Get_Field_Type(int Field) const
double Get_Maximum(int Field) const
CSG_String SG_Get_DataObject_Name(TSG_Data_Object_Type Type)
@ SG_DATAOBJECT_TYPE_PointCloud
@ SG_DATAOBJECT_TYPE_Grids
@ SG_DATAOBJECT_TYPE_Shapes
@ SG_DATAOBJECT_TYPE_Grid
wxColour SG_System_Get_Color(wxSystemColour index)
int SG_Get_Color(const wxColour &Color)
static int s_Def_Layer_Colours[DEF_LAYER_COLOUR_COUNT]
#define ADD_LUT_CLASS(name, desc, min, max)
#define DEF_LAYER_COLOUR_COUNT
#define LAYER_DRAW_FLAG_THUMBNAIL
#define LAYER_DRAW_FLAG_NOLABELS
#define LAYER_DRAW_FLAG_NOEDITS
#define PARAMETER_CHECK_ENABLE
#define PARAMETER_CHECK_VALUES